1 /* packet-scriptingservice.c
2 * Routines for the Scripting Service Protocol, a load distribution application
3 * of the RSPLIB RSerPool implementation
4 * https://www.uni-due.de/~be0001/rserpool/
6 * Copyright 2006-2021 by Thomas Dreibholz <dreibh [AT] iem.uni-due.de>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
17 #include <epan/packet.h>
18 #include <epan/sctpppids.h>
19 #include <epan/stat_tap_ui.h>
22 #include <wsutil/array.h>
24 void proto_register_ssprotocol(void);
25 void proto_reg_handoff_ssprotocol(void);
27 static dissector_handle_t ssprotocol_handle
;
29 #define SSPROTOCOL_PAYLOAD_PROTOCOL_ID_LEGACY 0x29097604
32 /* Initialize the protocol and registered fields */
33 static int proto_ssprotocol
;
34 static int tap_ssprotocol
= -1;
35 static int hf_message_type
;
36 static int hf_message_flags
;
37 static int hf_message_length
;
38 static int hf_message_status
;
39 static int hf_message_data
;
40 static int hf_message_reason
;
41 static int hf_message_info
;
42 static int hf_message_hash
;
43 static int hf_environment_u_bit
;
45 static uint64_t ssprotocol_total_msgs
;
46 static uint64_t ssprotocol_total_bytes
;
48 /* Initialize the subtree pointers */
49 static int ett_ssprotocol
;
50 static int ett_environment_flags
;
52 /* Dissectors for messages. This is specific to ScriptingServiceProtocol */
53 #define MESSAGE_TYPE_LENGTH 1
54 #define MESSAGE_FLAGS_LENGTH 1
55 #define MESSAGE_LENGTH_LENGTH 2
56 #define MESSAGE_STATUS_LENGTH 4
57 #define MESSAGE_NOTRDY_REASON_LENGTH 4
58 #define MESSAGE_ENVIRON_HASH_LENGTH 20
60 #define MESSAGE_TYPE_OFFSET 0
61 #define MESSAGE_FLAGS_OFFSET (MESSAGE_TYPE_OFFSET + MESSAGE_TYPE_LENGTH)
62 #define MESSAGE_LENGTH_OFFSET (MESSAGE_FLAGS_OFFSET + MESSAGE_FLAGS_LENGTH)
63 #define MESSAGE_STATUS_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH)
64 #define MESSAGE_DATA_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH)
65 #define MESSAGE_RDY_INFO_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH)
66 #define MESSAGE_NOTRDY_REASON_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH)
67 #define MESSAGE_NOTRDY_INFO_OFFSET (MESSAGE_NOTRDY_REASON_OFFSET + MESSAGE_NOTRDY_REASON_LENGTH)
68 #define MESSAGE_ENVIRON_HASH_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH)
71 #define SS_NOTREADY_TYPE 0
72 #define SS_READY_TYPE 1
73 #define SS_UPLOAD_TYPE 2
74 #define SS_DOWNLOAD_TYPE 3
75 #define SS_KEEPALIVE_TYPE 4
76 #define SS_KEEPALIVE_ACK_TYPE 5
77 #define SS_STATUS_TYPE 6
78 #define SS_ENVIRONMENT_TYPE 7
81 static const value_string message_type_values
[] = {
82 { SS_NOTREADY_TYPE
, "Not Ready" },
83 { SS_READY_TYPE
, "Ready" },
84 { SS_UPLOAD_TYPE
, "Upload" },
85 { SS_DOWNLOAD_TYPE
, "Download" },
86 { SS_KEEPALIVE_TYPE
, "Keep-Alive" },
87 { SS_KEEPALIVE_ACK_TYPE
, "Keep-Alive Ack" },
88 { SS_STATUS_TYPE
, "Status" },
89 { SS_ENVIRONMENT_TYPE
, "Environment" },
94 static const value_string notrdy_reason_values
[] = {
95 { 0x00000001, "Fully Loaded" },
96 { 0x00000002, "Out of Resources" },
101 #define SSP_ENVIRONMENT_U_BIT 0x01
102 static const true_false_string environment_u_bit
= {
108 typedef struct _tap_ssprotocol_rec_t
{
111 const char* type_string
;
112 } tap_ssprotocol_rec_t
;
116 dissect_ssprotocol_message(tvbuff_t
*message_tvb
, packet_info
*pinfo
, proto_tree
*ssprotocol_tree
)
118 proto_item
* flags_item
;
119 proto_tree
* flags_tree
;
120 uint16_t data_length
;
121 uint16_t info_length
;
122 unsigned total_length
;
124 tap_ssprotocol_rec_t
* tap_rec
= wmem_new0(pinfo
->pool
, tap_ssprotocol_rec_t
);
125 tap_rec
->type
= tvb_get_uint8(message_tvb
, MESSAGE_TYPE_OFFSET
);
126 tap_rec
->size
= tvb_get_ntohs(message_tvb
, MESSAGE_LENGTH_OFFSET
);
127 tap_rec
->type_string
= val_to_str_const(tap_rec
->type
, message_type_values
, "Unknown SSP message type");
128 tap_queue_packet(tap_ssprotocol
, pinfo
, tap_rec
);
130 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%s ", tap_rec
->type_string
);
132 proto_tree_add_item(ssprotocol_tree
, hf_message_type
, message_tvb
, MESSAGE_TYPE_OFFSET
, MESSAGE_TYPE_LENGTH
, ENC_BIG_ENDIAN
);
133 flags_item
= proto_tree_add_item(ssprotocol_tree
, hf_message_flags
, message_tvb
, MESSAGE_FLAGS_OFFSET
, MESSAGE_FLAGS_LENGTH
, ENC_BIG_ENDIAN
);
134 proto_tree_add_item(ssprotocol_tree
, hf_message_length
, message_tvb
, MESSAGE_LENGTH_OFFSET
, MESSAGE_LENGTH_LENGTH
, ENC_BIG_ENDIAN
);
135 total_length
= MESSAGE_LENGTH_OFFSET
+ MESSAGE_LENGTH_LENGTH
;
136 switch (tap_rec
->type
) {
137 case SS_KEEPALIVE_ACK_TYPE
:
139 info_length
= tvb_get_ntohs(message_tvb
, MESSAGE_LENGTH_OFFSET
) - MESSAGE_STATUS_OFFSET
;
140 if (info_length
== MESSAGE_STATUS_LENGTH
) {
141 proto_tree_add_item(ssprotocol_tree
, hf_message_status
, message_tvb
, MESSAGE_STATUS_OFFSET
, MESSAGE_STATUS_LENGTH
, ENC_BIG_ENDIAN
);
142 total_length
+= MESSAGE_STATUS_LENGTH
;
146 case SS_DOWNLOAD_TYPE
:
147 data_length
= tvb_get_ntohs(message_tvb
, MESSAGE_LENGTH_OFFSET
) - MESSAGE_DATA_OFFSET
;
148 if (data_length
> 0) {
149 proto_tree_add_item(ssprotocol_tree
, hf_message_data
, message_tvb
, MESSAGE_DATA_OFFSET
, data_length
, ENC_NA
);
150 total_length
+= data_length
;
154 info_length
= tvb_get_ntohs(message_tvb
, MESSAGE_LENGTH_OFFSET
) - MESSAGE_RDY_INFO_OFFSET
;
155 if (info_length
> 0) {
156 proto_tree_add_item(ssprotocol_tree
, hf_message_info
, message_tvb
, MESSAGE_RDY_INFO_OFFSET
, info_length
, ENC_ASCII
);
157 total_length
+= info_length
;
160 case SS_NOTREADY_TYPE
:
161 info_length
= tvb_get_ntohs(message_tvb
, MESSAGE_LENGTH_OFFSET
) - MESSAGE_NOTRDY_INFO_OFFSET
;
162 if (info_length
> 0) {
163 proto_tree_add_item(ssprotocol_tree
, hf_message_reason
, message_tvb
, MESSAGE_NOTRDY_REASON_OFFSET
, MESSAGE_NOTRDY_REASON_LENGTH
, ENC_BIG_ENDIAN
);
164 proto_tree_add_item(ssprotocol_tree
, hf_message_info
, message_tvb
, MESSAGE_NOTRDY_INFO_OFFSET
, info_length
, ENC_ASCII
);
165 total_length
+= info_length
;
168 case SS_ENVIRONMENT_TYPE
:
169 flags_tree
= proto_item_add_subtree(flags_item
, ett_environment_flags
);
170 proto_tree_add_item(flags_tree
, hf_environment_u_bit
, message_tvb
, MESSAGE_FLAGS_OFFSET
, MESSAGE_FLAGS_LENGTH
, ENC_BIG_ENDIAN
);
171 proto_tree_add_item(ssprotocol_tree
, hf_message_hash
, message_tvb
, MESSAGE_ENVIRON_HASH_OFFSET
, MESSAGE_ENVIRON_HASH_LENGTH
, ENC_NA
);
182 dissect_ssprotocol(tvbuff_t
*message_tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
184 proto_item
*ssprotocol_item
;
185 proto_tree
*ssprotocol_tree
;
187 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "SSP");
189 /* create the ssprotocol protocol tree */
190 ssprotocol_item
= proto_tree_add_item(tree
, proto_ssprotocol
, message_tvb
, 0, -1, ENC_NA
);
191 ssprotocol_tree
= proto_item_add_subtree(ssprotocol_item
, ett_ssprotocol
);
193 /* dissect the message */
194 return dissect_ssprotocol_message(message_tvb
, pinfo
, ssprotocol_tree
);
201 MESSAGE_TYPE_COLUMN
= 0,
203 MESSAGES_SHARE_COLUMN
,
211 } ssprotocol_stat_columns
;
213 static stat_tap_table_item ssprotocol_stat_fields
[] = {
214 { TABLE_ITEM_STRING
, TAP_ALIGN_LEFT
, "ScriptingServiceProtocol Message Type", "%-25s" },
215 { TABLE_ITEM_UINT
, TAP_ALIGN_RIGHT
, "Messages ", "%u" },
216 { TABLE_ITEM_UINT
, TAP_ALIGN_RIGHT
, "Messages Share (%)" , "%1.3f %%" },
217 { TABLE_ITEM_UINT
, TAP_ALIGN_RIGHT
, "Bytes (B)", "%u" },
218 { TABLE_ITEM_UINT
, TAP_ALIGN_RIGHT
, "Bytes Share (%) ", "%1.3f %%" },
219 { TABLE_ITEM_FLOAT
, TAP_ALIGN_LEFT
, "First Seen (s)", "%1.6f" },
220 { TABLE_ITEM_FLOAT
, TAP_ALIGN_LEFT
, "Last Seen (s)", "%1.6f" },
221 { TABLE_ITEM_FLOAT
, TAP_ALIGN_LEFT
, "Interval (s)", "%1.6f" },
222 { TABLE_ITEM_FLOAT
, TAP_ALIGN_LEFT
, "Message Rate (Msg/s)", "%1.2f" },
223 { TABLE_ITEM_FLOAT
, TAP_ALIGN_LEFT
, "Byte Rate (B/s)", "%1.2f" }
226 static void ssprotocol_stat_init(stat_tap_table_ui
* new_stat
)
228 const char *table_name
= "ScriptingServiceProtocol Statistics";
229 int num_fields
= array_length(ssprotocol_stat_fields
);
230 stat_tap_table
*table
;
232 stat_tap_table_item_type items
[array_length(ssprotocol_stat_fields
)];
234 table
= stat_tap_find_table(new_stat
, table_name
);
236 if (new_stat
->stat_tap_reset_table_cb
) {
237 new_stat
->stat_tap_reset_table_cb(table
);
242 table
= stat_tap_init_table(table_name
, num_fields
, 0, NULL
);
243 stat_tap_add_table(new_stat
, table
);
245 memset(items
, 0x0, sizeof(items
));
246 /* Add a row for each value type */
247 while (message_type_values
[i
].strptr
) {
248 items
[MESSAGE_TYPE_COLUMN
].type
= TABLE_ITEM_STRING
;
249 items
[MESSAGE_TYPE_COLUMN
].value
.string_value
= message_type_values
[i
].strptr
;
250 items
[MESSAGES_COLUMN
].type
= TABLE_ITEM_UINT
;
251 items
[MESSAGES_COLUMN
].value
.uint_value
= 0;
252 items
[MESSAGES_SHARE_COLUMN
].type
= TABLE_ITEM_NONE
;
253 items
[MESSAGES_SHARE_COLUMN
].value
.float_value
= -1.0;
254 items
[BYTES_COLUMN
].type
= TABLE_ITEM_UINT
;
255 items
[BYTES_COLUMN
].value
.uint_value
= 0;
256 items
[BYTES_SHARE_COLUMN
].type
= TABLE_ITEM_NONE
;
257 items
[BYTES_SHARE_COLUMN
].value
.float_value
= -1.0;
258 items
[FIRST_SEEN_COLUMN
].type
= TABLE_ITEM_NONE
;
259 items
[FIRST_SEEN_COLUMN
].value
.float_value
= DBL_MAX
;
260 items
[LAST_SEEN_COLUMN
].type
= TABLE_ITEM_NONE
;
261 items
[LAST_SEEN_COLUMN
].value
.float_value
= DBL_MIN
;
262 items
[INTERVAL_COLUMN
].type
= TABLE_ITEM_NONE
;
263 items
[INTERVAL_COLUMN
].value
.float_value
= -1.0;
264 items
[MESSAGE_RATE_COLUMN
].type
= TABLE_ITEM_NONE
;
265 items
[MESSAGE_RATE_COLUMN
].value
.float_value
= -1.0;
266 items
[BYTE_RATE_COLUMN
].type
= TABLE_ITEM_NONE
;
267 items
[BYTE_RATE_COLUMN
].value
.float_value
= -1.0;
268 stat_tap_init_table_row(table
, i
, num_fields
, items
);
273 static tap_packet_status
274 ssprotocol_stat_packet(void* tapdata
, packet_info
* pinfo _U_
, epan_dissect_t
* edt _U_
, const void* data
, tap_flags_t flags _U_
)
276 stat_data_t
* stat_data
= (stat_data_t
*)tapdata
;
277 const tap_ssprotocol_rec_t
* tap_rec
= (const tap_ssprotocol_rec_t
*)data
;
278 stat_tap_table
* table
;
279 stat_tap_table_item_type
* msg_data
;
284 double firstSeen
= -1.0;
285 double lastSeen
= -1.0;
287 idx
= str_to_val_idx(tap_rec
->type_string
, message_type_values
);
289 return TAP_PACKET_DONT_REDRAW
;
291 table
= g_array_index(stat_data
->stat_tap_data
->tables
, stat_tap_table
*, 0);
293 /* Update packets counter */
294 ssprotocol_total_msgs
++;
295 msg_data
= stat_tap_get_field_data(table
, idx
, MESSAGES_COLUMN
);
296 msg_data
->value
.uint_value
++;
297 messages
= msg_data
->value
.uint_value
;
298 stat_tap_set_field_data(table
, idx
, MESSAGES_COLUMN
, msg_data
);
300 /* Update bytes counter */
301 ssprotocol_total_bytes
+= tap_rec
->size
;
302 msg_data
= stat_tap_get_field_data(table
, idx
, BYTES_COLUMN
);
303 msg_data
->value
.uint_value
+= tap_rec
->size
;
304 bytes
= msg_data
->value
.uint_value
;
305 stat_tap_set_field_data(table
, idx
, BYTES_COLUMN
, msg_data
);
307 /* Update messages and bytes share */
308 while (message_type_values
[i
].strptr
) {
309 msg_data
= stat_tap_get_field_data(table
, i
, MESSAGES_COLUMN
);
310 const unsigned m
= msg_data
->value
.uint_value
;
311 msg_data
= stat_tap_get_field_data(table
, i
, BYTES_COLUMN
);
312 const unsigned b
= msg_data
->value
.uint_value
;
314 msg_data
= stat_tap_get_field_data(table
, i
, MESSAGES_SHARE_COLUMN
);
315 msg_data
->type
= TABLE_ITEM_FLOAT
;
316 msg_data
->value
.float_value
= 100.0 * m
/ (double)ssprotocol_total_msgs
;
317 stat_tap_set_field_data(table
, i
, MESSAGES_SHARE_COLUMN
, msg_data
);
319 msg_data
= stat_tap_get_field_data(table
, i
, BYTES_SHARE_COLUMN
);
320 msg_data
->type
= TABLE_ITEM_FLOAT
;
321 msg_data
->value
.float_value
= 100.0 * b
/ (double)ssprotocol_total_bytes
;
322 stat_tap_set_field_data(table
, i
, BYTES_SHARE_COLUMN
, msg_data
);
326 /* Update first seen time */
327 if (pinfo
->presence_flags
& PINFO_HAS_TS
) {
328 msg_data
= stat_tap_get_field_data(table
, idx
, FIRST_SEEN_COLUMN
);
329 msg_data
->type
= TABLE_ITEM_FLOAT
;
330 msg_data
->value
.float_value
= MIN(msg_data
->value
.float_value
, nstime_to_sec(&pinfo
->rel_ts
));
331 firstSeen
= msg_data
->value
.float_value
;
332 stat_tap_set_field_data(table
, idx
, FIRST_SEEN_COLUMN
, msg_data
);
335 /* Update last seen time */
336 if (pinfo
->presence_flags
& PINFO_HAS_TS
) {
337 msg_data
= stat_tap_get_field_data(table
, idx
, LAST_SEEN_COLUMN
);
338 msg_data
->type
= TABLE_ITEM_FLOAT
;
339 msg_data
->value
.float_value
= MAX(msg_data
->value
.float_value
, nstime_to_sec(&pinfo
->rel_ts
));
340 lastSeen
= msg_data
->value
.float_value
;
341 stat_tap_set_field_data(table
, idx
, LAST_SEEN_COLUMN
, msg_data
);
344 if ((lastSeen
- firstSeen
) > 0.0) {
345 /* Update interval */
346 msg_data
= stat_tap_get_field_data(table
, idx
, INTERVAL_COLUMN
);
347 msg_data
->type
= TABLE_ITEM_FLOAT
;
348 msg_data
->value
.float_value
= lastSeen
- firstSeen
;
349 stat_tap_set_field_data(table
, idx
, INTERVAL_COLUMN
, msg_data
);
351 /* Update message rate */
352 msg_data
= stat_tap_get_field_data(table
, idx
, MESSAGE_RATE_COLUMN
);
353 msg_data
->type
= TABLE_ITEM_FLOAT
;
354 msg_data
->value
.float_value
= messages
/ (lastSeen
- firstSeen
);
355 stat_tap_set_field_data(table
, idx
, MESSAGE_RATE_COLUMN
, msg_data
);
357 /* Update byte rate */
358 msg_data
= stat_tap_get_field_data(table
, idx
, BYTE_RATE_COLUMN
);
359 msg_data
->type
= TABLE_ITEM_FLOAT
;
360 msg_data
->value
.float_value
= bytes
/ (lastSeen
- firstSeen
);
361 stat_tap_set_field_data(table
, idx
, BYTE_RATE_COLUMN
, msg_data
);
364 return TAP_PACKET_REDRAW
;
368 ssprotocol_stat_reset(stat_tap_table
* table
)
371 stat_tap_table_item_type
* item_data
;
373 for (element
= 0; element
< table
->num_elements
; element
++) {
374 item_data
= stat_tap_get_field_data(table
, element
, MESSAGES_COLUMN
);
375 item_data
->value
.uint_value
= 0;
376 stat_tap_set_field_data(table
, element
, MESSAGES_COLUMN
, item_data
);
378 item_data
= stat_tap_get_field_data(table
, element
, MESSAGES_SHARE_COLUMN
);
379 item_data
->type
= TABLE_ITEM_NONE
;
380 item_data
->value
.float_value
= -1.0;
381 stat_tap_set_field_data(table
, element
, MESSAGES_SHARE_COLUMN
, item_data
);
383 item_data
= stat_tap_get_field_data(table
, element
, BYTES_COLUMN
);
384 item_data
->value
.uint_value
= 0;
385 stat_tap_set_field_data(table
, element
, BYTES_COLUMN
, item_data
);
387 item_data
= stat_tap_get_field_data(table
, element
, BYTES_SHARE_COLUMN
);
388 item_data
->type
= TABLE_ITEM_NONE
;
389 item_data
->value
.float_value
= -1.0;
390 stat_tap_set_field_data(table
, element
, BYTES_SHARE_COLUMN
, item_data
);
392 item_data
= stat_tap_get_field_data(table
, element
, FIRST_SEEN_COLUMN
);
393 item_data
->type
= TABLE_ITEM_NONE
;
394 item_data
->value
.float_value
= DBL_MAX
;
395 stat_tap_set_field_data(table
, element
, FIRST_SEEN_COLUMN
, item_data
);
397 item_data
= stat_tap_get_field_data(table
, element
, LAST_SEEN_COLUMN
);
398 item_data
->type
= TABLE_ITEM_NONE
;
399 item_data
->value
.float_value
= DBL_MIN
;
400 stat_tap_set_field_data(table
, element
, LAST_SEEN_COLUMN
, item_data
);
402 item_data
= stat_tap_get_field_data(table
, element
, INTERVAL_COLUMN
);
403 item_data
->type
= TABLE_ITEM_NONE
;
404 item_data
->value
.float_value
= -1.0;
405 stat_tap_set_field_data(table
, element
, INTERVAL_COLUMN
, item_data
);
407 item_data
= stat_tap_get_field_data(table
, element
, MESSAGE_RATE_COLUMN
);
408 item_data
->type
= TABLE_ITEM_NONE
;
409 item_data
->value
.float_value
= -1.0;
410 stat_tap_set_field_data(table
, element
, MESSAGE_RATE_COLUMN
, item_data
);
412 item_data
= stat_tap_get_field_data(table
, element
, BYTE_RATE_COLUMN
);
413 item_data
->type
= TABLE_ITEM_NONE
;
414 item_data
->value
.float_value
= -1.0;
415 stat_tap_set_field_data(table
, element
, BYTE_RATE_COLUMN
, item_data
);
417 ssprotocol_total_msgs
= 0;
418 ssprotocol_total_bytes
= 0;
422 /* Register the protocol */
424 proto_register_ssprotocol(void)
427 /* Setup list of header fields */
428 static hf_register_info hf
[] = {
429 { &hf_message_type
, { "Type", "ssp.message_type", FT_UINT8
, BASE_DEC
, VALS(message_type_values
), 0x0, NULL
, HFILL
} },
430 { &hf_message_flags
, { "Flags", "ssp.message_flags", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
} },
431 { &hf_message_length
, { "Length", "ssp.message_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
} },
432 { &hf_message_status
, { "Status", "ssp.message_status", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
} },
433 { &hf_message_reason
, { "Reason", "ssp.message_reason", FT_UINT32
, BASE_DEC
, VALS(notrdy_reason_values
), 0x0, NULL
, HFILL
} },
434 { &hf_message_info
, { "Info", "ssp.message_info", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
} },
435 { &hf_message_data
, { "Data", "ssp.message_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
} },
436 { &hf_message_hash
, { "Hash", "ssp.message_hash", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
} },
437 { &hf_environment_u_bit
, { "U-Bit", "ssp.environment_u_bit", FT_BOOLEAN
, 8,TFS(&environment_u_bit
), SSP_ENVIRONMENT_U_BIT
, NULL
, HFILL
} }
440 /* Setup protocol subtree array */
441 static int *ett
[] = {
443 &ett_environment_flags
446 static tap_param ssprotocol_stat_params
[] = {
447 { PARAM_FILTER
, "filter", "Filter", NULL
, true }
450 static stat_tap_table_ui ssprotocol_stat_table
= {
451 REGISTER_STAT_GROUP_RSERPOOL
,
452 "ScriptingServiceProtocol Statistics",
455 ssprotocol_stat_init
,
456 ssprotocol_stat_packet
,
457 ssprotocol_stat_reset
,
460 array_length(ssprotocol_stat_fields
), ssprotocol_stat_fields
,
461 array_length(ssprotocol_stat_params
), ssprotocol_stat_params
,
466 /* Register the protocol name and description */
467 proto_ssprotocol
= proto_register_protocol("Scripting Service Protocol", "SSP", "ssp");
469 /* Required function calls to register the header fields and subtrees used */
470 proto_register_field_array(proto_ssprotocol
, hf
, array_length(hf
));
471 proto_register_subtree_array(ett
, array_length(ett
));
472 tap_ssprotocol
= register_tap("ssprotocol");
474 /* Register the dissector handle */
475 ssprotocol_handle
= register_dissector("ssp", dissect_ssprotocol
, proto_ssprotocol
);
477 register_stat_tap_table_ui(&ssprotocol_stat_table
);
481 proto_reg_handoff_ssprotocol(void)
483 dissector_add_uint("sctp.ppi", SSPROTOCOL_PAYLOAD_PROTOCOL_ID_LEGACY
, ssprotocol_handle
);
484 dissector_add_uint("sctp.ppi", SSP_PAYLOAD_PROTOCOL_ID
, ssprotocol_handle
);
488 * Editor modelines - https://www.wireshark.org/tools/modelines.html
493 * indent-tabs-mode: nil
496 * ex: set shiftwidth=2 tabstop=8 expandtab:
497 * :indentSize=2:tabSize=8:noTabs=true: