trisulrp 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +54 -0
- data/VERSION +1 -0
- data/examples/strp.rb +38 -0
- data/lib/trisulrp.rb +15 -0
- data/lib/trp.pb.rb +541 -0
- data/lib/trp.proto +462 -0
- data/lib/trplib.rb +333 -0
- data/test/Demo_Client.crt +71 -0
- data/test/Demo_Client.key +18 -0
- data/test/helper.rb +18 -0
- data/test/test_trisulrp.rb +7 -0
- data/trisulrp.gemspec +76 -0
- metadata +176 -0
data/lib/trp.proto
ADDED
@@ -0,0 +1,462 @@
|
|
1
|
+
// Trisul Remote Protocol (TRP) definition
|
2
|
+
// Based on Google Protocol Buffers
|
3
|
+
// (c) 2010, Unleash Networks
|
4
|
+
//
|
5
|
+
package TRP;
|
6
|
+
|
7
|
+
message Timestamp{
|
8
|
+
required int64 tv_sec=1;
|
9
|
+
required int64 tv_usec=2 [default=0];
|
10
|
+
}
|
11
|
+
|
12
|
+
message TimeInterval {
|
13
|
+
required Timestamp from=1;
|
14
|
+
required Timestamp to=2;
|
15
|
+
}
|
16
|
+
|
17
|
+
message StatsTuple {
|
18
|
+
required Timestamp ts=1;
|
19
|
+
required double val=2;
|
20
|
+
}
|
21
|
+
|
22
|
+
message MeterValues {
|
23
|
+
required int32 meter=1;
|
24
|
+
repeated StatsTuple values=2;
|
25
|
+
}
|
26
|
+
|
27
|
+
message KeyStats {
|
28
|
+
optional int64 context=1[default=0];
|
29
|
+
required string counter_group=2;
|
30
|
+
required string key=3;
|
31
|
+
repeated MeterValues meters=4;
|
32
|
+
}
|
33
|
+
|
34
|
+
message KeyDetails {
|
35
|
+
required string key=1;
|
36
|
+
optional string label=2;
|
37
|
+
optional string description=3;
|
38
|
+
}
|
39
|
+
|
40
|
+
message SessionID {
|
41
|
+
required int64 slice_id=1;
|
42
|
+
required int64 session_id=2;
|
43
|
+
}
|
44
|
+
|
45
|
+
message CounterGroupDetails {
|
46
|
+
required string guid=1;
|
47
|
+
required string name=2;
|
48
|
+
optional int64 bucket_size=3;
|
49
|
+
optional TimeInterval time_interval=4;
|
50
|
+
}
|
51
|
+
|
52
|
+
enum AuthLevel {
|
53
|
+
ADMIN=1;
|
54
|
+
BASIC_USER=2;
|
55
|
+
FORENSIC_USER=3;
|
56
|
+
BLOCKED_USER=4;
|
57
|
+
}
|
58
|
+
|
59
|
+
enum CompressionType {
|
60
|
+
UNCOMPRESSED=1;
|
61
|
+
GZIP=2;
|
62
|
+
}
|
63
|
+
|
64
|
+
enum PcapFormat {
|
65
|
+
LIBPCAP=1;
|
66
|
+
UNSNIFF=2;
|
67
|
+
}
|
68
|
+
|
69
|
+
message Message {
|
70
|
+
enum Command { HELLO_REQUEST=1;
|
71
|
+
HELLO_RESPONSE=2;
|
72
|
+
OK_RESPONSE=3;
|
73
|
+
ERROR_RESPONSE=5;
|
74
|
+
COUNTER_GROUP_REQUEST=6;
|
75
|
+
COUNTER_GROUP_RESPONSE=7;
|
76
|
+
COUNTER_ITEM_REQUEST=8;
|
77
|
+
COUNTER_ITEM_RESPONSE=9;
|
78
|
+
RELEASE_RESOURCE_REQUEST=10;
|
79
|
+
RELEASE_CONTEXT_REQUEST=11;
|
80
|
+
CONTROLLED_COUNTER_GROUP_REQUEST=12;
|
81
|
+
CONTROLLED_COUNTER_GROUP_RESPONSE=13;
|
82
|
+
FILTERED_DATAGRAMS_REQUEST=14;
|
83
|
+
FILTERED_DATAGRAMS_RESPONSE=15;
|
84
|
+
CONTROLLED_CONTEXT_REQUEST=16;
|
85
|
+
CONTROLLED_CONTEXT_RESPONSE=17;
|
86
|
+
SEARCH_KEYS_REQUEST=18;
|
87
|
+
SEARCH_KEYS_RESPONSE=19;
|
88
|
+
COUNTER_GROUP_INFO_REQUEST=20;
|
89
|
+
COUNTER_GROUP_INFO_RESPONSE=21;
|
90
|
+
SESSION_TRACKER_REQUEST=22;
|
91
|
+
SESSION_TRACKER_RESPONSE=23;
|
92
|
+
SESSION_ITEM_REQUEST=24;
|
93
|
+
SESSION_ITEM_RESPONSE=25;
|
94
|
+
BULK_COUNTER_ITEM_REQUEST=26;
|
95
|
+
BULK_COUNTER_ITEM_RESPONSE=27;
|
96
|
+
CGMONITOR_REQUEST=28;
|
97
|
+
CGMONITOR_RESPONSE=29;
|
98
|
+
TOPPER_SNAPSHOT_REQUEST=30;
|
99
|
+
TOPPER_SNAPSHOT_RESPONSE=31;
|
100
|
+
UPDATE_KEY_REQUEST=32;
|
101
|
+
UPDATE_KEY_RESPONSE=33;
|
102
|
+
KEY_SESS_ACTIVITY_REQUEST=34;
|
103
|
+
KEY_SESS_ACTIVITY_RESPONSE=35;
|
104
|
+
RING_STATS_REQUEST=36;
|
105
|
+
RING_STATS_RESPONSE=37;
|
106
|
+
SERVER_STATS_REQUEST=38;
|
107
|
+
SERVER_STATS_RESPONSE=39;
|
108
|
+
SESSION_GROUP_REQUEST=40;
|
109
|
+
SESSION_GROUP_RESPONSE=41;
|
110
|
+
}
|
111
|
+
|
112
|
+
required Command trp_command=1;
|
113
|
+
optional HelloRequest hello_request=2;
|
114
|
+
optional HelloResponse hello_response=3;
|
115
|
+
optional OKResponse ok_response=4;
|
116
|
+
optional ErrorResponse error_response=5;
|
117
|
+
optional CounterGroupRequest counter_group_request=6;
|
118
|
+
optional CounterGroupResponse counter_group_response=7;
|
119
|
+
optional CounterItemRequest counter_item_request=8;
|
120
|
+
optional CounterItemResponse counter_item_response=9;
|
121
|
+
optional ReleaseContextRequest release_context_request=11;
|
122
|
+
optional ControlledCounterGroupRequest controlled_counter_group_request=12;
|
123
|
+
optional ControlledCounterGroupResponse controlled_counter_group_response=13;
|
124
|
+
optional FilteredDatagramRequest filtered_datagram_request=14;
|
125
|
+
optional FilteredDatagramResponse filtered_datagram_response=15;
|
126
|
+
optional ControlledContextRequest controlled_context_request=16;
|
127
|
+
optional ControlledContextResponse controlled_context_response=17;
|
128
|
+
optional SearchKeysRequest search_keys_request=18;
|
129
|
+
optional SearchKeysResponse search_keys_response=19;
|
130
|
+
optional CounterGroupInfoRequest counter_group_info_request=20;
|
131
|
+
optional CounterGroupInfoResponse counter_group_info_response=21;
|
132
|
+
optional SessionItemRequest session_item_request=22;
|
133
|
+
optional SessionItemResponse session_item_response=23;
|
134
|
+
optional BulkCounterItemRequest bulk_counter_item_request=24;
|
135
|
+
optional BulkCounterItemResponse bulk_counter_item_response=25;
|
136
|
+
optional TopperSnapshotRequest topper_snapshot_request=28;
|
137
|
+
optional TopperSnapshotResponse topper_snapshot_response=29;
|
138
|
+
optional UpdateKeyRequest update_key_request=30;
|
139
|
+
optional KeySessionActivityRequest key_session_activity_request=31;
|
140
|
+
optional KeySessionActivityResponse key_session_activity_response=32;
|
141
|
+
optional SessionTrackerRequest session_tracker_request=33;
|
142
|
+
optional SessionTrackerResponse session_tracker_response=34;
|
143
|
+
optional ServerStatsRequest server_stats_request=37;
|
144
|
+
optional ServerStatsResponse server_stats_response=38;
|
145
|
+
optional SessionGroupRequest session_group_request=39;
|
146
|
+
optional SessionGroupResponse session_group_response=40;
|
147
|
+
|
148
|
+
}
|
149
|
+
|
150
|
+
///////////////////////////////
|
151
|
+
// Hello
|
152
|
+
message HelloRequest{
|
153
|
+
required string station_id=1;
|
154
|
+
}
|
155
|
+
|
156
|
+
message HelloResponse{
|
157
|
+
required string trisul_id=1;
|
158
|
+
required string connection_id=2;
|
159
|
+
required string version_string=3;
|
160
|
+
required Timestamp connection_start_time=4;
|
161
|
+
required Timestamp connection_up_time=5;
|
162
|
+
required AuthLevel current_auth_level=6;
|
163
|
+
}
|
164
|
+
|
165
|
+
///////////////////////////////
|
166
|
+
// Error
|
167
|
+
message ErrorResponse{
|
168
|
+
required int64 original_command=1;
|
169
|
+
required int64 error_code=2;
|
170
|
+
required string error_message=3;
|
171
|
+
}
|
172
|
+
|
173
|
+
///////////////////////////////
|
174
|
+
// OK
|
175
|
+
message OKResponse{
|
176
|
+
required int64 original_command=1;
|
177
|
+
optional string message=2;
|
178
|
+
}
|
179
|
+
|
180
|
+
message ReleaseContextRequest{
|
181
|
+
optional int64 context=1;
|
182
|
+
}
|
183
|
+
|
184
|
+
///////////////////////////////
|
185
|
+
// CounterItemRequest
|
186
|
+
message CounterItemRequest{
|
187
|
+
optional int64 context=1 [default=0];
|
188
|
+
required string counter_group=2;
|
189
|
+
required int64 meter=3 [default=0];
|
190
|
+
required string key=4;
|
191
|
+
required TimeInterval time_interval=5;
|
192
|
+
}
|
193
|
+
|
194
|
+
///////////////////////////////
|
195
|
+
// CounterItemResponse
|
196
|
+
message CounterItemResponse{
|
197
|
+
required KeyStats stats=1;
|
198
|
+
}
|
199
|
+
|
200
|
+
///////////////////////////////
|
201
|
+
// CounterGroupRequest
|
202
|
+
message CounterGroupRequest{
|
203
|
+
optional int64 context=1 [default=0];
|
204
|
+
required string counter_group=2;
|
205
|
+
optional int64 meter=3 [default=0];
|
206
|
+
optional int64 maxitems=4 [default=10];
|
207
|
+
optional TimeInterval time_interval=5;
|
208
|
+
optional Timestamp time_instant=6;
|
209
|
+
optional int64 flags=7;
|
210
|
+
}
|
211
|
+
|
212
|
+
///////////////////////////////
|
213
|
+
// CounterItemRequest
|
214
|
+
message CounterGroupResponse{
|
215
|
+
required int64 context=1;
|
216
|
+
required string counter_group=2;
|
217
|
+
required int64 meter=3;
|
218
|
+
repeated KeyDetails keys=6;
|
219
|
+
}
|
220
|
+
|
221
|
+
message ControlledCounterGroupRequest{
|
222
|
+
required string dynamic_group_id=1;
|
223
|
+
required string counter_group=2;
|
224
|
+
required int64 meter=3;
|
225
|
+
required int64 maxitems=4;
|
226
|
+
required int64 bucket_ms=5;
|
227
|
+
required int64 top_nsize=6;
|
228
|
+
required TimeInterval time_interval=7;
|
229
|
+
required string control_counter_id=9;
|
230
|
+
required string control_key=10;
|
231
|
+
}
|
232
|
+
|
233
|
+
message ControlledCounterGroupResponse{
|
234
|
+
required string dynamic_group_id=1;
|
235
|
+
}
|
236
|
+
|
237
|
+
|
238
|
+
///////////////////////////////
|
239
|
+
// FilteredDatagramRequest
|
240
|
+
message FilteredDatagramRequest{
|
241
|
+
optional int64 max_packets=1[default=0];
|
242
|
+
optional int64 max_bytes=2[default=0];
|
243
|
+
optional CompressionType compress_type=3[default=UNCOMPRESSED];
|
244
|
+
required TimeInterval time_interval=4;
|
245
|
+
required string filter_expression=5;
|
246
|
+
}
|
247
|
+
|
248
|
+
/////////////////////////////////////
|
249
|
+
// FileredDatagaramResponse
|
250
|
+
message FilteredDatagramResponse{
|
251
|
+
required PcapFormat format=1;
|
252
|
+
required CompressionType compress_type=2;
|
253
|
+
required TimeInterval time_interval=3;
|
254
|
+
required int64 num_datagrams=4;
|
255
|
+
required int64 num_bytes=5;
|
256
|
+
required string contents=6;
|
257
|
+
}
|
258
|
+
|
259
|
+
//////////////////////////////////////////
|
260
|
+
// ControlledContextRequest
|
261
|
+
message ControlledContextRequest{
|
262
|
+
required TimeInterval time_interval=1;
|
263
|
+
required string filter_expression=2;
|
264
|
+
}
|
265
|
+
|
266
|
+
//////////////////////////////////////////
|
267
|
+
//// ControlledContextResponse
|
268
|
+
message ControlledContextResponse{
|
269
|
+
required int64 context=1;
|
270
|
+
optional string context_db=2;
|
271
|
+
required TimeInterval time_interval =3;
|
272
|
+
}
|
273
|
+
|
274
|
+
///////////////////////////////////////
|
275
|
+
// SearchkeysRequest
|
276
|
+
message SearchKeysRequest{
|
277
|
+
optional int64 context=1;
|
278
|
+
required string counter_group=2;
|
279
|
+
required string pattern=3;
|
280
|
+
required int64 maxitems=4;
|
281
|
+
}
|
282
|
+
|
283
|
+
//////////////////////////////////////
|
284
|
+
// SearchKeysResponse
|
285
|
+
message SearchKeysResponse{
|
286
|
+
optional int64 context=1;
|
287
|
+
required string counter_group=2;
|
288
|
+
repeated KeyDetails found_keys=3;
|
289
|
+
}
|
290
|
+
|
291
|
+
/////////////////////////////////////
|
292
|
+
/// CounterGroupInfoRequest
|
293
|
+
message CounterGroupInfoRequest{
|
294
|
+
optional int64 context=1;
|
295
|
+
optional string counter_group=2;
|
296
|
+
}
|
297
|
+
|
298
|
+
///////////////////////////////////
|
299
|
+
/// CounterGroupInfoResponse
|
300
|
+
message CounterGroupInfoResponse{
|
301
|
+
optional int64 context=1;
|
302
|
+
repeated CounterGroupDetails group_details=2;
|
303
|
+
}
|
304
|
+
|
305
|
+
/////////////////////////////////////
|
306
|
+
// SessionItemRequest
|
307
|
+
message SessionItemRequest{
|
308
|
+
optional int64 context=1;
|
309
|
+
required string session_group=2;
|
310
|
+
optional string session_key=3;
|
311
|
+
optional SessionID session_id=4;
|
312
|
+
}
|
313
|
+
|
314
|
+
////////////////////////////////////
|
315
|
+
// SessionItemResponse
|
316
|
+
message SessionItemResponse{
|
317
|
+
optional int64 context=1;
|
318
|
+
required string session_group=2;
|
319
|
+
optional string session_key=3;
|
320
|
+
optional SessionID session_id=4;
|
321
|
+
optional string user_label=5;
|
322
|
+
required TimeInterval time_interval=6;
|
323
|
+
required int64 state=7;
|
324
|
+
required int64 az_bytes=8;
|
325
|
+
required int64 za_bytes=9;
|
326
|
+
required KeyDetails key1A=10;
|
327
|
+
required KeyDetails key2A=11;
|
328
|
+
required KeyDetails key1Z=12;
|
329
|
+
required KeyDetails key2Z=13;
|
330
|
+
}
|
331
|
+
|
332
|
+
//////////////////////////////////////////
|
333
|
+
// BulkCounterItemRequest
|
334
|
+
message BulkCounterItemRequest{
|
335
|
+
optional int64 context=1;
|
336
|
+
required string counter_group=2;
|
337
|
+
required int64 meter=3;
|
338
|
+
required TimeInterval time_interval=4;
|
339
|
+
repeated string keys=5;
|
340
|
+
}
|
341
|
+
|
342
|
+
//////////////////////////////////////////
|
343
|
+
// BulkCounterItemResponse
|
344
|
+
message BulkCounterItemResponse{
|
345
|
+
repeated KeyStats stats=1;
|
346
|
+
repeated KeyDetails details=2;
|
347
|
+
}
|
348
|
+
|
349
|
+
///////////////////////////////////////////
|
350
|
+
/// TopperSnapshotRequest
|
351
|
+
message TopperSnapshotRequest{
|
352
|
+
optional int64 context=1;
|
353
|
+
required string counter_group=2;
|
354
|
+
required int64 meter=3;
|
355
|
+
required TimeInterval Time=4;
|
356
|
+
required int64 maxitems=5;
|
357
|
+
}
|
358
|
+
|
359
|
+
|
360
|
+
///////////////////////////////////////////
|
361
|
+
// TopperSnapshotResponse
|
362
|
+
message TopperSnapshotResponse{
|
363
|
+
optional int64 context=1;
|
364
|
+
required string counter_group=2;
|
365
|
+
required int64 meter=3;
|
366
|
+
required Timestamp time=4;
|
367
|
+
required int64 window_secs=5;
|
368
|
+
required string keys=6;
|
369
|
+
required string labels=7;
|
370
|
+
}
|
371
|
+
|
372
|
+
//////////////////////////////////////////////
|
373
|
+
/// UpdatekeysRequest
|
374
|
+
/// Response = OKResponse or ErrorResponse
|
375
|
+
message UpdateKeyRequest{
|
376
|
+
optional int64 context=1;
|
377
|
+
required string counter_group=2;
|
378
|
+
required string key=4;
|
379
|
+
required string label=5;
|
380
|
+
optional string description=6;
|
381
|
+
}
|
382
|
+
|
383
|
+
///////////////////////////////////
|
384
|
+
// KeySessionActivityrequest
|
385
|
+
message KeySessionActivityRequest{
|
386
|
+
optional int64 context=1;
|
387
|
+
required string session_group=2;
|
388
|
+
required string key=3;
|
389
|
+
required int64 maxitems=4;
|
390
|
+
required int64 volume_filter=5;
|
391
|
+
required int64 duration_filter=6;
|
392
|
+
required TimeInterval time_interval=7;
|
393
|
+
}
|
394
|
+
|
395
|
+
/////////////////////////////////////
|
396
|
+
// KeySessionActivityResponse
|
397
|
+
message KeySessionActivityResponse{
|
398
|
+
optional int64 context=1;
|
399
|
+
required string session_group=2;
|
400
|
+
repeated SessionID sessions=3;
|
401
|
+
}
|
402
|
+
|
403
|
+
/////////////////////////////////////
|
404
|
+
// SessionTrackerRequest
|
405
|
+
message SessionTrackerRequest {
|
406
|
+
optional int64 context=1;
|
407
|
+
required string session_group=2;
|
408
|
+
required int64 tracker_id=3 [default=1];
|
409
|
+
optional int64 maxitems=4 [default=100];
|
410
|
+
required TimeInterval time_interval=5;
|
411
|
+
}
|
412
|
+
|
413
|
+
///////////////////////////////////
|
414
|
+
// SessionTrackerResponse
|
415
|
+
message SessionTrackerResponse{
|
416
|
+
optional int64 context=1;
|
417
|
+
required string session_group=2;
|
418
|
+
repeated SessionID sessions=3;
|
419
|
+
}
|
420
|
+
|
421
|
+
///////////////////////////////////
|
422
|
+
// SessionGroupRequest
|
423
|
+
message SessionGroupRequest {
|
424
|
+
optional int64 context=1;
|
425
|
+
required string session_group=2;
|
426
|
+
optional int64 tracker_id=3;
|
427
|
+
optional string key_filter=4;
|
428
|
+
optional int64 maxitems=5 [default=100];
|
429
|
+
}
|
430
|
+
|
431
|
+
//////////////////////////////////
|
432
|
+
// SessionGroupResponse
|
433
|
+
message SessionGroupResponse {
|
434
|
+
optional int64 context=1;
|
435
|
+
required string session_group=2;
|
436
|
+
repeated string session_keys=3;
|
437
|
+
}
|
438
|
+
|
439
|
+
|
440
|
+
//////////////////////////////////
|
441
|
+
// ServerStatsRequest
|
442
|
+
message ServerStatsRequest{
|
443
|
+
required int64 param=1;
|
444
|
+
}
|
445
|
+
|
446
|
+
//////////////////////////////////
|
447
|
+
// ServerStatsResponse
|
448
|
+
message ServerStatsResponse{
|
449
|
+
required string instance_name=1;
|
450
|
+
required int64 connections=2;
|
451
|
+
required int64 uptime_seconds=3;
|
452
|
+
required double cpu_usage_percent_trisul=4;
|
453
|
+
required double cpu_usage_percent_total=5;
|
454
|
+
required double mem_usage_trisul=6;
|
455
|
+
required double mem_usage_total=7;
|
456
|
+
required double mem_total=8;
|
457
|
+
required int64 size_total=9;
|
458
|
+
required double drop_percent_cap=11;
|
459
|
+
required double drop_percent_trisul=12;
|
460
|
+
required TimeInterval time_interval=13;
|
461
|
+
}
|
462
|
+
|