trisulrp 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,7 +2,8 @@ source "http://rubygems.org"
2
2
  # Add dependencies required to use your gem here.
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
- gem "ruby-protocol-buffers", ">= 0.8.5"
5
+ gem "ruby-protocol-buffers", ">= 0.8.5"
6
+
6
7
  # Add dependencies to develop your gem here.
7
8
  # Include everything needed to run rake, tests, features, etc.
8
9
  group :development do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.2
1
+ 1.2.3
data/examples/strp.rb CHANGED
@@ -1,20 +1,17 @@
1
1
  # Trisul Remote Protocol TRP Demo script
2
2
  # Akhil.M & Dhinesh.K (c) 2010 Unleash Networks
3
+ # Testing change
3
4
  require 'rubygems'
4
5
 
5
- require './trplib'
6
+ require 'trisulrp'
6
7
  include TRPLib
7
8
 
8
9
  GUID_CG_APP = "{C51B48D4-7876-479E-B0D9-BD9EFF03CE2E}"
9
10
 
10
11
  raise "Usage : strp host port" unless ARGV.length==2
11
12
 
12
- # demo a counter group info request
13
13
  # get information about the application counter group
14
-
15
14
  trp_conn=TRPLib::connect_trp(ARGV.shift,ARGV.shift,"Demo_Client.crt","Demo_Client.key")
16
-
17
-
18
15
  from_tm=to_tm=nil
19
16
  req=TRPLib::mk_counter_group_info_request(GUID_CG_APP)
20
17
  TRPLib::get_trp_response(trp_conn,req) do |resp|
@@ -24,15 +21,16 @@ TRPLib::get_trp_response(trp_conn,req) do |resp|
24
21
  to_tm = Time.at(resp.counter_group_info_response.group_details[0].time_interval.to.tv_sec)
25
22
  end
26
23
 
27
- # demo for each session id and their full info
24
+ # get all sessions for the host key 10.1.10.e8
28
25
  req=TRPLib::mk_key_session_activity_request("0A.01.A0.E8", from_tm, to_tm)
29
- get_trp_response(trp_conn,req) do |resp|
30
- TRPLib::print_key_session_activity_response(resp)
31
- resp.key_session_activity_response.sessions.each do|session|
26
+
27
+ get_trp_response(trp_conn,req) do |resp|
28
+ TRPLib::print_key_session_activity_response(resp)
29
+ resp.key_session_activity_response.sessions.each do|session|
32
30
  req=TRPLib::mk_session_item_request(session.slice_id,session.session_id)
33
- get_trp_response(trp_conn,req) do |resp|
34
- TRPLib::print_session_item_response(resp)
35
- end
36
- end
37
- end
31
+ get_trp_response(trp_conn,req) do |resp|
32
+ TRPLib::print_session_item_response(resp)
33
+ end
34
+ end
35
+ end
38
36
 
data/lib/trp.pb.rb CHANGED
@@ -15,6 +15,8 @@ module TRP
15
15
  class KeyStats < ::ProtocolBuffers::Message; end
16
16
  class KeyDetails < ::ProtocolBuffers::Message; end
17
17
  class SessionID < ::ProtocolBuffers::Message; end
18
+ class AlertID < ::ProtocolBuffers::Message; end
19
+ class ResourceID < ::ProtocolBuffers::Message; end
18
20
  class CounterGroupDetails < ::ProtocolBuffers::Message; end
19
21
  class Message < ::ProtocolBuffers::Message; end
20
22
  class HelloRequest < ::ProtocolBuffers::Message; end
@@ -51,6 +53,14 @@ module TRP
51
53
  class SessionGroupResponse < ::ProtocolBuffers::Message; end
52
54
  class ServerStatsRequest < ::ProtocolBuffers::Message; end
53
55
  class ServerStatsResponse < ::ProtocolBuffers::Message; end
56
+ class AlertItemRequest < ::ProtocolBuffers::Message; end
57
+ class AlertItemResponse < ::ProtocolBuffers::Message; end
58
+ class AlertGroupRequest < ::ProtocolBuffers::Message; end
59
+ class AlertGroupResponse < ::ProtocolBuffers::Message; end
60
+ class ResourceItemRequest < ::ProtocolBuffers::Message; end
61
+ class ResourceItemResponse < ::ProtocolBuffers::Message; end
62
+ class ResourceGroupRequest < ::ProtocolBuffers::Message; end
63
+ class ResourceGroupResponse < ::ProtocolBuffers::Message; end
54
64
 
55
65
  # enums
56
66
  module AuthLevel
@@ -125,6 +135,20 @@ module TRP
125
135
  gen_methods! # new fields ignored after this point
126
136
  end
127
137
 
138
+ class AlertID < ::ProtocolBuffers::Message
139
+ required :int64, :slice_id, 1
140
+ required :int64, :alert_id, 2
141
+
142
+ gen_methods! # new fields ignored after this point
143
+ end
144
+
145
+ class ResourceID < ::ProtocolBuffers::Message
146
+ required :int64, :slice_id, 1
147
+ required :int64, :resource_id, 2
148
+
149
+ gen_methods! # new fields ignored after this point
150
+ end
151
+
128
152
  class CounterGroupDetails < ::ProtocolBuffers::Message
129
153
  required :string, :guid, 1
130
154
  required :string, :name, 2
@@ -180,6 +204,14 @@ module TRP
180
204
  SERVER_STATS_RESPONSE = 39
181
205
  SESSION_GROUP_REQUEST = 40
182
206
  SESSION_GROUP_RESPONSE = 41
207
+ ALERT_ITEM_REQUEST = 42
208
+ ALERT_ITEM_RESPONSE = 43
209
+ ALERT_GROUP_REQUEST = 44
210
+ ALERT_GROUP_RESPONSE = 45
211
+ RESOURCE_ITEM_REQUEST = 46
212
+ RESOURCE_ITEM_RESPONSE = 47
213
+ RESOURCE_GROUP_REQUEST = 48
214
+ RESOURCE_GROUP_RESPONSE = 49
183
215
  end
184
216
 
185
217
  required ::TRP::Message::Command, :trp_command, 1
@@ -217,6 +249,14 @@ module TRP
217
249
  optional ::TRP::ServerStatsResponse, :server_stats_response, 38
218
250
  optional ::TRP::SessionGroupRequest, :session_group_request, 39
219
251
  optional ::TRP::SessionGroupResponse, :session_group_response, 40
252
+ optional ::TRP::AlertItemRequest, :alert_item_request, 41
253
+ optional ::TRP::AlertItemResponse, :alert_item_response, 42
254
+ optional ::TRP::AlertGroupRequest, :alert_group_request, 43
255
+ optional ::TRP::AlertGroupResponse, :alert_group_response, 44
256
+ optional ::TRP::ResourceItemRequest, :resource_item_request, 45
257
+ optional ::TRP::ResourceItemResponse, :resource_item_response, 46
258
+ optional ::TRP::ResourceGroupRequest, :resource_group_request, 47
259
+ optional ::TRP::ResourceGroupResponse, :resource_group_response, 48
220
260
 
221
261
  gen_methods! # new fields ignored after this point
222
262
  end
@@ -538,4 +578,113 @@ module TRP
538
578
  gen_methods! # new fields ignored after this point
539
579
  end
540
580
 
581
+ class AlertItemRequest < ::ProtocolBuffers::Message
582
+ optional :int64, :context, 1
583
+ required :string, :alert_group, 2
584
+ optional ::TRP::AlertID, :alert_id, 3
585
+
586
+ gen_methods! # new fields ignored after this point
587
+ end
588
+
589
+ class AlertItemResponse < ::ProtocolBuffers::Message
590
+ optional :int64, :context, 1
591
+ required :string, :alert_group, 2
592
+ optional :int64, :sensor_id, 3
593
+ required ::TRP::Timestamp, :time, 4
594
+ optional :string, :source_ip, 5
595
+ optional :string, :source_port, 6
596
+ optional :string, :destination_ip, 7
597
+ optional :string, :destination_port, 8
598
+ required :string, :sigid, 9
599
+ required :string, :classification, 10
600
+ required :string, :priority, 11
601
+ required ::TRP::Timestamp, :dispatch_time, 12
602
+ required :string, :aux_message1, 13
603
+ required :string, :aux_message2, 14
604
+
605
+ gen_methods! # new fields ignored after this point
606
+ end
607
+
608
+ class AlertGroupRequest < ::ProtocolBuffers::Message
609
+ optional :int64, :context, 1
610
+ required :string, :alert_group, 2
611
+ required ::TRP::TimeInterval, :time_interval, 3
612
+ optional :int64, :maxitems, 5, :default => 10
613
+ optional :string, :source_ip, 6
614
+ optional :string, :source_port, 7
615
+ optional :string, :destination_ip, 8
616
+ optional :string, :destination_port, 9
617
+ optional :string, :sigid, 10
618
+ optional :string, :classification, 11
619
+ optional :string, :priority, 12
620
+ optional :string, :aux_message1, 13
621
+ optional :string, :aux_message2, 14
622
+
623
+ gen_methods! # new fields ignored after this point
624
+ end
625
+
626
+ class AlertGroupResponse < ::ProtocolBuffers::Message
627
+ optional :int64, :context, 1
628
+ required :string, :alert_group, 2
629
+ repeated ::TRP::AlertID, :alerts, 3
630
+
631
+ gen_methods! # new fields ignored after this point
632
+ end
633
+
634
+ class ResourceItemRequest < ::ProtocolBuffers::Message
635
+ optional :int64, :context, 1
636
+ required :string, :resource_group, 2
637
+ repeated ::TRP::ResourceID, :resource_ids, 3
638
+
639
+ gen_methods! # new fields ignored after this point
640
+ end
641
+
642
+ class ResourceItemResponse < ::ProtocolBuffers::Message
643
+ # forward declarations
644
+ class Item < ::ProtocolBuffers::Message; end
645
+
646
+ # nested messages
647
+ class Item < ::ProtocolBuffers::Message
648
+ required ::TRP::Timestamp, :time, 1
649
+ required ::TRP::ResourceID, :resource_id, 2
650
+ optional :string, :source_ip, 3
651
+ optional :string, :source_port, 4
652
+ optional :string, :destination_ip, 5
653
+ optional :string, :destination_port, 6
654
+ optional :string, :uri, 7
655
+ optional :string, :userlabel, 8
656
+
657
+ gen_methods! # new fields ignored after this point
658
+ end
659
+
660
+ optional :int64, :context, 1
661
+ required :string, :resource_group, 2
662
+ repeated ::TRP::ResourceItemResponse::Item, :items, 3
663
+
664
+ gen_methods! # new fields ignored after this point
665
+ end
666
+
667
+ class ResourceGroupRequest < ::ProtocolBuffers::Message
668
+ optional :int64, :context, 1
669
+ required :string, :resource_group, 2
670
+ required ::TRP::TimeInterval, :time_interval, 3
671
+ optional :int64, :maxitems, 4, :default => 10
672
+ optional :string, :source_ip, 5
673
+ optional :string, :source_port, 6
674
+ optional :string, :destination_ip, 7
675
+ optional :string, :destination_port, 8
676
+ optional :string, :uri_pattern, 9
677
+ optional :string, :userlabel_pattern, 10
678
+
679
+ gen_methods! # new fields ignored after this point
680
+ end
681
+
682
+ class ResourceGroupResponse < ::ProtocolBuffers::Message
683
+ optional :int64, :context, 1
684
+ required :string, :resource_group, 2
685
+ repeated ::TRP::ResourceID, :resources, 3
686
+
687
+ gen_methods! # new fields ignored after this point
688
+ end
689
+
541
690
  end
data/lib/trp.proto CHANGED
@@ -4,7 +4,7 @@
4
4
  //
5
5
  package TRP;
6
6
 
7
- message Timestamp{
7
+ message Timestamp {
8
8
  required int64 tv_sec=1;
9
9
  required int64 tv_usec=2 [default=0];
10
10
  }
@@ -42,6 +42,15 @@ message SessionID {
42
42
  required int64 session_id=2;
43
43
  }
44
44
 
45
+ message AlertID {
46
+ required int64 slice_id=1;
47
+ required int64 alert_id=2;
48
+ }
49
+
50
+ message ResourceID {
51
+ required int64 slice_id=1;
52
+ required int64 resource_id=2;
53
+ }
45
54
  message CounterGroupDetails {
46
55
  required string guid=1;
47
56
  required string name=2;
@@ -107,6 +116,14 @@ message Message {
107
116
  SERVER_STATS_RESPONSE=39;
108
117
  SESSION_GROUP_REQUEST=40;
109
118
  SESSION_GROUP_RESPONSE=41;
119
+ ALERT_ITEM_REQUEST=42;
120
+ ALERT_ITEM_RESPONSE=43;
121
+ ALERT_GROUP_REQUEST=44;
122
+ ALERT_GROUP_RESPONSE=45;
123
+ RESOURCE_ITEM_REQUEST=46;
124
+ RESOURCE_ITEM_RESPONSE=47;
125
+ RESOURCE_GROUP_REQUEST=48;
126
+ RESOURCE_GROUP_RESPONSE=49;
110
127
  }
111
128
 
112
129
  required Command trp_command=1;
@@ -144,7 +161,14 @@ message Message {
144
161
  optional ServerStatsResponse server_stats_response=38;
145
162
  optional SessionGroupRequest session_group_request=39;
146
163
  optional SessionGroupResponse session_group_response=40;
147
-
164
+ optional AlertItemRequest alert_item_request=41;
165
+ optional AlertItemResponse alert_item_response=42;
166
+ optional AlertGroupRequest alert_group_request=43;
167
+ optional AlertGroupResponse alert_group_response=44;
168
+ optional ResourceItemRequest resource_item_request=45;
169
+ optional ResourceItemResponse resource_item_response=46;
170
+ optional ResourceGroupRequest resource_group_request=47;
171
+ optional ResourceGroupResponse resource_group_response=48;
148
172
  }
149
173
 
150
174
  ///////////////////////////////
@@ -460,3 +484,102 @@ message ServerStatsResponse{
460
484
  required TimeInterval time_interval=13;
461
485
  }
462
486
 
487
+ /////////////////////////////////////
488
+ // AlertItemRequest
489
+ message AlertItemRequest{
490
+ optional int64 context=1;
491
+ required string alert_group=2;
492
+ optional AlertID alert_id=3;
493
+ }
494
+ ////////////////////////////////////
495
+ // AlertItemResponse
496
+ message AlertItemResponse{
497
+ optional int64 context=1;
498
+ required string alert_group=2;
499
+ optional int64 sensor_id=3;
500
+ required Timestamp time=4;
501
+ optional string source_ip=5;
502
+ optional string source_port=6;
503
+ optional string destination_ip=7;
504
+ optional string destination_port=8;
505
+ required string sigid=9;
506
+ required string classification=10;
507
+ required string priority=11;
508
+ required Timestamp dispatch_time=12;
509
+ required string aux_message1=13;
510
+ required string aux_message2=14;
511
+ }
512
+
513
+ ////////////////////////////////////
514
+ // AlertGroupQueryRequest
515
+ message AlertGroupRequest {
516
+ optional int64 context=1;
517
+ required string alert_group=2;
518
+ required TimeInterval time_interval=3;
519
+ optional int64 maxitems=5 [default=10];
520
+ optional string source_ip=6;
521
+ optional string source_port=7;
522
+ optional string destination_ip=8;
523
+ optional string destination_port=9;
524
+ optional string sigid=10;
525
+ optional string classification=11;
526
+ optional string priority=12;
527
+ optional string aux_message1=13;
528
+ optional string aux_message2=14;
529
+ }
530
+
531
+ /////////////////////////////////////
532
+ // AlertGroupResponse
533
+ message AlertGroupResponse {
534
+ optional int64 context=1;
535
+ required string alert_group=2;
536
+ repeated AlertID alerts=3;
537
+ }
538
+
539
+ /////////////////////////////////////
540
+ // ResourceRequest - mutliple
541
+ message ResourceItemRequest{
542
+ optional int64 context=1;
543
+ required string resource_group=2;
544
+ repeated ResourceID resource_ids=3;
545
+ }
546
+ ////////////////////////////////////
547
+ // ResourceItemResponse
548
+ message ResourceItemResponse{
549
+ optional int64 context=1;
550
+ required string resource_group=2;
551
+ message Item {
552
+ required Timestamp time=1;
553
+ required ResourceID resource_id=2;
554
+ optional string source_ip=3;
555
+ optional string source_port=4;
556
+ optional string destination_ip=5;
557
+ optional string destination_port=6;
558
+ optional string uri=7;
559
+ optional string userlabel=8;
560
+ }
561
+ repeated Item items=3;
562
+ }
563
+
564
+ ////////////////////////////////////
565
+ // ResourceGroupRequest
566
+ message ResourceGroupRequest {
567
+ optional int64 context=1;
568
+ required string resource_group=2;
569
+ required TimeInterval time_interval=3;
570
+ optional int64 maxitems=4 [default=10];
571
+ optional string source_ip=5;
572
+ optional string source_port=6;
573
+ optional string destination_ip=7;
574
+ optional string destination_port=8;
575
+ optional string uri_pattern=9;
576
+ optional string userlabel_pattern=10;
577
+ }
578
+
579
+ /////////////////////////////////////
580
+ // ResourceGroupResponse
581
+ message ResourceGroupResponse {
582
+ optional int64 context=1;
583
+ required string resource_group=2;
584
+ repeated ResourceID resources=3;
585
+ }
data/lib/trplib.rb CHANGED
@@ -327,7 +327,4 @@ def print_session_tracker_response(resp_in)
327
327
 
328
328
  end
329
329
 
330
-
331
-
332
-
333
330
  end
data/trisulrp.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{trisulrp}
8
- s.version = "1.2.2"
8
+ s.version = "1.2.3"
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 = %q{2010-12-31}
12
+ s.date = %q{2011-01-03}
13
13
  s.description = %q{This gem deals about the trisul remote protocol}
14
14
  s.email = %q{vivek_rajagopal@yahoo.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trisulrp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
4
  prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 2
9
- - 2
10
- version: 1.2.2
8
+ - 3
9
+ version: 1.2.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - vivek
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-12-31 00:00:00 +05:30
17
+ date: 2011-01-03 00:00:00 +05:30
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -25,7 +24,6 @@ dependencies:
25
24
  requirements:
26
25
  - - ">="
27
26
  - !ruby/object:Gem::Version
28
- hash: 53
29
27
  segments:
30
28
  - 0
31
29
  - 8
@@ -41,7 +39,6 @@ dependencies:
41
39
  requirements:
42
40
  - - ">="
43
41
  - !ruby/object:Gem::Version
44
- hash: 3
45
42
  segments:
46
43
  - 0
47
44
  version: "0"
@@ -55,7 +52,6 @@ dependencies:
55
52
  requirements:
56
53
  - - ~>
57
54
  - !ruby/object:Gem::Version
58
- hash: 23
59
55
  segments:
60
56
  - 1
61
57
  - 0
@@ -71,7 +67,6 @@ dependencies:
71
67
  requirements:
72
68
  - - ~>
73
69
  - !ruby/object:Gem::Version
74
- hash: 7
75
70
  segments:
76
71
  - 1
77
72
  - 5
@@ -87,7 +82,6 @@ dependencies:
87
82
  requirements:
88
83
  - - ">="
89
84
  - !ruby/object:Gem::Version
90
- hash: 3
91
85
  segments:
92
86
  - 0
93
87
  version: "0"
@@ -101,7 +95,6 @@ dependencies:
101
95
  requirements:
102
96
  - - ">="
103
97
  - !ruby/object:Gem::Version
104
- hash: 53
105
98
  segments:
106
99
  - 0
107
100
  - 8
@@ -150,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
143
  requirements:
151
144
  - - ">="
152
145
  - !ruby/object:Gem::Version
153
- hash: 3
146
+ hash: 113684307
154
147
  segments:
155
148
  - 0
156
149
  version: "0"
@@ -159,7 +152,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
152
  requirements:
160
153
  - - ">="
161
154
  - !ruby/object:Gem::Version
162
- hash: 3
163
155
  segments:
164
156
  - 0
165
157
  version: "0"