diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-02-03 18:26:37 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-02-03 18:26:37 +0000 |
commit | 183f0e934c681b494e53d6ff51c1a716f1647449 (patch) | |
tree | a66202023ff34aed8944e54a45d9aa48ad3bc790 /epan/dissectors | |
parent | a3fc8f5f459ec8a841ede98b847edb5287237d7f (diff) | |
download | wireshark-183f0e934c681b494e53d6ff51c1a716f1647449.tar.gz |
Create a list of MTP Service Indicator macros and use them.
svn path=/trunk/; revision=40828
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-alcap.c | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-h248.c | 18 | ||||
-rw-r--r-- | epan/dissectors/packet-h248.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-isup.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-mtp3.c | 72 | ||||
-rw-r--r-- | epan/dissectors/packet-mtp3.h | 15 | ||||
-rw-r--r-- | epan/dissectors/packet-mtp3mg.c | 15 | ||||
-rw-r--r-- | epan/dissectors/packet-sccp.c | 4 |
8 files changed, 70 insertions, 67 deletions
diff --git a/epan/dissectors/packet-alcap.c b/epan/dissectors/packet-alcap.c index 02096cf49a..fb190ad618 100644 --- a/epan/dissectors/packet-alcap.c +++ b/epan/dissectors/packet-alcap.c @@ -41,6 +41,7 @@ #include <epan/emem.h> #include <epan/prefs.h> #include "packet-alcap.h" +#include "packet-mtp3.h" #include <epan/dissectors/packet-isup.h> #include <epan/expert.h> @@ -48,8 +49,6 @@ #define ALCAP_PARM_HEADER_LEN 3 #define FIELD_NSAP_ADDRESS_LEN 20 -#define ALCAP_SI 12 - static const value_string msg_type_strings[] = { { 1, "Block confirm (BLC)" }, { 2, "Block request (BLO)" }, @@ -1796,5 +1795,5 @@ proto_reg_handoff_alcap(void) { dissector_handle_t alcap_handle = create_dissector_handle(dissect_alcap, proto_alcap); - dissector_add_uint("mtp3.service_indicator", ALCAP_SI, alcap_handle); + dissector_add_uint("mtp3.service_indicator", MTP_SI_AAL2, alcap_handle); } diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c index 151a36af40..7f3891a3e8 100644 --- a/epan/dissectors/packet-h248.c +++ b/epan/dissectors/packet-h248.c @@ -1,7 +1,7 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-h248.c */ -/* ../../tools/asn2wrs.py -b -p h248 -c ./h248.cnf -s ./packet-h248-template -D . -O ../../epan/dissectors h248v3.asn h248v1support.asn */ +/* ../../../tools/asn2wrs.py -b -p h248 -c ../../../asn1/h248/h248.cnf -s ../../../asn1/h248/packet-h248-template -D ../../../asn1/h248 -O ../../../epan/dissectors h248v3.asn h248v1support.asn */ /* Input file: packet-h248-template.c */ @@ -41,14 +41,12 @@ #include <epan/tap.h> #include "packet-tpkt.h" #include <ctype.h> +#include "packet-mtp3.h" #define PNAME "H.248 MEGACO" #define PSNAME "H248" #define PFNAME "h248" -#define GATEWAY_CONTROL_PROTOCOL_USER_ID 14 - - /* Initialize the protocol and registered fields */ static int proto_h248 = -1; static int hf_h248_mtpaddress_ni = -1; @@ -397,7 +395,7 @@ static int hf_h248_NotifyCompletion_otherReason = -1; static int hf_h248_NotifyCompletion_onIteration = -1; /*--- End of included file: packet-h248-hf.c ---*/ -#line 75 "../../asn1/h248/packet-h248-template.c" +#line 73 "../../asn1/h248/packet-h248-template.c" /* Initialize the subtree pointers */ static gint ett_h248 = -1; @@ -565,7 +563,7 @@ static gint ett_h248_T_extraInfo_01 = -1; static gint ett_h248_SigParameterV1 = -1; /*--- End of included file: packet-h248-ett.c ---*/ -#line 92 "../../asn1/h248/packet-h248-template.c" +#line 90 "../../asn1/h248/packet-h248-template.c" static dissector_handle_t h248_term_handle; @@ -5341,7 +5339,7 @@ dissect_h248_SigParameterV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of /*--- End of included file: packet-h248-fn.c ---*/ -#line 1328 "../../asn1/h248/packet-h248-template.c" +#line 1326 "../../asn1/h248/packet-h248-template.c" static void dissect_h248_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { dissect_tpkt_encap(tvb, pinfo, tree, h248_desegment, h248_handle); @@ -6734,7 +6732,7 @@ void proto_register_h248(void) { NULL, HFILL }}, /*--- End of included file: packet-h248-hfarr.c ---*/ -#line 1468 "../../asn1/h248/packet-h248-template.c" +#line 1466 "../../asn1/h248/packet-h248-template.c" GCP_HF_ARR_ELEMS("h248",h248_arrel) @@ -6903,7 +6901,7 @@ void proto_register_h248(void) { &ett_h248_SigParameterV1, /*--- End of included file: packet-h248-ettarr.c ---*/ -#line 1486 "../../asn1/h248/packet-h248-template.c" +#line 1484 "../../asn1/h248/packet-h248-template.c" }; module_t *h248_module; @@ -6958,7 +6956,7 @@ void proto_reg_handoff_h248(void) { if (!initialized) { h248_handle = find_dissector("h248"); h248_tpkt_handle = find_dissector("h248.tpkt"); - dissector_add_uint("mtp3.service_indicator", GATEWAY_CONTROL_PROTOCOL_USER_ID, h248_handle); + dissector_add_uint("mtp3.service_indicator", MTP_SI_GCP, h248_handle); h248_term_handle = find_dissector("h248term"); initialized = TRUE; } else { diff --git a/epan/dissectors/packet-h248.h b/epan/dissectors/packet-h248.h index a117ac6143..c798050291 100644 --- a/epan/dissectors/packet-h248.h +++ b/epan/dissectors/packet-h248.h @@ -1,7 +1,7 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-h248.h */ -/* ../../tools/asn2wrs.py -b -p h248 -c ./h248.cnf -s ./packet-h248-template -D . -O ../../epan/dissectors h248v3.asn h248v1support.asn */ +/* ../../../tools/asn2wrs.py -b -p h248 -c ../../../asn1/h248/h248.cnf -s ../../../asn1/h248/packet-h248-template -D ../../../asn1/h248 -O ../../../epan/dissectors h248v3.asn h248v1support.asn */ /* Input file: packet-h248-template.h */ diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c index 497132c5ce..cf1b1af3c3 100644 --- a/epan/dissectors/packet-isup.c +++ b/epan/dissectors/packet-isup.c @@ -58,8 +58,6 @@ static gint isup_standard = ITU_STANDARD; -#define MTP3_ISUP_SERVICE_INDICATOR 5 -#define MTP3_BICC_SERVICE_INDICATOR 13 #define ASCII_NUMBER_DELTA 0x30 #define ASCII_LETTER_DELTA 0x37 @@ -8664,7 +8662,7 @@ proto_reg_handoff_isup(void) isup_handle = create_dissector_handle(dissect_isup, proto_isup); application_isup_handle = create_dissector_handle(dissect_application_isup, proto_isup); - dissector_add_uint("mtp3.service_indicator", MTP3_ISUP_SERVICE_INDICATOR, isup_handle); + dissector_add_uint("mtp3.service_indicator", MTP_SI_ISUP, isup_handle); dissector_add_string("media_type","application/isup", application_isup_handle); dissector_add_string("tali.opcode", "isot", isup_handle); @@ -8704,6 +8702,6 @@ proto_reg_handoff_bicc(void) q931_ie_handle = find_dissector("q931.ie"); bicc_handle = create_dissector_handle(dissect_bicc, proto_bicc); - dissector_add_uint("mtp3.service_indicator", MTP3_BICC_SERVICE_INDICATOR, bicc_handle); + dissector_add_uint("mtp3.service_indicator", MTP_SI_BICC, bicc_handle); dissector_add_uint("sctp.ppi", BICC_PAYLOAD_PROTOCOL_ID, bicc_handle); } diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c index 8e4730df5a..e9777d02db 100644 --- a/epan/dissectors/packet-mtp3.c +++ b/epan/dissectors/packet-mtp3.c @@ -182,41 +182,41 @@ static mtp3_addr_pc_t* mtp3_addr_opc; /* the higher values are taken from the M3UA RFC */ static const value_string mtp3_service_indicator_code_vals[] = { - { 0x0, "Signalling Network Management Message (SNM)" }, - { 0x1, "Maintenance Regular Message (MTN)" }, - { 0x2, "Maintenance Special Message (MTNS)" }, - { 0x3, "SCCP" }, - { 0x4, "TUP" }, - { 0x5, "ISUP" }, - { 0x6, "DUP (call and circuit related messages)" }, - { 0x7, "DUP (facility registration and cancellation message)" }, - { 0x8, "MTP testing user part" }, - { 0x9, "Broadband ISUP" }, - { 0xa, "Satellite ISUP" }, - { 0xb, "Spare" }, - { 0xc, "AAL type2 Signaling" }, - { 0xd, "Bearer Independent Call Control (BICC)" }, - { 0xe, "Gateway Control Protocol" }, - { 0xf, "Spare" }, - { 0, NULL } + { MTP_SI_SNM, "Signalling Network Management Message (SNM)" }, + { MTP_SI_MTN, "Maintenance Regular Message (MTN)" }, + { MTP_SI_MTNS, "Maintenance Special Message (MTNS)" }, + { MTP_SI_SCCP, "SCCP" }, + { MTP_SI_TUP, "TUP" }, + { MTP_SI_ISUP, "ISUP" }, + { MTP_SI_DUP_CC, "DUP (call and circuit related messages)" }, + { MTP_SI_DUP_FAC, "DUP (facility registration and cancellation message)" }, + { MTP_SI_MTP_TEST, "MTP testing user part" }, + { MTP_SI_ISUP_B, "Broadband ISUP" }, + { MTP_SI_ISUP_S, "Satellite ISUP" }, + { 0xb, "Spare" }, + { MTP_SI_AAL2, "AAL type2 Signaling" }, + { MTP_SI_BICC, "Bearer Independent Call Control (BICC)" }, + { MTP_SI_GCP, "Gateway Control Protocol" }, + { 0xf, "Spare" }, + { 0, NULL } }; const value_string mtp3_service_indicator_code_short_vals[] = { - { 0x0, "SNM" }, - { 0x1, "MTN" }, - { 0x2, "MTNS" }, - { 0x3, "SCCP" }, - { 0x4, "TUP" }, - { 0x5, "ISUP" }, - { 0x6, "DUP (CC)" }, - { 0x7, "DUP (FAC/CANC)" }, - { 0x8, "MTP Test" }, - { 0x9, "ISUP-b" }, - { 0xa, "ISUP-s" }, - { 0xc, "AAL type 2" }, - { 0xd, "BICC" }, - { 0xe, "GCP" }, - { 0, NULL } + { MTP_SI_SNM, "SNM" }, + { MTP_SI_MTN, "MTN" }, + { MTP_SI_MTNS, "MTNS" }, + { MTP_SI_SCCP, "SCCP" }, + { MTP_SI_TUP, "TUP" }, + { MTP_SI_ISUP, "ISUP" }, + { MTP_SI_DUP_CC, "DUP (CC)" }, + { MTP_SI_DUP_FAC, "DUP (FAC/CANC)" }, + { MTP_SI_MTP_TEST, "MTP Test" }, + { MTP_SI_ISUP_B, "ISUP-b" }, + { MTP_SI_ISUP_S, "ISUP-s" }, + { MTP_SI_AAL2, "AAL type 2" }, + { MTP_SI_BICC, "BICC" }, + { MTP_SI_GCP, "GCP" }, + { 0, NULL } }; static const value_string network_indicator_vals[] = { @@ -665,7 +665,7 @@ heur_mtp3_standard(tvbuff_t *tvb, packet_info *pinfo, guint8 si) len = tvb_length(tvb); switch (si) { - case 3: + case MTP_SI_SCCP: { payload = tvb_new_subset(tvb, ITU_HEADER_LENGTH, len-ITU_HEADER_LENGTH, len-ITU_HEADER_LENGTH); if (looks_like_valid_sccp(PINFO_FD_NUM(pinfo), payload, ITU_STANDARD)) { @@ -762,12 +762,12 @@ dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) mtp3_addr_dpc = ep_alloc0(sizeof(mtp3_addr_pc_t)); /* Dissect the packet (even if !tree so can call sub-dissectors and update - * the source and destination address columns) */ + * the source and destination address columns) */ dissect_mtp3_sio(tvb, pinfo, mtp3_tree, &pd_save); dissect_mtp3_routing_label(tvb, pinfo, mtp3_tree); - memcpy(&(tap_rec->addr_opc),mtp3_addr_opc,sizeof(mtp3_addr_pc_t)); - memcpy(&(tap_rec->addr_dpc),mtp3_addr_dpc,sizeof(mtp3_addr_pc_t)); + memcpy(&(tap_rec->addr_opc), mtp3_addr_opc, sizeof(mtp3_addr_pc_t)); + memcpy(&(tap_rec->addr_dpc), mtp3_addr_dpc, sizeof(mtp3_addr_pc_t)); tap_rec->si_code = (tvb_get_guint8(tvb, SIO_OFFSET) & SERVICE_INDICATOR_MASK); tap_rec->size = tvb_length(tvb); diff --git a/epan/dissectors/packet-mtp3.h b/epan/dissectors/packet-mtp3.h index 57f6c7b3fd..49f76b12e6 100644 --- a/epan/dissectors/packet-mtp3.h +++ b/epan/dissectors/packet-mtp3.h @@ -96,6 +96,21 @@ extern void dissect_mtp3_3byte_pc(tvbuff_t *tvb, guint offset, */ WS_VAR_IMPORT const value_string mtp3_service_indicator_code_short_vals[]; +#define MTP_SI_SNM 0x0 +#define MTP_SI_MTN 0x1 +#define MTP_SI_MTNS 0x2 +#define MTP_SI_SCCP 0x3 +#define MTP_SI_TUP 0x4 +#define MTP_SI_ISUP 0x5 +#define MTP_SI_DUP_CC 0x6 +#define MTP_SI_DUP_FAC 0x7 +#define MTP_SI_MTP_TEST 0x8 +#define MTP_SI_ISUP_B 0x9 +#define MTP_SI_ISUP_S 0xa +#define MTP_SI_AAL2 0xc +#define MTP_SI_BICC 0xd +#define MTP_SI_GCP 0xe + /* * I only want to gather stats for non-spare SI codes */ diff --git a/epan/dissectors/packet-mtp3mg.c b/epan/dissectors/packet-mtp3mg.c index 056bc94a48..eb7148edf0 100644 --- a/epan/dissectors/packet-mtp3mg.c +++ b/epan/dissectors/packet-mtp3mg.c @@ -47,11 +47,6 @@ #include <packet-mtp3.h> -/* MTP3 Service Indicators used by this dissector */ -#define MTP3MG_SI 0 -#define MTP3MG_ITU_TEST_SI 1 -#define MTP3MG_ANSI_TEST_SI 2 - #define H0H1_LENGTH 1 #define H0_MASK 0x0f #define H1_MASK 0xf0 @@ -1038,8 +1033,8 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * Dissect the message */ - if(pinfo->private_data == (void *)MTP3MG_ANSI_TEST_SI || - pinfo->private_data == (void *)MTP3MG_ITU_TEST_SI) + if(pinfo->private_data == (void *)MTP_SI_MTN || /* ITU */ + pinfo->private_data == (void *)MTP_SI_MTNS) /* ANSI */ { /* Test messages */ if (mtp3_standard == JAPAN_STANDARD) @@ -1525,12 +1520,12 @@ proto_reg_handoff_mtp3mg(void) mtp3mg_handle = find_dissector("mtp3mg"); - dissector_add_uint("mtp3.service_indicator", MTP3MG_SI, mtp3mg_handle); + dissector_add_uint("mtp3.service_indicator", MTP_SI_SNM, mtp3mg_handle); /* SI 1 is unused in ANSI and SI 2 is unused in ITU, so it's okay for us * to grab both (regardless of mtp3.standard setting) here. */ - dissector_add_uint("mtp3.service_indicator", MTP3MG_ITU_TEST_SI, mtp3mg_handle); - dissector_add_uint("mtp3.service_indicator", MTP3MG_ANSI_TEST_SI, mtp3mg_handle); + dissector_add_uint("mtp3.service_indicator", MTP_SI_MTN, mtp3mg_handle); + dissector_add_uint("mtp3.service_indicator", MTP_SI_MTNS, mtp3mg_handle); } diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c index a50a9bbd95..a07fc9395b 100644 --- a/epan/dissectors/packet-sccp.c +++ b/epan/dissectors/packet-sccp.c @@ -66,8 +66,6 @@ void proto_reg_handoff_sccp(void); static Standard_Type decode_mtp3_standard; -#define SCCP_SI 3 - #define SCCP_MSG_TYPE_OFFSET 0 #define SCCP_MSG_TYPE_LENGTH 1 #define POINTER_LENGTH 1 @@ -3954,7 +3952,7 @@ proto_reg_handoff_sccp(void) sccp_handle = find_dissector("sccp"); dissector_add_uint("wtap_encap", WTAP_ENCAP_SCCP, sccp_handle); - dissector_add_uint("mtp3.service_indicator", SCCP_SI, sccp_handle); + dissector_add_uint("mtp3.service_indicator", MTP_SI_SCCP, sccp_handle); dissector_add_string("tali.opcode", "sccp", sccp_handle); data_handle = find_dissector("data"); |