trisulrp 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e3d5ec5c5c5a153c3ad182292e7d7e2b67b1598
4
- data.tar.gz: 65e73a1228e3f94459b69518db2aac2095e06fb0
3
+ metadata.gz: bc727ea609ee05bb1dbb182163659b77b55bb6a0
4
+ data.tar.gz: c60158c840151d4bcd4724da50f8072b9ba8e53a
5
5
  SHA512:
6
- metadata.gz: 68333ba5a7e17c805b1ed89fa63ee57739b8d7c5d657ad683cb129f4fd6ac1adcffae735a04eaf778d9e046daaed1ca3c6e70302662ad299b24ae3a244dc1588
7
- data.tar.gz: 3c0d676a7929abf9386519827dab7cfba14a1d46577157c975238eae9faf93839480fb3ccf6589f0331d63a207193842286e46f9212aaaff469ac360bf15c221
6
+ metadata.gz: 944977d6634b588530794221bd07c67f2dc73bf85f6e16a637f4517525bc163b41b2481ec9b8466904b1a1b5300a4e992d7e774665e11de5e491a23f4e1341d3
7
+ data.tar.gz: 416f7ef0d36bd552268719a573459fd5f249740b7f21792e3c7c44146464bf1c825cf4260b8f905a3961db14bc3bcd81a232c90fd432fae3572cdcfd317266be
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.4
1
+ 2.0.5
@@ -597,7 +597,7 @@ module TRP
597
597
 
598
598
  optional :int64, :context, 1
599
599
  required :string, :session_group, 2
600
- repeated ::TRP::SessionID, :sessions, 3
600
+ repeated ::TRP::SessionDetails, :sessions, 3
601
601
  end
602
602
 
603
603
  class SessionGroupRequest < ::ProtocolBuffers::Message
@@ -794,7 +794,7 @@ module TRP
794
794
 
795
795
  optional :int64, :context, 1
796
796
  optional :string, :session_group, 2, :default => "{99A78737-4B41-4387-8F31-8077DB917336}"
797
- repeated ::TRP::SessionID, :sessions, 3
797
+ repeated ::TRP::SessionDetails, :sessions, 3
798
798
  repeated :string, :hints, 4
799
799
  end
800
800
 
@@ -1,7 +1,7 @@
1
1
  // Trisul Remote Protocol (TRP) definition
2
2
  // Based on Google Protocol Buffers
3
3
  // (c) 2010-11, Unleash Networks (http://www.unleashnetworks.com)
4
- // $Rev: 6929 $
4
+ // $Rev: 6931 $
5
5
  package TRP;
6
6
 
7
7
  message Timestamp {
@@ -484,7 +484,7 @@ message SessionTrackerRequest {
484
484
  message SessionTrackerResponse{
485
485
  optional int64 context=1;
486
486
  required string session_group=2;
487
- repeated SessionID sessions=3;
487
+ repeated SessionDetails sessions=3;
488
488
  }
489
489
 
490
490
  ///////////////////////////////////
@@ -669,7 +669,7 @@ message GrepRequest {
669
669
  message GrepResponse {
670
670
  optional int64 context=1;
671
671
  optional string session_group=2[default="{99A78737-4B41-4387-8F31-8077DB917336}"];
672
- repeated SessionID sessions=3;
672
+ repeated SessionDetails sessions=3;
673
673
  repeated string hints=4;
674
674
  }
675
675
 
@@ -17,7 +17,8 @@ module TrisulRP::Utils
17
17
  # Print session (flow) details
18
18
  #
19
19
  # [conn] active TRP connection opened earlier
20
- # [sessions] an array of SessionIDs
20
+ # [sessions] an array of SessionIDs or
21
+ # an array of slice:sid strings
21
22
  #
22
23
  # ==== Returns
23
24
  # ==== Yields
@@ -26,7 +27,7 @@ module TrisulRP::Utils
26
27
  # Prints details about the list of sessions (flows) passed
27
28
  #
28
29
  # ==== On error
29
- def print_session_details(conn,sessions)
30
+ def print_session_ids(conn,sessions)
30
31
  all_sids = sessions.collect{ |ai| TRP::SessionID.new(
31
32
  :slice_id => ai.slice_id,
32
33
  :session_id => ai.session_id ) }
@@ -36,20 +37,93 @@ module TrisulRP::Utils
36
37
 
37
38
  TrisulRP::Protocol.get_response(conn,follow_up) do |resp|
38
39
  resp.items.each do |item|
39
- print "#{item.session_id.slice_id},#{item.session_id.session_id} "
40
- print "#{Time.at(item.time_interval.from.tv_sec)} "
41
- print "#{item.time_interval.to.tv_sec-item.time_interval.from.tv_sec} ".rjust(8)
42
- print "#{item.key1A.label}".ljust(28)
43
- print "#{item.key2A.label}".ljust(11)
44
- print "#{item.key1Z.label}".ljust(28)
45
- print "#{item.key2Z.label}".ljust(11)
46
- print "#{item.az_bytes}".rjust(10)
47
- print "#{item.za_bytes}".rjust(10)
48
- print "\n"
40
+ print_session_details(item)
49
41
  end
50
42
  end
51
43
  end
52
44
 
45
+
46
+ # Print a SessionDetails object
47
+ #
48
+ # Use this to output session to screen
49
+ #
50
+ # [sess] a single SessionDetails object
51
+ #
52
+ # ==== Returns
53
+ # ==== Yields
54
+ # Nothing
55
+ #
56
+ # Pretty prints a single line session details
57
+ #
58
+ # ==== On error
59
+ def print_session_details(sess)
60
+ print "#{sess.session_id.slice_id}:#{sess.session_id.session_id} ".ljust(12)
61
+ print "#{Time.at(sess.time_interval.from.tv_sec)} ".ljust(26)
62
+ print "#{sess.time_interval.to.tv_sec-sess.time_interval.from.tv_sec} ".rjust(8)
63
+ print "#{sess.key1A.label}".ljust(28)
64
+ print "#{sess.key2A.label}".ljust(11)
65
+ print "#{sess.key1Z.label}".ljust(28)
66
+ print "#{sess.key2Z.label}".ljust(11)
67
+ print "#{sess.az_bytes}".rjust(10)
68
+ print "#{sess.za_bytes}".rjust(10)
69
+ print "#{sess.az_payload}".rjust(10)
70
+ print "#{sess.za_payload}".rjust(10)
71
+ print "#{sess.setup_rtt}".rjust(10)
72
+ print "#{sess.retransmissions}".rjust(10)
73
+ print "#{sess.tags}".rjust(10)
74
+ print "\n"
75
+
76
+ end
77
+
78
+
79
+ # Print the header column for sess details
80
+ #
81
+ # Use this to output session to screen
82
+ #
83
+ #
84
+ # ==== Returns
85
+ # ==== Yields
86
+ # Nothing
87
+ #
88
+ # Pretty prints a single line session details header w/ correct col widths
89
+ #
90
+ # ==== On error
91
+ def print_session_details_header
92
+ print "SID".ljust(12)
93
+ print "Start Time".ljust(26)
94
+ print "Dur ".rjust(8)
95
+ print "IP-A".ljust(28)
96
+ print "Port-A".ljust(11)
97
+ print "IP-Z".ljust(28)
98
+ print "Port-Z".ljust(11)
99
+ print "Fwd Bytes".rjust(10)
100
+ print "Rev Bytes".rjust(10)
101
+ print "Fwd Payld".rjust(10)
102
+ print "Rev Payld".rjust(10)
103
+ print "RTT".rjust(10)
104
+ print "Retrans".rjust(10)
105
+ print "Tags".rjust(10)
106
+ print "\n"
107
+
108
+ print "-"*11 + "+"
109
+ print "-"*25 + "+"
110
+ print "-"*7 + "+"
111
+ print "-"*27 + "+"
112
+ print "-"*10 + "+"
113
+ print "-"*27 + "+"
114
+ print "-"*10 + "+"
115
+ print "-"*9 + "+"
116
+ print "-"*9 + "+"
117
+ print "-"*9 + "+"
118
+ print "-"*9 + "+"
119
+ print "-"*9 + "+"
120
+ print "-"*9 + "+"
121
+ print "-"*9 + "+"
122
+ print "\n"
123
+ end
124
+
125
+
126
+
53
127
  # Make key
54
128
  #
55
129
  # Convert an item into Trisul Key format.
data/trisulrp.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "trisulrp"
8
- s.version = "2.0.4"
8
+ s.version = "2.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["vivek"]
12
- s.date = "2014-06-14"
12
+ s.date = "2014-06-23"
13
13
  s.description = "This gem deals about the trisul remote protocol"
14
14
  s.email = "vivek_rajagopal@yahoo.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trisulrp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-14 00:00:00.000000000 Z
11
+ date: 2014-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-protocol-buffers