dvrtools 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/dnsmap +16 -1
- data/lib/dvrtools/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: add60494b261950949a033c3839f1d951860f0d9
|
4
|
+
data.tar.gz: 37f20949e643e0ad030a7f914995e27decbe619a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32bc6d2f78f5f6b56ba04e67d45a627f62253f4a1f948ecbba714cc5c64a8d1201291005fd9ac43be362bbc9ba24856f4d96fcb9efa80ead73292a57e519c48a
|
7
|
+
data.tar.gz: 5105e6527dea53eeec2e517fa7a8e28b25023613a6d7e4e522884f0ac90ed76fa8e2035f8dcfa79500a097fbe811188c3503616922f84599a83cc31aece1278c
|
data/bin/dnsmap
CHANGED
@@ -5,6 +5,7 @@ require 'digest/md5'
|
|
5
5
|
require 'msgpack'
|
6
6
|
require 'eventmachine'
|
7
7
|
require 'gviz'
|
8
|
+
require 'open3'
|
8
9
|
require 'pp'
|
9
10
|
|
10
11
|
opt = {
|
@@ -13,6 +14,8 @@ opt = {
|
|
13
14
|
:aggregate => false,
|
14
15
|
:layout => 'neato',
|
15
16
|
:verbose => false,
|
17
|
+
:pcapfile => nil,
|
18
|
+
:binpath => 'devourer'
|
16
19
|
}
|
17
20
|
|
18
21
|
optpsr = OptionParser.new
|
@@ -20,6 +23,8 @@ optpsr.on('-o VAL', 'output file name') {|v| opt[:output] = v }
|
|
20
23
|
optpsr.on('-i VAL', 'interval (sec)') {|v| opt[:interval] = v.to_i }
|
21
24
|
optpsr.on('-a', 'aggregate IP address by /24') {|v| opt[:aggregate] = v }
|
22
25
|
optpsr.on('-l VAL', 'graphviz layout, default: neato') {|v| opt[:layout] = v}
|
26
|
+
optpsr.on('-r VAL', 'specify pcap file') {|v| opt[:pcapfile] = v}
|
27
|
+
optpsr.on('-b VAL', 'path of devourer') {|v| opt[:binpath] = v}
|
23
28
|
optpsr.on('-q', 'quiet mode') {|v| $VERBOSE = nil}
|
24
29
|
optpsr.on('-v', 'verbose mode') {|v| opt[:verbose] = v }
|
25
30
|
|
@@ -141,7 +146,17 @@ end
|
|
141
146
|
|
142
147
|
if args.size == 0
|
143
148
|
EM.run do
|
144
|
-
|
149
|
+
if opt[:pcapfile].nil?
|
150
|
+
warn 'stdin'
|
151
|
+
input_stream = STDIN
|
152
|
+
else
|
153
|
+
warn 'popen'
|
154
|
+
stdin, stdout, stderr = Open3.popen3("#{opt[:binpath]} -r #{opt[:pcapfile]} -o -")
|
155
|
+
stdout.sync = true
|
156
|
+
input_stream = stdout;
|
157
|
+
end
|
158
|
+
|
159
|
+
dm = EM.attach(input_stream, DnsMap, opt)
|
145
160
|
|
146
161
|
if opt[:interval] > 0
|
147
162
|
pt = EventMachine::PeriodicTimer.new(interval) do
|
data/lib/dvrtools/version.rb
CHANGED