flowtag 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/bin/flowtag +14 -14
- data/lib/flowtag/flowcanvas.rb +6 -6
- metadata +4 -4
- metadata.gz.sig +2 -1
data.tar.gz.sig
CHANGED
Binary file
|
data/bin/flowtag
CHANGED
@@ -30,7 +30,7 @@ require 'tk-double-slider'
|
|
30
30
|
|
31
31
|
def select_cb(flows)
|
32
32
|
$flowtable.clear
|
33
|
-
$flowtable.addflows(flows.sort_by { |fl| fl[FlowDB::ST] })
|
33
|
+
$flowtable.addflows(flows.sort_by { |fl| fl[FlowTag::FlowDB::ST] })
|
34
34
|
$flowview.clear
|
35
35
|
$tag_entry.delete('@0','end')
|
36
36
|
$currflow = nil
|
@@ -88,19 +88,19 @@ def finish
|
|
88
88
|
end
|
89
89
|
if ARGV[0] == '-o'
|
90
90
|
outputdir = ARGV[1]
|
91
|
-
$fdb = FlowDB.new(ARGV[2],outputdir)
|
91
|
+
$fdb = FlowTag::FlowDB.new(ARGV[2],outputdir)
|
92
92
|
else
|
93
|
-
$fdb = FlowDB.new(ARGV[0])
|
93
|
+
$fdb = FlowTag::FlowDB.new(ARGV[0])
|
94
94
|
end
|
95
95
|
pkt_min = byte_min = time_min = 2**32
|
96
96
|
pkt_max = byte_max = time_max = 0
|
97
97
|
$fdb.flows.each do |key,flow|
|
98
|
-
pkt_min = flow[FlowDB::PKTS] if flow[FlowDB::PKTS] < pkt_min
|
99
|
-
pkt_max = flow[FlowDB::PKTS] if flow[FlowDB::PKTS] > pkt_max
|
100
|
-
byte_min = flow[FlowDB::BYTES] if flow[FlowDB::BYTES] < byte_min
|
101
|
-
byte_max = flow[FlowDB::BYTES] if flow[FlowDB::BYTES] > byte_max
|
102
|
-
time_min = flow[FlowDB::ST] if flow[FlowDB::ST] < time_min
|
103
|
-
time_max = flow[FlowDB::ST] if flow[FlowDB::ST] > time_max
|
98
|
+
pkt_min = flow[FlowTag::FlowDB::PKTS] if flow[FlowTag::FlowDB::PKTS] < pkt_min
|
99
|
+
pkt_max = flow[FlowTag::FlowDB::PKTS] if flow[FlowTag::FlowDB::PKTS] > pkt_max
|
100
|
+
byte_min = flow[FlowTag::FlowDB::BYTES] if flow[FlowTag::FlowDB::BYTES] < byte_min
|
101
|
+
byte_max = flow[FlowTag::FlowDB::BYTES] if flow[FlowTag::FlowDB::BYTES] > byte_max
|
102
|
+
time_min = flow[FlowTag::FlowDB::ST] if flow[FlowTag::FlowDB::ST] < time_min
|
103
|
+
time_max = flow[FlowTag::FlowDB::ST] if flow[FlowTag::FlowDB::ST] > time_max
|
104
104
|
end
|
105
105
|
root = TkRoot.new() {
|
106
106
|
title "FlowTag v2.0"
|
@@ -129,7 +129,7 @@ right_bot_frame.grid(:row=>1,:column=>0,:sticky=>'news')
|
|
129
129
|
tags_frame.grid(:row=>0,:column=>2,:sticky=>'new')
|
130
130
|
|
131
131
|
# LEFT FRAME
|
132
|
-
$flowtable = FlowTable.new(left_top_frame,$fdb.flows.values.sort_by { |fl| fl[FlowDB::ST] })
|
132
|
+
$flowtable = FlowTag::FlowTable.new(left_top_frame,$fdb.flows.values.sort_by { |fl| fl[FlowTag::FlowDB::ST] })
|
133
133
|
$flowtable.pack(:side=>'top',:expand=>1,:fill=>'both',:anchor=>'n')
|
134
134
|
$flowtable.set_select_cb(proc { |idxs,flows| tableselect_cb(idxs,flows) })
|
135
135
|
|
@@ -163,10 +163,10 @@ end
|
|
163
163
|
$tags_list.bind('<ListboxSelect>',proc { tag_select })
|
164
164
|
|
165
165
|
# RIGHT FRAME
|
166
|
-
$flowcanvas = FlowCanvas.new(right_top_frame,$fdb.flows.sort_by { |k,fl| fl[FlowDB::ST] })
|
167
|
-
$timeslide =
|
168
|
-
$pktslide =
|
169
|
-
$byteslide =
|
166
|
+
$flowcanvas = FlowTag::FlowCanvas.new(right_top_frame,$fdb.flows.sort_by { |k,fl| fl[FlowTag::FlowDB::ST] })
|
167
|
+
$timeslide = Tk::DoubleSlider.new(right_bot_frame, :min=>time_min, :max=>time_max, :low=>time_min, :high=>time_max, :snap => 300, :label=>'Time', :valuefmt => proc { |x| Time.at(x).strftime("%H:%M") }, :deltafmt => proc { |x| sprintf("%0.2f hours", (x/3600.0)) })
|
168
|
+
$pktslide = Tk::DoubleSlider.new(right_bot_frame, :min=>1, :max=>pkt_max, :low=>1, :high=>pkt_max, :logbase => true, :snap => 1.0, :label=>'Packets')
|
169
|
+
$byteslide = Tk::DoubleSlider.new(right_bot_frame, :min=>1, :max=>byte_max, :low=>1, :high=>byte_max, :logbase => true, :snap => 1.0, :label=>'Bytes')
|
170
170
|
$flowcanvas.pack
|
171
171
|
$timeslide.pack(:side=>'top')
|
172
172
|
$pktslide.pack
|
data/lib/flowtag/flowcanvas.rb
CHANGED
@@ -30,10 +30,10 @@ module FlowTag
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def select_flow(sip,dip,sp,dp)
|
33
|
-
@pcp.set_tuple_state(@cflow,
|
33
|
+
@pcp.set_tuple_state(@cflow,Tk::ParallelCoordinates::STATE_NORMAL) if @cflow
|
34
34
|
key = dp.to_s+"|"+sip
|
35
35
|
@cflow = key
|
36
|
-
@pcp.set_tuple_state(key,
|
36
|
+
@pcp.set_tuple_state(key,Tk::ParallelCoordinates::STATE_CURRENT)
|
37
37
|
end
|
38
38
|
|
39
39
|
def set_select_cb(callback)
|
@@ -64,9 +64,9 @@ module FlowTag
|
|
64
64
|
if fl[FlowDB::PKTS] < @pkt_low or fl[FlowDB::PKTS] > @pkt_high or
|
65
65
|
fl[FlowDB::BYTES] < @byte_low or fl[FlowDB::BYTES] > @byte_high or
|
66
66
|
fl[FlowDB::ST] < @time_low or fl[FlowDB::ST] > @time_high
|
67
|
-
@pcp.set_tuple_state(key,
|
67
|
+
@pcp.set_tuple_state(key,Tk::ParallelCoordinates::STATE_FILTERED)
|
68
68
|
else
|
69
|
-
@pcp.set_tuple_state(key,
|
69
|
+
@pcp.set_tuple_state(key,Tk::ParallelCoordinates::STATE_NORMAL)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
@@ -102,7 +102,7 @@ module FlowTag
|
|
102
102
|
:list => hosts
|
103
103
|
}
|
104
104
|
]
|
105
|
-
@pcp =
|
105
|
+
@pcp = Tk::ParallelCoordinates.new(parent, 500, 360, model)
|
106
106
|
@pcp.set_select_cb( proc { |tuples| cb_select(tuples) } )
|
107
107
|
@flow_keys = {}
|
108
108
|
@pkt_low = @byte_low = @pkt_high = @byte_high = @time_high = 0
|
@@ -117,7 +117,7 @@ module FlowTag
|
|
117
117
|
@time_low = fl[FlowDB::ST] if fl[FlowDB::ST] < @time_low
|
118
118
|
@time_high = fl[FlowDB::ST] if fl[FlowDB::ST] > @time_high
|
119
119
|
next if skip
|
120
|
-
@pcp.addtuple(key,
|
120
|
+
@pcp.addtuple(key,Tk::ParallelCoordinates::STATE_NORMAL,[fl[FlowDB::DP],fl[FlowDB::SIP]])
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flowtag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 2.1.
|
9
|
+
- 1
|
10
|
+
version: 2.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Lee
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
6yhklP75
|
38
38
|
-----END CERTIFICATE-----
|
39
39
|
|
40
|
-
date: 2011-03-
|
40
|
+
date: 2011-03-09 00:00:00 -05:00
|
41
41
|
default_executable:
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
metadata.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
yC)��NR$4jC����F�䐡 U*������#E6��i�X* k^쇌���FM��~~��#j��W4pJ�\X��Hh�Z%���1C=+��e�'��7T
|
2
|
+
_l�ا��{Zf����i��Lp������8S��c"l9
|