Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-ppcap.c
blob1c8c970e2476bf9d5aa6638040edaae37f2f4a50
1 /* packet-ppcap.c
2 * Copyright 2012, 2014, Ericsson AB
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "config.h"
13 #include <epan/packet.h>
14 #include <epan/address_types.h>
15 #include "packet-mtp3.h"
17 #define INVALID_SSN 0xff
19 void proto_register_ppcap(void);
21 static uint8_t ssn;
23 static dissector_handle_t ppcap_handle;
24 static dissector_handle_t mtp3_handle; /* MTP3 handle */
25 static dissector_handle_t tcap_handle; /* TCAP handle */
26 static dissector_handle_t bssap_handle; /* BSSAP handle */
27 static dissector_handle_t ranap_handle; /* RANAP handle */
28 static dissector_handle_t h248_handle; /* H248 handle */
29 static dissector_handle_t sip_handle; /* SIP handle */
30 static dissector_handle_t sccp_handle; /* SCCP handle */
31 static dissector_handle_t sgsap_handle; /* SGSAP handle */
32 static dissector_handle_t gtpv2_handle; /* GTPv2 handle */
34 static dissector_table_t sccp_ssn_dissector_table;
36 static mtp3_addr_pc_t* mtp3_addr_opc;
37 static mtp3_addr_pc_t* mtp3_addr_dpc;
39 static int ss7pc_address_type = -1;
41 static int ett_ppcap;
42 static int ett_ppcap1;
43 static int ett_ppcap_new;
45 static const value_string payload_tag_values[] = {
46 { 1, "Payload Type"},
47 { 2, "Payload Data"},
48 { 3, "Source Address"},
49 { 4, "Destination Address"},
50 { 5, "Local Port"},
51 { 6, "Remote Port"},
52 { 7, "Transfer Protocol used for message"},
53 { 8, "SCTP association ID" },
54 {256, "Info String"},
55 {0, NULL},
59 static const value_string address_type_values[] = {
60 {1, "SSN+SPC"},
61 {2, "SPC"},
62 {3, "IP Address"},
63 {4, "Node Id"},
64 {0, NULL},
68 /* Initialise the header fields */
70 static int proto_ppcap;
71 static int hf_ppcap_length;
72 static int hf_ppcap_payload_type;
73 static int hf_ppcap_ssn;
74 static int hf_ppcap_spc;
75 static int hf_ppcap_ssn1;
76 static int hf_ppcap_spc1;
77 static int hf_ppcap_opc;
78 static int hf_ppcap_dpc;
79 static int hf_ppcap_source_nodeid;
80 static int hf_ppcap_destination_nodeid;
81 /*static int hf_ppcap_source_address_type; */
82 /*static int hf_ppcap_destination_address_type; */
83 static int hf_ppcap_address_type;
84 static int hf_ppcap_source_ip_address1;
85 static int hf_ppcap_source_ip_address2;
86 static int hf_ppcap_destination_ip_address1;
87 static int hf_ppcap_destination_ip_address2;
88 static int hf_ppcap_reserved;
89 static int hf_ppcap_destreserved;
90 static int hf_ppcap_info;
91 static int hf_ppcap_payload_data;
92 static int hf_ppcap_local_port;
93 static int hf_ppcap_remote_port;
94 static int hf_ppcap_transport_prot;
95 static int hf_ppcap_sctp_assoc;
97 /* Initialize the subtree pointers */
99 void proto_reg_handoff_ppcap(void);
102 /* PPCAP payload types */
103 typedef enum {
104 PPCAP_UNKNOWN = 0,
105 PPCAP_MTP3 = 1,
106 PPCAP_TCAP = 2,
107 PPCAP_BSSAP = 3,
108 PPCAP_RANAP = 4,
109 PPCAP_H248 = 5,
110 PPCAP_SIP = 6,
111 PPCAP_SCCP = 7,
112 PPCAP_SGSAP = 8,
113 PPCAP_GTPV2 = 9
114 } payload_type_type;
116 static int dissect_ppcap_payload_type(tvbuff_t *, packet_info *, proto_tree *, int, payload_type_type *);
117 static int dissect_ppcap_source_address(tvbuff_t *, packet_info *, proto_tree *, int);
118 static int dissect_ppcap_destination_address(tvbuff_t *, packet_info *, proto_tree *, int);
119 static int dissect_ppcap_info_string(tvbuff_t *, proto_tree *, int);
120 static int dissect_ppcap_local_port(tvbuff_t *, proto_tree *, int);
121 static int dissect_ppcap_remote_port(tvbuff_t *,proto_tree *, int);
122 static int dissect_ppcap_transport_protocol(tvbuff_t *,proto_tree *, int);
123 static int dissect_ppcap_sctp_assoc(tvbuff_t *, proto_tree *, int);
124 static int dissect_ppcap_payload_data(tvbuff_t *, packet_info *, proto_tree *, int, proto_tree *, payload_type_type);
126 /*Dissecting the function PPCAP */
128 static int
129 dissect_ppcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
131 proto_item *ti;
132 proto_tree *ppcap_tree, *ppcap_tree1;
133 uint16_t msg_type;
134 int offset = 0;
135 payload_type_type payload_type = PPCAP_UNKNOWN;
137 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPCAP");
138 col_clear(pinfo->cinfo, COL_INFO);
140 ti = proto_tree_add_item(tree, proto_ppcap, tvb, 0, -1, ENC_NA);
141 ppcap_tree = proto_item_add_subtree(ti, ett_ppcap);
143 while (tvb_reported_length_remaining(tvb, offset) > 0)
145 msg_type = tvb_get_ntohs(tvb, offset);
146 ppcap_tree1 = proto_tree_add_subtree(ppcap_tree, tvb, offset, 2, ett_ppcap1, NULL,
147 val_to_str(msg_type, payload_tag_values, "Unknown PPCAP message type (%u)"));
148 offset = offset + 2;
149 switch (msg_type) {
150 case 1:
151 payload_type = PPCAP_UNKNOWN;
152 offset = dissect_ppcap_payload_type(tvb, pinfo, ppcap_tree1, offset, &payload_type);
153 break;
154 case 2:
155 offset = dissect_ppcap_payload_data(tvb, pinfo, ppcap_tree1, offset, tree, payload_type);
156 break;
157 case 3:
158 offset = dissect_ppcap_source_address(tvb, pinfo, ppcap_tree1, offset);
159 break;
160 case 4:
161 offset = dissect_ppcap_destination_address(tvb, pinfo, ppcap_tree1, offset);
162 break;
163 case 5:
164 offset = dissect_ppcap_local_port(tvb,ppcap_tree1, offset);
165 break;
166 case 6:
167 offset = dissect_ppcap_remote_port(tvb,ppcap_tree1, offset);
168 break;
169 case 7:
170 offset = dissect_ppcap_transport_protocol(tvb,ppcap_tree1, offset);
171 break;
172 case 8:
173 offset = dissect_ppcap_sctp_assoc(tvb, ppcap_tree1, offset);
174 break;
175 case 256:
176 offset = dissect_ppcap_info_string(tvb, ppcap_tree1, offset);
177 break;
180 return tvb_captured_length(tvb);
184 /* Dissecting the function Payload type to compare the protocol type */
187 *******************************************************
188 * Payload Type *
190 *******************************************************
195 static int
196 dissect_ppcap_payload_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree * ppcap_tree1, int offset, payload_type_type *payload_type)
198 char *string;
199 uint16_t msg_len =0;
200 msg_len = tvb_get_ntohs(tvb, offset);
201 proto_tree_add_item( ppcap_tree1, hf_ppcap_length, tvb, offset, 2, ENC_BIG_ENDIAN);
202 offset = offset + 2;
203 string = tvb_get_string_enc(pinfo->pool, tvb, offset, msg_len, ENC_UTF_8|ENC_NA);
204 if (strcmp(string,"mtp3") == 0) {
205 *payload_type = PPCAP_MTP3;
206 }else if (strcmp(string,"tcap") == 0) {
207 *payload_type = PPCAP_TCAP;
208 }else if (strcmp(string,"bssap") == 0) {
209 *payload_type = PPCAP_BSSAP;
210 }else if (strcmp(string,"ranap") == 0) {
211 *payload_type = PPCAP_RANAP;
212 }else if (strcmp(string,"h248") == 0) {
213 *payload_type = PPCAP_H248;
214 }else if (strcmp(string,"sip") == 0) {
215 *payload_type = PPCAP_SIP;
216 }else if (strcmp(string,"sccp") == 0) {
217 *payload_type = PPCAP_SCCP;
218 }else if (strcmp(string, "sgsap") == 0) {
219 *payload_type = PPCAP_SGSAP;
220 }else if (strcmp(string, "gtpv2") == 0) {
221 *payload_type = PPCAP_GTPV2;
224 proto_tree_add_item(ppcap_tree1, hf_ppcap_payload_type, tvb, offset, msg_len, ENC_UTF_8);
226 if (msg_len%4)
227 msg_len = msg_len+(4-(msg_len%4));
228 offset += msg_len;
229 return offset;
232 /* Dissecting the function Source Address */
236 *******************************************************
237 * Reserved * Address Type *
238 * * *
239 *******************************************************
240 * Address Value *
242 *******************************************************
245 static int
246 dissect_ppcap_source_address(tvbuff_t *tvb, packet_info *pinfo, proto_tree * ppcap_tree1, int offset)
248 int key1;
249 uint16_t msg_len;
250 msg_len = tvb_get_ntohs(tvb, offset);
251 proto_tree_add_item( ppcap_tree1, hf_ppcap_length, tvb, offset, 2, ENC_BIG_ENDIAN);
252 offset = offset + 2;
253 proto_tree_add_item(ppcap_tree1, hf_ppcap_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
254 offset += 2;
256 key1 = tvb_get_ntohs(tvb, offset);
257 proto_tree_add_item(ppcap_tree1, hf_ppcap_address_type, tvb, offset, 2, ENC_BIG_ENDIAN);
258 offset += 2;
260 if (key1 == 1)
262 proto_tree_add_item(ppcap_tree1, hf_ppcap_ssn, tvb, offset, 1, ENC_BIG_ENDIAN);
263 offset += 1;
264 proto_tree_add_item(ppcap_tree1, hf_ppcap_spc, tvb, offset, 3, ENC_BIG_ENDIAN);
265 /*src_addr1 = (uint32_t )tvb_get_ntoh24(tvb, offset);*/
266 mtp3_addr_opc = wmem_new0(pinfo->pool, mtp3_addr_pc_t);
267 mtp3_addr_opc->pc = (uint32_t )tvb_get_ntoh24(tvb, offset);
268 mtp3_addr_opc->type = ITU_STANDARD;
269 mtp3_addr_opc->ni = 0;
270 /*set_address(&pinfo->net_src, ss7pc_address_type, sizeof(mtp3_addr_pc_t), (uint8_t *) mtp3_addr_opc);*/
271 set_address(&pinfo->src, ss7pc_address_type, sizeof(mtp3_addr_pc_t), (uint8_t *) mtp3_addr_opc);
272 if (msg_len%4)
273 msg_len = msg_len + (4 - (msg_len%4));
275 offset += msg_len-1;
276 return offset;
278 else if (key1 == 2)
280 proto_tree_add_item(ppcap_tree1, hf_ppcap_opc, tvb, offset, msg_len, ENC_BIG_ENDIAN);
282 /*src_addr1 = (uint32_t )tvb_get_ntoh24(tvb, offset);*/
283 mtp3_addr_opc = wmem_new0(pinfo->pool, mtp3_addr_pc_t);
284 mtp3_addr_opc->pc = tvb_get_ntohl(tvb, offset);
285 mtp3_addr_opc->type = ITU_STANDARD;
286 mtp3_addr_opc->ni = 0;
287 set_address(&pinfo->src, ss7pc_address_type, sizeof(mtp3_addr_pc_t), (uint8_t *) mtp3_addr_opc);
289 else if (key1 == 3)
291 if (msg_len%16 != 0)
294 proto_tree_add_item(ppcap_tree1, hf_ppcap_source_ip_address1, tvb, offset, msg_len, ENC_NA);
295 set_address_tvb(&pinfo->net_src, AT_IPv4, 4, tvb, offset);
296 copy_address_shallow(&pinfo->src, &pinfo->net_src);
298 else
300 proto_tree_add_item(ppcap_tree1, hf_ppcap_source_ip_address2, tvb, offset, msg_len, ENC_NA);
301 set_address_tvb(&pinfo->net_src, AT_IPv6, 6, tvb, offset);
302 copy_address_shallow(&pinfo->src, &pinfo->net_src);
306 else if (key1 == 4)
309 proto_tree_add_item(ppcap_tree1, hf_ppcap_source_nodeid, tvb, offset, msg_len, ENC_ASCII);
310 set_address_tvb(&pinfo->net_src, AT_STRINGZ, msg_len, tvb, offset);
311 copy_address_shallow(&pinfo->src, &pinfo->net_src);
313 if (msg_len%4)
314 msg_len = msg_len + (4 - (msg_len%4));
315 offset += msg_len;
316 return offset;
319 /* Dissecting the function Destination Address */
322 *******************************************************
323 * Reserved * Address Type *
324 * * *
325 *******************************************************
326 * Address Value *
328 *******************************************************
332 static int
333 dissect_ppcap_destination_address(tvbuff_t *tvb, packet_info * pinfo, proto_tree * ppcap_tree1, int offset)
335 int key2;
336 uint16_t msg_len;
337 msg_len = tvb_get_ntohs(tvb, offset);
338 proto_tree_add_item( ppcap_tree1, hf_ppcap_length, tvb, offset, 2, ENC_BIG_ENDIAN);
339 offset = offset + 2;
340 proto_tree_add_item(ppcap_tree1, hf_ppcap_destreserved, tvb, offset, 2, ENC_BIG_ENDIAN);
341 offset += 2;
343 key2 = tvb_get_ntohs(tvb, offset);
344 proto_tree_add_item(ppcap_tree1, hf_ppcap_address_type, tvb, offset, 2, ENC_BIG_ENDIAN);
345 offset += 2;
347 if (key2 == 1)
349 ssn = tvb_get_uint8(tvb, offset);
350 proto_tree_add_item(ppcap_tree1, hf_ppcap_ssn1, tvb, offset, 1, ENC_BIG_ENDIAN);
351 offset += 1;
353 proto_tree_add_item(ppcap_tree1, hf_ppcap_spc1, tvb, offset, 3, ENC_BIG_ENDIAN);
355 /*dst_addr1 = (uint32_t )tvb_get_ntoh24(tvb, offset);*/
356 mtp3_addr_dpc = wmem_new0(pinfo->pool, mtp3_addr_pc_t);
357 mtp3_addr_dpc->pc = (uint32_t)tvb_get_ntoh24(tvb, offset);
358 mtp3_addr_dpc->type = ITU_STANDARD;
359 mtp3_addr_dpc->ni = 0;
360 set_address(&pinfo->dst, ss7pc_address_type, sizeof(mtp3_addr_pc_t), (uint8_t *) mtp3_addr_dpc);
362 if (msg_len%4)
363 msg_len = msg_len + (4 - (msg_len%4));
365 offset += msg_len-1;
366 return offset;
369 else if (key2 == 2)
371 proto_tree_add_item(ppcap_tree1, hf_ppcap_dpc, tvb, offset, 4, ENC_BIG_ENDIAN);
373 /*dst_addr1 = (uint32_t )tvb_get_ntoh24(tvb, offset);*/
374 mtp3_addr_dpc = wmem_new0(pinfo->pool, mtp3_addr_pc_t);
375 mtp3_addr_dpc->pc = tvb_get_ntohl(tvb, offset);
376 mtp3_addr_dpc->type = ITU_STANDARD;
377 mtp3_addr_dpc->ni = 0;
378 set_address(&pinfo->dst, ss7pc_address_type, sizeof(mtp3_addr_pc_t), (uint8_t *) mtp3_addr_dpc);
380 else if (key2 == 3)
382 if (msg_len%16 != 0)
384 proto_tree_add_item(ppcap_tree1, hf_ppcap_destination_ip_address1, tvb, offset, msg_len, ENC_NA);
385 set_address_tvb(&pinfo->net_dst, AT_IPv4, 4, tvb, offset);
386 copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
388 else
390 proto_tree_add_item(ppcap_tree1, hf_ppcap_destination_ip_address2, tvb, offset, msg_len, ENC_NA);
391 set_address_tvb(&pinfo->net_dst, AT_IPv6, 6, tvb, offset);
392 copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
396 else if (key2 == 4)
398 const uint8_t *string;
399 proto_tree_add_item_ret_string(ppcap_tree1, hf_ppcap_destination_nodeid, tvb, offset, msg_len, ENC_UTF_8|ENC_NA, pinfo->pool, &string);
400 set_address_tvb(&pinfo->net_dst, AT_STRINGZ, msg_len, tvb, offset);
401 copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
404 if (msg_len%4)
405 msg_len = msg_len+(4-(msg_len%4));
407 offset += msg_len;
409 return offset;
412 /* Dissecting the function Info String */
415 *******************************************************
416 * Info *
418 *******************************************************
421 static int
422 dissect_ppcap_info_string(tvbuff_t *tvb, proto_tree * ppcap_tree1, int offset)
424 uint16_t msg_len;
425 msg_len = tvb_get_ntohs(tvb, offset);
426 proto_tree_add_item( ppcap_tree1, hf_ppcap_length, tvb, offset, 2, ENC_BIG_ENDIAN);
427 offset = offset + 2;
428 proto_tree_add_item(ppcap_tree1, hf_ppcap_info, tvb, offset, msg_len, ENC_ASCII);
430 if (msg_len%4)
431 msg_len = msg_len +( 4- (msg_len%4));
432 offset += msg_len;
433 return offset;
436 /* Dissecting the function Local Port */
439 *******************************************************
440 * Local Port *
442 *******************************************************
444 static int
445 dissect_ppcap_local_port(tvbuff_t *tvb,proto_tree * ppcap_tree1, int offset)
447 proto_tree_add_item(ppcap_tree1,hf_ppcap_local_port,tvb,offset,2,ENC_BIG_ENDIAN);
448 offset = offset+6; /*Adding offset of filler bytes without text*/
449 return offset;
452 /* Dissecting the function Remote Port */
455 *******************************************************
456 * Remote Port *
458 *******************************************************
461 static int
462 dissect_ppcap_remote_port(tvbuff_t *tvb,proto_tree * ppcap_tree1, int offset)
464 proto_tree_add_item(ppcap_tree1,hf_ppcap_remote_port,tvb,offset,2,ENC_BIG_ENDIAN);
465 offset = offset+6; /*Adding offset of filler bytes without text*/
466 return offset;
469 /* Dissecting the function TCP SIP Message */
472 *******************************************************
473 * Transport protocol *
475 *******************************************************
478 static int
479 dissect_ppcap_transport_protocol(tvbuff_t *tvb,proto_tree * ppcap_tree1, int offset)
481 proto_tree_add_item(ppcap_tree1, hf_ppcap_length, tvb, offset, 2, ENC_BIG_ENDIAN);
482 offset = offset + 2;
483 proto_tree_add_item(ppcap_tree1, hf_ppcap_transport_prot, tvb, offset, 4, ENC_ASCII | ENC_NA);
484 offset += 4;
486 return offset;
489 static int
490 dissect_ppcap_sctp_assoc(tvbuff_t *tvb _U_, proto_tree * tree _U_, int offset)
492 uint16_t length;
493 length = tvb_get_ntohs(tvb, offset);
495 proto_tree_add_item(tree, hf_ppcap_length, tvb, offset, 2, ENC_BIG_ENDIAN);
496 offset = offset + 2;
498 proto_tree_add_item(tree, hf_ppcap_sctp_assoc, tvb, offset, length, ENC_ASCII | ENC_NA);
500 /* The string can be 1 -15 characters long but the IE is padded to 16 bytes*/
502 return offset + 16;
505 /* Dissecting the function Payload Data to call the protocol that based upon the type decided in the Payload Type */
508 *******************************************************
509 * Payload Data *
511 *******************************************************
515 static int
516 dissect_ppcap_payload_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree * ppcap_tree1, int offset, proto_tree *tree, payload_type_type payload_type)
518 tvbuff_t *next_tvb;
519 uint16_t msg_len;
520 msg_len = tvb_get_ntohs(tvb, offset);
521 proto_tree_add_item( ppcap_tree1, hf_ppcap_length, tvb, offset, 2, ENC_BIG_ENDIAN);
522 offset = offset + 2;
523 proto_tree_add_item(ppcap_tree1, hf_ppcap_payload_data, tvb, offset, msg_len, ENC_NA);
525 if (msg_len%4)
526 msg_len = msg_len +( 4- (msg_len%4));
528 next_tvb = tvb_new_subset_remaining(tvb, offset);
530 switch (payload_type) {
531 case PPCAP_MTP3:
532 call_dissector(mtp3_handle, next_tvb, pinfo, tree); /* calling the MTP3 handle */
533 break;
534 case PPCAP_TCAP:
536 * The protocol which runs on TCAP takes the SSN value from the SCCP layer which is missing in this case.
537 * So we have made code changes for TCAP handle as below for taking the SSN value from ppcap.
539 if (ssn != INVALID_SSN && dissector_try_uint(sccp_ssn_dissector_table, ssn, next_tvb, pinfo, tree)) {
540 return offset+msg_len;
541 }else{
542 call_dissector(tcap_handle, next_tvb, pinfo, tree); /* calling the TCAP handle */
544 break;
545 case PPCAP_BSSAP:
546 call_dissector(bssap_handle, next_tvb, pinfo, tree); /* calling the BSSAP handle */
547 break;
548 case PPCAP_RANAP:
549 call_dissector(ranap_handle, next_tvb, pinfo, tree); /* calling the RANAP handle */
550 break;
551 case PPCAP_H248:
552 call_dissector(h248_handle, next_tvb, pinfo, tree); /* calling the H248 handle */
553 break;
554 case PPCAP_SIP:
555 call_dissector(sip_handle, next_tvb, pinfo, tree); /* calling the SIP handle */
556 break;
557 case PPCAP_SCCP:
558 call_dissector(sccp_handle, next_tvb, pinfo, tree); /* calling the SCCP handle */
559 break;
560 case PPCAP_SGSAP:
561 call_dissector(sgsap_handle, next_tvb, pinfo, tree); /* calling the SGSAP handle */
562 break;
563 case PPCAP_GTPV2:
564 call_dissector(gtpv2_handle, next_tvb, pinfo, tree); /* calling the GTPv2 handle */
565 break;
566 default:
567 call_data_dissector(next_tvb, pinfo, tree); /* calling the DATA handle */
568 break;
571 offset += msg_len;
572 return offset;
575 /* Registering the hf variables */
577 void proto_register_ppcap(void)
580 static hf_register_info hf[] = {
581 { &hf_ppcap_length,
582 { "Length", "ppcap.length",
583 FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL}},
584 { &hf_ppcap_payload_type,
585 { "Payload Type", "ppcap.payload_type", FT_STRING,
586 BASE_NONE, NULL, 0x0 , NULL, HFILL}},
587 { &hf_ppcap_reserved,
588 { "Reserved", "ppcap.reserved", FT_UINT16,
589 BASE_DEC, NULL, 0x00, NULL, HFILL}},
590 { &hf_ppcap_address_type,
591 { "Address Type", "ppcap.address_type", FT_UINT16,
592 BASE_DEC, VALS(address_type_values), 0x00 , NULL, HFILL}},
593 #if 0
594 { &hf_ppcap_source_address_type,
595 { "Source Address Type", "ppcap.source_address_type", FT_UINT16,
596 BASE_DEC, VALS(address_type_values), 0x00 , NULL, HFILL}},
597 #endif
598 { &hf_ppcap_ssn,
599 { "SSN", "ppcap.ssn", FT_UINT16,
600 BASE_DEC, NULL, 0x00, NULL, HFILL}},
601 { &hf_ppcap_spc,
602 {"OPC", "ppcap.spc", FT_UINT24,
603 BASE_DEC, NULL, 0x00, NULL, HFILL}},
604 { &hf_ppcap_opc,
605 { "OPC", "ppcap.opc", FT_UINT16,
606 BASE_DEC, NULL, 0x00, NULL, HFILL}},
607 { &hf_ppcap_source_ip_address1,
608 { "Source IP Address", "ppcap.source_ip_address1", FT_IPv4,
609 BASE_NONE, NULL, 0x00, NULL, HFILL}},
610 { &hf_ppcap_source_ip_address2,
611 { "Source IP Address", "ppcap.source_ip_address2", FT_IPv6,
612 BASE_NONE, NULL, 0x00, NULL, HFILL}},
613 { &hf_ppcap_destreserved,
614 { "Reserved", "ppcap.destreserved", FT_UINT16,
615 BASE_DEC, NULL, 0x00, NULL, HFILL}},
616 #if 0
617 { &hf_ppcap_destination_address_type,
618 { "Destination Address Type", "ppcap.destination_address_type", FT_UINT16,
619 BASE_DEC, VALS(address_type_values), 0x00, NULL, HFILL}},
620 #endif
621 { &hf_ppcap_ssn1,
622 { "SSN", "ppcap.ssn1", FT_UINT8,
623 BASE_DEC, NULL, 0x00, NULL, HFILL}},
624 { &hf_ppcap_spc1,
625 { "DPC", "ppcap.spc1", FT_UINT24,
626 BASE_DEC, NULL, 0x00, NULL, HFILL}},
627 { &hf_ppcap_dpc,
628 { "DPC", "ppcap.dpc", FT_UINT32,
629 BASE_DEC, NULL, 0x00, NULL, HFILL}},
630 { &hf_ppcap_destination_ip_address1,
631 { "Destination IP Address", "ppcap.destination_ip_address1", FT_IPv4,
632 BASE_NONE, NULL, 0x0, NULL, HFILL}},
633 { &hf_ppcap_destination_ip_address2,
634 { "Destination IP Address", "ppcap.destination_ip_address2", FT_IPv6,
635 BASE_NONE, NULL, 0x0, NULL, HFILL}},
636 { &hf_ppcap_source_nodeid,
637 { "Source Node ID", "ppcap.source_nodeid", FT_STRING,
638 BASE_NONE, NULL, 0x0, NULL, HFILL}},
639 { &hf_ppcap_destination_nodeid,
640 { "Destination Node ID", "ppcap.destination_address", FT_STRING,
641 BASE_NONE, NULL, 0x0, NULL, HFILL}},
642 { &hf_ppcap_info,
643 { "Info", "ppcap.info", FT_STRING,
644 BASE_NONE, NULL, 0x0, NULL, HFILL}},
645 { &hf_ppcap_payload_data,
646 { "Payload Data", "ppcap.payload_data", FT_BYTES,
647 BASE_NONE, NULL, 0x0, NULL, HFILL}},
648 { &hf_ppcap_local_port,
649 { "Local Port", "ppcap.local_port", FT_UINT16,
650 BASE_DEC, NULL, 0x00, NULL, HFILL}},
651 { &hf_ppcap_remote_port,
652 { "Remote Port", "ppcap.remote_port", FT_UINT16,
653 BASE_DEC, NULL, 0x00, NULL, HFILL}},
654 { &hf_ppcap_transport_prot,
655 { "Transport Protocol", "ppcap.transport_prot", FT_STRING,
656 BASE_NONE, NULL, 0x0 , NULL, HFILL}},
657 { &hf_ppcap_sctp_assoc,
658 { "SCTP Association ID", "ppcap.sctp_assoc", FT_STRING,
659 BASE_NONE, NULL, 0x0 , NULL, HFILL } },
662 static int *ett[]= {
663 &ett_ppcap,
664 &ett_ppcap1,
665 &ett_ppcap_new,
667 proto_ppcap = proto_register_protocol("Proprietary PCAP", "PPCAP", "ppcap");
668 proto_register_field_array(proto_ppcap , hf , array_length(hf));
669 proto_register_subtree_array(ett, array_length(ett));
670 register_dissector("ppcap", dissect_ppcap, proto_ppcap);
674 void proto_reg_handoff_ppcap(void)
676 ppcap_handle = find_dissector_add_dependency("ppcap", proto_ppcap);
677 mtp3_handle = find_dissector_add_dependency("mtp3", proto_ppcap); /* calling the protocol MTP3 */
678 tcap_handle = find_dissector_add_dependency("tcap", proto_ppcap); /* calling the protocol TCAP */
679 bssap_handle = find_dissector_add_dependency("bssap", proto_ppcap); /* calling the protocol BSSAP */
680 ranap_handle = find_dissector_add_dependency("ranap", proto_ppcap); /* calling the protocol RANAP */
681 h248_handle = find_dissector_add_dependency("h248", proto_ppcap); /* calling the protocol H248 */
682 sip_handle = find_dissector_add_dependency("sip", proto_ppcap); /* calling the protocol SIP */
683 sccp_handle = find_dissector_add_dependency("sccp", proto_ppcap); /* calling the protocol SCCP */
684 sgsap_handle = find_dissector_add_dependency("sgsap", proto_ppcap); /* calling the protocol SGSAP */
685 gtpv2_handle = find_dissector_add_dependency("gtpv2", proto_ppcap); /* calling the protocol GTPv2 */
687 sccp_ssn_dissector_table = find_dissector_table("sccp.ssn");
689 ss7pc_address_type = address_type_get_by_name("AT_SS7PC");
693 * Editor modelines - https://www.wireshark.org/tools/modelines.html
695 * Local variables:
696 * c-basic-offset: 8
697 * tab-width: 8
698 * indent-tabs-mode: t
699 * End:
701 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
702 * :indentSize=8:tabSize=8:noTabs=false: