diff options
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | packet-mtp3.c | 76 | ||||
-rw-r--r-- | packet-mtp3.h | 5 | ||||
-rw-r--r-- | packet-mtp3mg.c | 243 | ||||
-rw-r--r-- | packet-sccp.c | 138 | ||||
-rwxr-xr-x | packet-sccpmg.c | 39 |
6 files changed, 319 insertions, 183 deletions
@@ -832,6 +832,7 @@ Jeff Morriss <jeff.morriss[AT]ulticom.com> { MTP3 Management support Fix M3UA to dissect other protocols even when not building a protocol tree + Support for Chinese ITU SS7 variant } Aamer Akhter <aakhter[AT]cisco.com> { diff --git a/packet-mtp3.c b/packet-mtp3.c index 5edf6cfacd..4380738ea2 100644 --- a/packet-mtp3.c +++ b/packet-mtp3.c @@ -1,9 +1,15 @@ /* packet-mtp3.c * Routines for Message Transfer Part Level 3 dissection + * + * It is (hopefully) compliant to: + * ANSI T1.111.4-1996 + * ITU-T Q.704 7/1996 + * GF 001-9001 (Chinese ITU variant) + * * Copyright 2001, Michael Tuexen <Michael.Tuexen@icn.siemens.de> - * Updated for ANSI support by Jeff Morriss <jeff.morriss[AT]ulticom.com> + * Updated for ANSI and Chinese ITU support by Jeff Morriss <jeff.morriss[AT]ulticom.com> * - * $Id: packet-mtp3.c,v 1.14 2003/01/28 23:56:39 guy Exp $ + * $Id: packet-mtp3.c,v 1.15 2003/04/10 18:52:09 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -49,17 +55,20 @@ static int hf_mtp3_itu_spare = -1; static int hf_mtp3_ansi_priority = -1; static int hf_mtp3_itu_opc = -1; static int hf_mtp3_ansi_opc = -1; +static int hf_mtp3_chinese_opc = -1; static int hf_mtp3_opc_network = -1; static int hf_mtp3_opc_cluster = -1; static int hf_mtp3_opc_member = -1; static int hf_mtp3_itu_dpc = -1; static int hf_mtp3_ansi_dpc = -1; +static int hf_mtp3_chinese_dpc = -1; static int hf_mtp3_dpc_network = -1; static int hf_mtp3_dpc_cluster = -1; static int hf_mtp3_dpc_member = -1; static int hf_mtp3_itu_sls = -1; static int hf_mtp3_ansi_5_bit_sls = -1; static int hf_mtp3_ansi_8_bit_sls = -1; +static int hf_mtp3_chinese_itu_sls = -1; /* Initialize the subtree pointers */ static gint ett_mtp3 = -1; @@ -73,7 +82,7 @@ static dissector_table_t mtp3_sio_dissector_table; #include <packet-mtp3.h> Standard_Type mtp3_standard = ITU_STANDARD; -gboolean mtp3_use_ansi_5_bit_sls = FALSE; +static gboolean mtp3_use_ansi_5_bit_sls = FALSE; #define SIO_LENGTH 1 @@ -109,6 +118,7 @@ gboolean mtp3_use_ansi_5_bit_sls = FALSE; #define ANSI_MEMBER_MASK 0xFF0000 #define ANSI_5BIT_SLS_MASK 0x1F #define ANSI_8BIT_SLS_MASK 0xFF +#define CHINESE_ITU_SLS_MASK 0xF static const value_string service_indicator_code_vals[] = { { 0x0, "Signalling Network Management Message (SNM)" }, @@ -161,6 +171,7 @@ dissect_mtp3_sio(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mtp3_tree) SIO_LENGTH, sio); break; case ITU_STANDARD: + case CHINESE_ITU_STANDARD: proto_tree_add_uint(sio_tree, hf_mtp3_itu_spare, tvb, SIO_OFFSET, SIO_LENGTH, sio); break; @@ -181,6 +192,9 @@ dissect_mtp3_routing_label(tvbuff_t *tvb, proto_tree *mtp3_tree) proto_item *label_item, *label_dpc_item, *label_opc_item; proto_tree *label_tree, *label_dpc_tree, *label_opc_tree; char pc[ANSI_PC_STRING_LENGTH]; + int *hf_dpc_string; + int *hf_opc_string; + switch (mtp3_standard) { case ITU_STANDARD: @@ -202,27 +216,29 @@ dissect_mtp3_routing_label(tvbuff_t *tvb, proto_tree *mtp3_tree) break; case ANSI_STANDARD: + case CHINESE_ITU_STANDARD: + if (mtp3_standard == ANSI_STANDARD) + { + hf_dpc_string = &hf_mtp3_ansi_dpc; + hf_opc_string = &hf_mtp3_ansi_opc; + } else /* CHINESE_ITU_STANDARD */ { + hf_dpc_string = &hf_mtp3_chinese_dpc; + hf_opc_string = &hf_mtp3_chinese_opc; + } + /* Create the Routing Label Tree */ label_item = proto_tree_add_text(mtp3_tree, tvb, ANSI_ROUTING_LABEL_OFFSET, ANSI_ROUTING_LABEL_LENGTH, "Routing label"); label_tree = proto_item_add_subtree(label_item, ett_mtp3_label); - /* SLS */ - if (mtp3_use_ansi_5_bit_sls) - proto_tree_add_item(label_tree, hf_mtp3_ansi_5_bit_sls, tvb, - ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, TRUE); - else - proto_tree_add_item(label_tree, hf_mtp3_ansi_8_bit_sls, tvb, - ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, TRUE); - /* create the DPC tree */ dpc = tvb_get_ntoh24(tvb, ANSI_DPC_OFFSET); snprintf(pc, sizeof(pc), "%d-%d-%d", (dpc & ANSI_NETWORK_MASK), ((dpc & ANSI_CLUSTER_MASK) >> 8), ((dpc & ANSI_MEMBER_MASK) >> 16)); - label_dpc_item = proto_tree_add_string_format(label_tree, hf_mtp3_ansi_dpc, + label_dpc_item = proto_tree_add_string_format(label_tree, *hf_dpc_string, tvb, ANSI_DPC_OFFSET, ANSI_PC_LENGTH, pc, "DPC (%s)", pc); @@ -244,7 +260,7 @@ dissect_mtp3_routing_label(tvbuff_t *tvb, proto_tree *mtp3_tree) snprintf(pc, sizeof(pc), "%d-%d-%d", (opc & ANSI_NETWORK_MASK), ((opc & ANSI_CLUSTER_MASK) >> 8), ((opc & ANSI_MEMBER_MASK) >> 16)); - label_opc_item = proto_tree_add_string_format(label_tree, hf_mtp3_ansi_opc, + label_opc_item = proto_tree_add_string_format(label_tree, *hf_opc_string, tvb, ANSI_OPC_OFFSET, ANSI_PC_LENGTH, pc, "OPC (%s)", pc); @@ -260,6 +276,21 @@ dissect_mtp3_routing_label(tvbuff_t *tvb, proto_tree *mtp3_tree) proto_tree_add_uint(label_opc_tree, hf_mtp3_opc_network,tvb, ANSI_OPC_OFFSET + ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH, opc); + + /* SLS */ + if (mtp3_standard == ANSI_STANDARD) + { + if (mtp3_use_ansi_5_bit_sls) + proto_tree_add_item(label_tree, hf_mtp3_ansi_5_bit_sls, tvb, + ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, TRUE); + else + proto_tree_add_item(label_tree, hf_mtp3_ansi_8_bit_sls, tvb, + ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, TRUE); + } else /* CHINESE_ITU_STANDARD */ { + proto_tree_add_item(label_tree, hf_mtp3_chinese_itu_sls, tvb, + ANSI_SLS_OFFSET, ITU_SLS_LENGTH, FALSE); + } + break; } } @@ -279,6 +310,7 @@ dissect_mtp3_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) payload_tvb = tvb_new_subset(tvb, ITU_MTP_PAYLOAD_OFFSET, -1, -1); break; case ANSI_STANDARD: + case CHINESE_ITU_STANDARD: payload_tvb = tvb_new_subset(tvb, ANSI_MTP_PAYLOAD_OFFSET, -1, -1); break; } @@ -312,6 +344,7 @@ dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ITU_HEADER_LENGTH, TRUE); break; case ANSI_STANDARD: + case CHINESE_ITU_STANDARD: mtp3_item = proto_tree_add_item(tree, proto_mtp3, tvb, 0, ANSI_HEADER_LENGTH, TRUE); break; @@ -357,6 +390,10 @@ proto_register_mtp3(void) { "DPC", "mtp3.ansi_opc", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + { &hf_mtp3_chinese_opc, + { "DPC", "mtp3.chinese_opc", + FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL }}, { &hf_mtp3_opc_network, { "OPC Network", "mtp3.opc.network", FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK, @@ -377,6 +414,10 @@ proto_register_mtp3(void) { "DPC", "mtp3.ansi_dpc", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + { &hf_mtp3_chinese_dpc, + { "DPC", "mtp3.chinese_dpc", + FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL }}, { &hf_mtp3_dpc_network, { "DPC Network", "mtp3.dpc.network", FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK, @@ -400,6 +441,10 @@ proto_register_mtp3(void) { &hf_mtp3_ansi_8_bit_sls, { "Signalling Link Selector", "mtp3.sls", FT_UINT8, BASE_DEC, NULL, ANSI_8BIT_SLS_MASK, + "", HFILL }}, + { &hf_mtp3_chinese_itu_sls, + { "Signalling Link Selector", "mtp3.sls", + FT_UINT8, BASE_DEC, NULL, CHINESE_ITU_SLS_MASK, "", HFILL }} }; @@ -413,8 +458,9 @@ proto_register_mtp3(void) }; static enum_val_t mtp3_options[] = { - { "ITU", ITU_STANDARD }, - { "ANSI", ANSI_STANDARD }, + { "ITU", ITU_STANDARD }, + { "ANSI", ANSI_STANDARD }, + { "Chinese ITU", CHINESE_ITU_STANDARD }, { NULL, 0 } }; diff --git a/packet-mtp3.h b/packet-mtp3.h index 52b9130c5d..950465e9aa 100644 --- a/packet-mtp3.h +++ b/packet-mtp3.h @@ -1,6 +1,6 @@ /* packet-mtp3.h * - * $Id: packet-mtp3.h,v 1.2 2003/01/02 20:44:32 guy Exp $ + * $Id: packet-mtp3.h,v 1.3 2003/04/10 18:52:11 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -23,7 +23,8 @@ typedef enum { ITU_STANDARD = 1, - ANSI_STANDARD = 2 + ANSI_STANDARD = 2, + CHINESE_ITU_STANDARD = 3 } Standard_Type; extern Standard_Type mtp3_standard; diff --git a/packet-mtp3mg.c b/packet-mtp3mg.c index e8a4634c53..da3b12ccb3 100644 --- a/packet-mtp3mg.c +++ b/packet-mtp3mg.c @@ -1,14 +1,16 @@ /* packet-mtp3mg.c * Routines for Message Transfer Part Level 3 Management and Test dissection + * * It is (hopefully) compliant to: * ANSI T1.111.4-1996 * ITU-T Q.704 7/1996 * ITU-T Q.707 7/1996 and ANSI T1.111.7-1996 (for SLT message formats) - * and portions of ITU-T Q.2210 7/1996 (for XCO/XCA message formats) + * portions of ITU-T Q.2210 7/1996 (for XCO/XCA message formats) + * GF 001-9001 (Chinese ITU variant) * * Copyright 2003, Jeff Morriss <jeff.morriss[AT]ulticom.com> * - * $Id: packet-mtp3mg.c,v 1.3 2003/01/31 03:17:46 guy Exp $ + * $Id: packet-mtp3mg.c,v 1.4 2003/04/10 18:52:11 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -363,16 +365,19 @@ static int hf_mtp3mg_tfc_apc_network = -1; static int hf_mtp3mg_tfc_ansi_status = -1; static int hf_mtp3mg_tfc_itu_apc = -1; static int hf_mtp3mg_tfc_itu_status = -1; +static int hf_mtp3mg_tfc_chinese_apc = -1; static int hf_mtp3mg_tfm_ansi_apc = -1; static int hf_mtp3mg_tfm_apc_member = -1; static int hf_mtp3mg_tfm_apc_cluster = -1; static int hf_mtp3mg_tfm_apc_network = -1; static int hf_mtp3mg_tfm_itu_apc = -1; +static int hf_mtp3mg_tfm_chinese_apc = -1; static int hf_mtp3mg_rsm_ansi_apc = -1; static int hf_mtp3mg_rsm_apc_member = -1; static int hf_mtp3mg_rsm_apc_cluster = -1; static int hf_mtp3mg_rsm_apc_network = -1; static int hf_mtp3mg_rsm_itu_apc = -1; +static int hf_mtp3mg_rsm_chinese_apc = -1; static int hf_mtp3mg_mim_ansi_slc = -1; static int hf_mtp3mg_dlc_ansi_slc = -1; static int hf_mtp3mg_dlc_ansi_link = -1; @@ -382,6 +387,7 @@ static int hf_mtp3mg_upu_apc_member = -1; static int hf_mtp3mg_upu_apc_cluster = -1; static int hf_mtp3mg_upu_apc_network = -1; static int hf_mtp3mg_upu_itu_apc = -1; +static int hf_mtp3mg_upu_chinese_apc = -1; static int hf_mtp3mg_upu_user = -1; static int hf_mtp3mg_upu_cause = -1; static int hf_mtp3test_h0 = -1; @@ -424,7 +430,7 @@ dissect_mtp3mg_chm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, COO_LENGTH, TRUE); proto_tree_add_item(tree, hf_mtp3mg_coo_ansi_fsn, tvb, 0, COO_LENGTH, TRUE); - } else { + } else /* ITU_STANDARD and CHINESE_ITU_STANDARD */ { proto_tree_add_item(tree, hf_mtp3mg_coo_itu_fsn, tvb, 0, COO_LENGTH, TRUE); } @@ -438,7 +444,7 @@ dissect_mtp3mg_chm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ANSI_XCO_LENGTH, TRUE); proto_tree_add_item(tree, hf_mtp3mg_xco_ansi_fsn, tvb, 0, ANSI_XCO_LENGTH, TRUE); - } else { + } else /* ITU_STANDARD and CHINESE_ITU_STANDARD */ { proto_tree_add_item(tree, hf_mtp3mg_xco_itu_fsn, tvb, 0, ITU_XCO_LENGTH, TRUE); } @@ -452,7 +458,7 @@ dissect_mtp3mg_chm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ANSI_CBD_LENGTH, TRUE); proto_tree_add_item(tree, hf_mtp3mg_cbd_ansi_cbc, tvb, 0, ANSI_CBD_LENGTH, TRUE); - } else { + } else /* ITU_STANDARD and CHINESE_ITU_STANDARD */ { proto_tree_add_item(tree, hf_mtp3mg_cbd_itu_cbc, tvb, 0, ITU_CBD_LENGTH, TRUE); } @@ -489,14 +495,41 @@ dissect_mtp3mg_ecm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } static void -dissect_mtp3mg_fcm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - guint8 h1) +dissect_mtp3mg_3byte_pc(tvbuff_t *tvb, proto_tree *tree, gint *ett_pc, + int *hf_pc, int *hf_pc_member, int *hf_pc_cluster, + int *hf_pc_network) { guint32 apc; proto_item *apc_item; proto_tree *apc_tree; char pc[ANSI_PC_STRING_LENGTH]; + apc = tvb_get_ntoh24(tvb, 0); + + snprintf(pc, sizeof(pc), "%d-%d-%d", + (apc & ANSI_NETWORK_MASK), + ((apc & ANSI_CLUSTER_MASK) >> 8), + ((apc & ANSI_MEMBER_MASK) >> 16)); + + apc_item = proto_tree_add_string_format(tree, *hf_pc, tvb, 0, + ANSI_PC_LENGTH, pc, + "Affected PC (%s)", pc); + + apc_tree = proto_item_add_subtree(apc_item, *ett_pc); + + proto_tree_add_uint(apc_tree, *hf_pc_member, tvb, + ANSI_MEMBER_OFFSET, ANSI_NCM_LENGTH, apc); + proto_tree_add_uint(apc_tree, *hf_pc_cluster, tvb, + ANSI_CLUSTER_OFFSET, ANSI_NCM_LENGTH, apc); + proto_tree_add_uint(apc_tree, *hf_pc_network, tvb, + ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH, apc); + +} + +static void +dissect_mtp3mg_fcm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + guint8 h1) +{ if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(h1, fcm_h1_message_type_acro_values, "Unknown")); @@ -508,39 +541,40 @@ dissect_mtp3mg_fcm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, break; case FCM_H1_TFC: - if (mtp3_standard == ANSI_STANDARD) - { - apc = tvb_get_ntoh24(tvb, 0); + if (mtp3_standard == ITU_STANDARD) { + + proto_tree_add_item(tree, hf_mtp3mg_tfc_itu_apc, tvb, 0, + ITU_PC_LENGTH, TRUE); + + /* Congestion level is a national option */ + proto_tree_add_item(tree, hf_mtp3mg_tfc_itu_status, tvb, 0, + ITU_TFC_STATUS_LENGTH, TRUE); + - snprintf(pc, sizeof(pc), "%d-%d-%d", - (apc & ANSI_NETWORK_MASK), - ((apc & ANSI_CLUSTER_MASK) >> 8), - ((apc & ANSI_MEMBER_MASK) >> 16)); - apc_item = proto_tree_add_string_format(tree, - hf_mtp3mg_tfc_ansi_apc, - tvb, 0, ANSI_PC_LENGTH, pc, - "Affected PC (%s)", pc); + } else /* ANSI_STANDARD and CHINESE_ITU_STANDARD */ { - apc_tree = proto_item_add_subtree(apc_item, ett_mtp3mg_fcm_apc); + int *hf_apc_string; - proto_tree_add_uint(apc_tree, hf_mtp3mg_tfc_apc_member, tvb, - ANSI_MEMBER_OFFSET, ANSI_NCM_LENGTH, apc); - proto_tree_add_uint(apc_tree, hf_mtp3mg_tfc_apc_cluster, tvb, - ANSI_CLUSTER_OFFSET, ANSI_NCM_LENGTH, apc); - proto_tree_add_uint(apc_tree, hf_mtp3mg_tfc_apc_network, tvb, - ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH, apc); + if (mtp3_standard == ANSI_STANDARD) { + + hf_apc_string = &hf_mtp3mg_tfc_ansi_apc; + + } else /* CHINESE_ITU_STANDARD */ { + + hf_apc_string = &hf_mtp3mg_tfc_chinese_apc; + } + + dissect_mtp3mg_3byte_pc(tvb, tree, &ett_mtp3mg_fcm_apc, + hf_apc_string, + &hf_mtp3mg_tfc_apc_member, + &hf_mtp3mg_tfc_apc_cluster, + &hf_mtp3mg_tfc_apc_network); proto_tree_add_item(tree, hf_mtp3mg_tfc_ansi_status, tvb, ANSI_TFC_STATUS_OFFSET, ANSI_TFC_STATUS_LENGTH, TRUE); - } else { - proto_tree_add_item(tree, hf_mtp3mg_tfc_itu_apc, tvb, 0, - ITU_PC_LENGTH, TRUE); - /* Congestion level is a national option */ - proto_tree_add_item(tree, hf_mtp3mg_tfc_itu_status, tvb, 0, - ITU_TFC_STATUS_LENGTH, TRUE); } break; @@ -553,11 +587,6 @@ static void dissect_mtp3mg_tfm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 h1) { - guint32 apc; - proto_item *apc_item; - proto_tree *apc_tree; - char pc[ANSI_PC_STRING_LENGTH]; - if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(h1, tfm_h1_message_type_acro_values, "Unknown")); @@ -572,32 +601,25 @@ dissect_mtp3mg_tfm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case TFM_H1_TCA: if (mtp3_standard == ANSI_STANDARD) { - apc = tvb_get_ntoh24(tvb, 0); - - snprintf(pc, sizeof(pc), "%d-%d-%d", - (apc & ANSI_NETWORK_MASK), - ((apc & ANSI_CLUSTER_MASK) >> 8), - ((apc & ANSI_MEMBER_MASK) >> 16)); - - apc_item = proto_tree_add_string_format(tree, - hf_mtp3mg_tfm_ansi_apc, - tvb, 0, ANSI_PC_LENGTH, pc, - "Affected PC (%s)", pc); - - apc_tree = proto_item_add_subtree(apc_item, ett_mtp3mg_tfm_apc); - - proto_tree_add_uint(apc_tree, hf_mtp3mg_tfm_apc_member, tvb, - ANSI_MEMBER_OFFSET, ANSI_NCM_LENGTH, apc); - proto_tree_add_uint(apc_tree, hf_mtp3mg_tfm_apc_cluster, tvb, - ANSI_CLUSTER_OFFSET, ANSI_NCM_LENGTH, apc); - proto_tree_add_uint(apc_tree, hf_mtp3mg_tfm_apc_network, tvb, - ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH, apc); - } else { + dissect_mtp3mg_3byte_pc(tvb, tree, &ett_mtp3mg_tfm_apc, + &hf_mtp3mg_tfm_ansi_apc, + &hf_mtp3mg_tfm_apc_member, + &hf_mtp3mg_tfm_apc_cluster, + &hf_mtp3mg_tfm_apc_network); + + } else /* ITU_STANDARD and CHINESE_ITU_STANDARD */ { + if (h1 == TFM_H1_TCP || h1 == TFM_H1_TCR || h1 == TFM_H1_TCA) dissect_mtp3mg_unknown_message(tvb, tree); - else + else if (mtp3_standard == ITU_STANDARD) proto_tree_add_item(tree, hf_mtp3mg_tfm_itu_apc, tvb, 0, ITU_PC_LENGTH, TRUE); + else /* CHINESE_ITU_STANDARD */ + dissect_mtp3mg_3byte_pc(tvb, tree, &ett_mtp3mg_tfm_apc, + &hf_mtp3mg_tfm_chinese_apc, + &hf_mtp3mg_tfm_apc_member, + &hf_mtp3mg_tfm_apc_cluster, + &hf_mtp3mg_tfm_apc_network); } break; @@ -610,11 +632,6 @@ static void dissect_mtp3mg_rsm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 h1) { - guint32 apc; - proto_item *apc_item; - proto_tree *apc_tree; - char pc[ANSI_PC_STRING_LENGTH]; - if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(h1, rsm_h1_message_type_acro_values, "Unknown")); @@ -627,31 +644,27 @@ dissect_mtp3mg_rsm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case RSM_H1_RCR: if (mtp3_standard == ANSI_STANDARD) { - apc = tvb_get_ntoh24(tvb, 0); - - snprintf(pc, sizeof(pc), "%d-%d-%d", - (apc & ANSI_NETWORK_MASK), - ((apc & ANSI_CLUSTER_MASK) >> 8), - ((apc & ANSI_MEMBER_MASK) >> 16)); - - apc_item = proto_tree_add_string_format(tree, - hf_mtp3mg_rsm_ansi_apc, - tvb, 0, ANSI_PC_LENGTH, pc, - "Affected PC (%s)", pc); - - apc_tree = proto_item_add_subtree(apc_item, ett_mtp3mg_rsm_apc); - - proto_tree_add_uint(apc_tree, hf_mtp3mg_rsm_apc_member, tvb, - ANSI_MEMBER_OFFSET, ANSI_NCM_LENGTH, apc); - proto_tree_add_uint(apc_tree, hf_mtp3mg_rsm_apc_cluster, tvb, - ANSI_CLUSTER_OFFSET, ANSI_NCM_LENGTH, apc); - proto_tree_add_uint(apc_tree, hf_mtp3mg_rsm_apc_network, tvb, - ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH, apc); - } else { + dissect_mtp3mg_3byte_pc(tvb, tree, &ett_mtp3mg_rsm_apc, + &hf_mtp3mg_rsm_ansi_apc, + &hf_mtp3mg_rsm_apc_member, + &hf_mtp3mg_rsm_apc_cluster, + &hf_mtp3mg_rsm_apc_network); + + } else /* ITU_STANDARD and CHINESE_ITU_STANDARD */ { + if (h1 == RSM_H1_RST || h1 == RSM_H1_RSR) - proto_tree_add_item(tree, hf_mtp3mg_rsm_itu_apc, tvb, 0, - ITU_PC_LENGTH, TRUE); - else + { + if (mtp3_standard == ITU_STANDARD) + proto_tree_add_item(tree, hf_mtp3mg_rsm_itu_apc, tvb, 0, + ITU_PC_LENGTH, TRUE); + + else /* CHINESE_ITU_STANDARD */ + dissect_mtp3mg_3byte_pc(tvb, tree, &ett_mtp3mg_rsm_apc, + &hf_mtp3mg_rsm_chinese_apc, + &hf_mtp3mg_rsm_apc_member, + &hf_mtp3mg_rsm_apc_cluster, + &hf_mtp3mg_rsm_apc_network); + } else dissect_mtp3mg_unknown_message(tvb, tree); } break; @@ -733,7 +746,7 @@ dissect_mtp3mg_dlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ANSI_DLC_LENGTH, TRUE); proto_tree_add_item(tree, hf_mtp3mg_dlc_ansi_link, tvb, 0, ANSI_DLC_LENGTH, TRUE); - } else { + } else /* ITU_STANDARD and CHINESE_ITU_STANDARD */ { proto_tree_add_item(tree, hf_mtp3mg_dlc_itu_link, tvb, 0, ITU_DLC_LENGTH, TRUE); } @@ -753,11 +766,6 @@ static void dissect_mtp3mg_ufc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 h1) { - guint32 apc; - proto_item *apc_item; - proto_tree *apc_tree; - char pc[ANSI_PC_STRING_LENGTH]; - if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(h1, ufc_h1_message_type_acro_values, "Unknown")); @@ -765,34 +773,27 @@ dissect_mtp3mg_ufc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, switch (h1) { case UFC_H1_UPU: - if (mtp3_standard == ANSI_STANDARD) + if (mtp3_standard == ANSI_STANDARD + || mtp3_standard == CHINESE_ITU_STANDARD) { - apc = tvb_get_ntoh24(tvb, 0); - - snprintf(pc, sizeof(pc), "%d-%d-%d", - (apc & ANSI_NETWORK_MASK), - ((apc & ANSI_CLUSTER_MASK) >> 8), - ((apc & ANSI_MEMBER_MASK) >> 16)); - - apc_item = proto_tree_add_string_format(tree, - hf_mtp3mg_upu_ansi_apc, - tvb, 0, ANSI_PC_LENGTH, pc, - "Affected PC (%s)", pc); + int *hf_apc; - apc_tree = proto_item_add_subtree(apc_item, ett_mtp3mg_upu_apc); + if (mtp3_standard == ANSI_STANDARD) + hf_apc = &hf_mtp3mg_upu_ansi_apc; + else /* CHINESE_ITU_STANDARD */ + hf_apc = &hf_mtp3mg_upu_chinese_apc; - proto_tree_add_uint(apc_tree, hf_mtp3mg_upu_apc_member, tvb, - ANSI_MEMBER_OFFSET, ANSI_NCM_LENGTH, apc); - proto_tree_add_uint(apc_tree, hf_mtp3mg_upu_apc_cluster, tvb, - ANSI_CLUSTER_OFFSET, ANSI_NCM_LENGTH, apc); - proto_tree_add_uint(apc_tree, hf_mtp3mg_upu_apc_network, tvb, - ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH, apc); + dissect_mtp3mg_3byte_pc(tvb, tree, &ett_mtp3mg_upu_apc, + hf_apc, + &hf_mtp3mg_rsm_apc_member, + &hf_mtp3mg_rsm_apc_cluster, + &hf_mtp3mg_rsm_apc_network); proto_tree_add_item(tree, hf_mtp3mg_upu_user, tvb, ANSI_UPU_USER_OFFSET, UPU_USER_LENGTH, TRUE); proto_tree_add_item(tree, hf_mtp3mg_upu_cause, tvb, ANSI_UPU_USER_OFFSET, UPU_USER_LENGTH, TRUE); - } else { + } else /* ITU_STANDARD */ { proto_tree_add_item(tree, hf_mtp3mg_upu_itu_apc, tvb, 0, ITU_PC_LENGTH, TRUE); proto_tree_add_item(tree, hf_mtp3mg_upu_user, tvb, @@ -1071,6 +1072,10 @@ proto_register_mtp3mg(void) { "Status", "mtp3mg.status", FT_UINT8, BASE_DEC, NULL, ITU_TFC_STATUS_MASK, "Congestion status", HFILL }}, + { &hf_mtp3mg_tfc_chinese_apc, + { "Affected Point Code", "mtp3mg.chinese_apc", + FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL }}, { &hf_mtp3mg_tfm_ansi_apc, { "Affected Point Code", "mtp3mg.ansi_apc", FT_STRING, BASE_NONE, NULL, 0x0, @@ -1091,6 +1096,10 @@ proto_register_mtp3mg(void) { "Affected Point Code (ITU)", "mtp3mg.apc", FT_UINT8, BASE_DEC, NULL, ITU_PC_MASK, "", HFILL }}, + { &hf_mtp3mg_tfm_chinese_apc, + { "Affected Point Code", "mtp3mg.chinese_apc", + FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL }}, { &hf_mtp3mg_rsm_ansi_apc, { "Affected Point Code", "mtp3mg.ansi_apc", FT_STRING, BASE_NONE, NULL, 0x0, @@ -1111,6 +1120,10 @@ proto_register_mtp3mg(void) { "Affected Point Code (ITU)", "mtp3mg.apc", FT_UINT8, BASE_DEC, NULL, ITU_PC_MASK, "", HFILL }}, + { &hf_mtp3mg_rsm_chinese_apc, + { "Affected Point Code", "mtp3mg.chinese_apc", + FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL }}, { &hf_mtp3mg_mim_ansi_slc, { "Signalling Link Code", "mtp3mg.slc", FT_UINT8, BASE_DEC, NULL, ANSI_MIM_SLC_MASK, @@ -1147,6 +1160,10 @@ proto_register_mtp3mg(void) { "Affected Point Code", "mtp3mg.apc", FT_UINT8, BASE_DEC, NULL, ITU_PC_MASK, "", HFILL }}, + { &hf_mtp3mg_upu_chinese_apc, + { "Affected Point Code", "mtp3mg.chinese_apc", + FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL }}, { &hf_mtp3mg_upu_user, { "User", "mtp3mg.user", FT_UINT8, BASE_HEX, VALS(service_indicator_code_vals), UPU_USER_MASK, diff --git a/packet-sccp.c b/packet-sccp.c index 9a2223fa86..8abc09d28b 100644 --- a/packet-sccp.c +++ b/packet-sccp.c @@ -1,12 +1,14 @@ /* packet-sccp.c * Routines for Signalling Connection Control Part (SCCP) dissection + * * It is hopefully compliant to: * ANSI T1.112.3-1996 * ITU-T Q.713 7/1996 + * YDN 038-1997 (Chinese ITU variant) * * Copyright 2002, Jeff Morriss <jeff.morriss[AT]ulticom.com> * - * $Id: packet-sccp.c,v 1.8 2003/03/21 23:05:25 guy Exp $ + * $Id: packet-sccp.c,v 1.9 2003/04/10 18:52:11 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -571,6 +573,7 @@ static int hf_sccp_called_pc_member = -1; static int hf_sccp_called_pc_cluster = -1; static int hf_sccp_called_pc_network = -1; static int hf_sccp_called_ansi_pc = -1; +static int hf_sccp_called_chinese_pc = -1; static int hf_sccp_called_itu_pc = -1; static int hf_sccp_called_gt_nai = -1; static int hf_sccp_called_gt_oe = -1; @@ -593,6 +596,7 @@ static int hf_sccp_calling_pc_member = -1; static int hf_sccp_calling_pc_cluster = -1; static int hf_sccp_calling_pc_network = -1; static int hf_sccp_calling_ansi_pc = -1; +static int hf_sccp_calling_chinese_pc = -1; static int hf_sccp_calling_itu_pc = -1; static int hf_sccp_calling_gt_nai = -1; static int hf_sccp_calling_gt_oe = -1; @@ -819,6 +823,59 @@ dissect_sccp_global_title(tvbuff_t *tvb, proto_tree *tree, guint8 length, called); } +static int +dissect_sccp_3byte_pc(tvbuff_t *tvb, proto_tree *call_tree, guint8 offset, + gboolean called) +{ + guint32 dpc; + proto_item *call_pc_item = 0; + proto_tree *call_pc_tree = 0; + char pc[ANSI_PC_STRING_LENGTH]; + int *hf_pc; + + if (mtp3_standard == ANSI_STANDARD) + { + if (called) + hf_pc = &hf_sccp_called_ansi_pc; + else + hf_pc = &hf_sccp_calling_ansi_pc; + } else /* CHINESE_ITU_STANDARD */ { + if (called) + hf_pc = &hf_sccp_called_chinese_pc; + else + hf_pc = &hf_sccp_calling_chinese_pc; + } + + /* create the DPC tree; modified from that in packet-mtp3.c */ + dpc = tvb_get_ntoh24(tvb, offset); + snprintf(pc, sizeof(pc), "%d-%d-%d", (dpc & ANSI_NETWORK_MASK), + ((dpc & ANSI_CLUSTER_MASK) >> 8), + ((dpc & ANSI_MEMBER_MASK) >> 16)); + + call_pc_item = proto_tree_add_string_format(call_tree, *hf_pc, + tvb, offset, ANSI_PC_LENGTH, + pc, "PC (%s)", pc); + + call_pc_tree = proto_item_add_subtree(call_pc_item, + called ? ett_sccp_called_pc + : ett_sccp_calling_pc); + + proto_tree_add_uint(call_pc_tree, called ? hf_sccp_called_pc_member + : hf_sccp_calling_pc_member, + tvb, offset, ANSI_NCM_LENGTH, dpc); + offset += ANSI_NCM_LENGTH; + proto_tree_add_uint(call_pc_tree, called ? hf_sccp_called_pc_cluster + : hf_sccp_calling_pc_cluster, + tvb, offset, ANSI_NCM_LENGTH, dpc); + offset += ANSI_NCM_LENGTH; + proto_tree_add_uint(call_pc_tree, called ? hf_sccp_called_pc_network + : hf_sccp_calling_pc_network, + tvb, offset, ANSI_NCM_LENGTH, dpc); + offset += ANSI_NCM_LENGTH; + + return(offset); +} + /* FUNCTION dissect_sccp_called_calling_param(): * Dissect the Calling or Called Party Address parameters. * @@ -837,13 +894,12 @@ static void dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, guint8 length, gboolean called) { - proto_item *call_item = 0, *call_ai_item = 0, *call_pc_item = 0; - proto_tree *call_tree = 0, *call_ai_tree = 0, *call_pc_tree = 0; + proto_item *call_item = 0, *call_ai_item = 0; + proto_tree *call_tree = 0, *call_ai_tree = 0; guint8 offset; guint8 national = -1, routing_ind, gti, pci, ssni, ssn; guint32 dpc; tvbuff_t *gt_tvb; - char pc[ANSI_PC_STRING_LENGTH]; call_item = proto_tree_add_text(tree, tvb, 0, length, "%s Party address (%u byte%s)", @@ -873,7 +929,9 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, gti = tvb_get_guint8(tvb, 0) & GTI_MASK; - if (mtp3_standard == ITU_STANDARD || national == 0) { + if (mtp3_standard == ITU_STANDARD || + mtp3_standard == CHINESE_ITU_STANDARD || + national == 0) { proto_tree_add_uint(call_ai_tree, called ? hf_sccp_called_itu_global_title_indicator : hf_sccp_called_itu_global_title_indicator, @@ -893,11 +951,20 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, /* Dissect PC (if present) */ if (pci) { - dpc = tvb_get_letohs(tvb, offset) & ITU_PC_MASK; - proto_tree_add_uint(call_tree, called ? hf_sccp_called_itu_pc - : hf_sccp_calling_itu_pc, - tvb, offset, ITU_PC_LENGTH, dpc); - offset += ITU_PC_LENGTH; + if (mtp3_standard == ITU_STANDARD) + { + + dpc = tvb_get_letohs(tvb, offset) & ITU_PC_MASK; + proto_tree_add_uint(call_tree, called ? hf_sccp_called_itu_pc + : hf_sccp_calling_itu_pc, + tvb, offset, ITU_PC_LENGTH, dpc); + offset += ITU_PC_LENGTH; + + } else /* CHINESE_ITU_STANDARD */ { + + offset = dissect_sccp_3byte_pc(tvb, call_tree, offset, called); + + } } /* Dissect SSN (if present) */ @@ -970,34 +1037,7 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, /* Dissect PC (if present) */ if (pci) { - /* create the DPC tree; modified from that in packet-mtp3.c */ - dpc = tvb_get_ntoh24(tvb, offset); - snprintf(pc, sizeof(pc), "%d-%d-%d", (dpc & ANSI_NETWORK_MASK), - ((dpc & ANSI_CLUSTER_MASK) >> 8), - ((dpc & ANSI_MEMBER_MASK) >> 16)); - - call_pc_item = proto_tree_add_string_format(call_tree, - called ? hf_sccp_called_ansi_pc - : hf_sccp_calling_ansi_pc, - tvb, offset, ANSI_PC_LENGTH, - pc, "PC (%s)", pc); - - call_pc_tree = proto_item_add_subtree(call_pc_item, - called ? ett_sccp_called_pc - : ett_sccp_calling_pc); - - proto_tree_add_uint(call_pc_tree, called ? hf_sccp_called_pc_member - : hf_sccp_calling_pc_member, - tvb, offset, ANSI_NCM_LENGTH, dpc); - offset += ANSI_NCM_LENGTH; - proto_tree_add_uint(call_pc_tree, called ? hf_sccp_called_pc_cluster - : hf_sccp_calling_pc_cluster, - tvb, offset, ANSI_NCM_LENGTH, dpc); - offset += ANSI_NCM_LENGTH; - proto_tree_add_uint(call_pc_tree, called ? hf_sccp_called_pc_network - : hf_sccp_calling_pc_network, - tvb, offset, ANSI_NCM_LENGTH, dpc); - offset += ANSI_NCM_LENGTH; + offset = dissect_sccp_3byte_pc(tvb, call_tree, offset, called); } /* Dissect GT (if present) */ @@ -1366,7 +1406,7 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case PARAMETER_IMPORTANCE: - if (mtp3_standard == ITU_STANDARD) + if (mtp3_standard != ANSI_STANDARD) dissect_sccp_importance_param(parameter_tvb, sccp_tree, parameter_length); else dissect_sccp_unknown_param(parameter_tvb, sccp_tree, parameter_type, @@ -1374,7 +1414,7 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case PARAMETER_LONG_DATA: - if (mtp3_standard == ITU_STANDARD) + if (mtp3_standard != ANSI_STANDARD) dissect_sccp_data_param(parameter_tvb, pinfo, sccp_tree, tree); else dissect_sccp_unknown_param(parameter_tvb, sccp_tree, parameter_type, @@ -1382,11 +1422,11 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case PARAMETER_ISNI: - if (mtp3_standard == ANSI_STANDARD) - dissect_sccp_isni_param(parameter_tvb, sccp_tree, parameter_length); - else + if (mtp3_standard != ANSI_STANDARD) dissect_sccp_unknown_param(parameter_tvb, sccp_tree, parameter_type, parameter_length); + else + dissect_sccp_isni_param(parameter_tvb, sccp_tree, parameter_length); break; default: @@ -1783,7 +1823,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case MESSAGE_TYPE_LUDT: - if (mtp3_standard == ITU_STANDARD) + if (mtp3_standard != ANSI_STANDARD) { offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, @@ -1810,7 +1850,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case MESSAGE_TYPE_LUDTS: - if (mtp3_standard == ITU_STANDARD) + if (mtp3_standard != ANSI_STANDARD) { offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RETURN_CAUSE, offset, @@ -1948,6 +1988,10 @@ proto_register_sccp(void) { "PC", "sccp.called.ansi_pc", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}}, + { &hf_sccp_called_chinese_pc, + { "PC", "sccp.called.chinese_pc", + FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL}}, { &hf_sccp_called_pc_network, { "PC Network", "sccp.called.network", @@ -2038,6 +2082,10 @@ proto_register_sccp(void) { "PC", "sccp.calling.ansi_pc", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}}, + { &hf_sccp_calling_chinese_pc, + { "PC", "sccp.calling.chinese_pc", + FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL}}, { &hf_sccp_calling_pc_network, { "PC Network", "sccp.calling.network", diff --git a/packet-sccpmg.c b/packet-sccpmg.c index 8bb0a4636f..6a425c209a 100755 --- a/packet-sccpmg.c +++ b/packet-sccpmg.c @@ -1,12 +1,14 @@ /* packet-sccp.c * Routines for Signalling Connection Control Part (SCCP) Management dissection + * * It is hopefully compliant to: * ANSI T1.112.3-1996 * ITU-T Q.713 7/1996 + * YDN 038-1997 (Chinese ITU variant) * * Copyright 2002, Jeff Morriss <jeff.morriss[AT]ulticom.com> * - * $Id: packet-sccpmg.c,v 1.2 2003/01/02 20:44:32 guy Exp $ + * $Id: packet-sccpmg.c,v 1.3 2003/04/10 18:52:15 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -103,6 +105,7 @@ static const value_string sccpmg_message_type_acro_values[] = { #define ITU_SCCPMG_CONGESTION_OFFSET (ITU_SCCPMG_SMI_OFFSET + SCCPMG_SMI_LENGTH) #define ITU_SCCPMG_CONGESTION_LENGTH 1 #define ITU_SCCPMG_CONGESTION_MASK 0x0f +#define CHINESE_ITU_SCCPMG_CONGESTION_OFFSET (ANSI_SCCPMG_SMI_OFFSET + SCCPMG_SMI_LENGTH) #define SCCPMG_SSN_LENGTH 1 @@ -112,6 +115,7 @@ static int hf_sccpmg_message_type = -1; static int hf_sccpmg_affected_ssn = -1; static int hf_sccpmg_affected_pc = -1; static int hf_sccpmg_affected_ansi_pc = -1; +static int hf_sccpmg_affected_chinese_pc = -1; static int hf_sccpmg_affected_pc_member = -1; static int hf_sccpmg_affected_pc_cluster = -1; static int hf_sccpmg_affected_pc_network = -1; @@ -154,7 +158,16 @@ dissect_sccpmg_affected_pc(tvbuff_t *tvb, proto_tree *sccpmg_tree) if (mtp3_standard == ITU_STANDARD) { proto_tree_add_item(sccpmg_tree, hf_sccpmg_affected_pc, tvb, offset, ITU_PC_LENGTH, TRUE); - } else if (mtp3_standard == ANSI_STANDARD) { + } else /* ANSI_STANDARD and CHINESE_ITU_STANDARD */ { + int *hf_affected_pc; + + if (mtp3_standard == ANSI_STANDARD) + { + hf_affected_pc = &hf_sccpmg_affected_ansi_pc; + } else /* CHINESE_ITU_STANDARD */ { + hf_affected_pc = &hf_sccpmg_affected_chinese_pc; + } + /* create the DPC tree; modified from that in packet-sccp.c */ dpc = tvb_get_ntoh24(tvb, offset); snprintf(pc, sizeof(pc), "%d-%d-%d", @@ -163,7 +176,7 @@ dissect_sccpmg_affected_pc(tvbuff_t *tvb, proto_tree *sccpmg_tree) ((dpc & ANSI_MEMBER_MASK) >> 16)); pc_item = proto_tree_add_string_format(sccpmg_tree, - hf_sccpmg_affected_ansi_pc, + *hf_affected_pc, tvb, offset, ANSI_PC_LENGTH, pc, "PC (%s)", pc); @@ -189,7 +202,7 @@ dissect_sccpmg_smi(tvbuff_t *tvb, proto_tree *sccpmg_tree) if (mtp3_standard == ITU_STANDARD) offset = ITU_SCCPMG_SMI_OFFSET; - else + else /* ANSI_STANDARD and CHINESE_ITU_STANDARD */ offset = ANSI_SCCPMG_SMI_OFFSET; proto_tree_add_item(sccpmg_tree, hf_sccpmg_smi, tvb, offset, @@ -199,9 +212,15 @@ dissect_sccpmg_smi(tvbuff_t *tvb, proto_tree *sccpmg_tree) static void dissect_sccpmg_congestion_level(tvbuff_t *tvb, proto_tree *sccpmg_tree) { + guint8 offset = 0; + + if (mtp3_standard == CHINESE_ITU_STANDARD) + offset = CHINESE_ITU_SCCPMG_CONGESTION_OFFSET; + else /* ITU_STANDARD */ + offset = ITU_SCCPMG_CONGESTION_OFFSET; + proto_tree_add_item(sccpmg_tree, hf_sccpmg_congestion_level, tvb, - ITU_SCCPMG_CONGESTION_OFFSET, - ITU_SCCPMG_CONGESTION_LENGTH, FALSE); + offset, ITU_SCCPMG_CONGESTION_LENGTH, FALSE); } static void @@ -232,7 +251,7 @@ dissect_sccpmg_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccpmg_tre case SCCPMG_MESSAGE_TYPE_SBR: case SCCPMG_MESSAGE_TYPE_SNR: case SCCPMG_MESSAGE_TYPE_SRT: - if (mtp3_standard == ITU_STANDARD) + if (mtp3_standard != ANSI_STANDARD) { dissect_sccpmg_unknown_message(tvb, sccpmg_tree); break; @@ -249,7 +268,7 @@ dissect_sccpmg_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccpmg_tre break; case SCCPMG_MESSAGE_TYPE_SSC: - if (mtp3_standard == ITU_STANDARD) + if (mtp3_standard != ANSI_STANDARD) { dissect_sccpmg_affected_ssn(tvb, sccpmg_tree); dissect_sccpmg_affected_pc(tvb, sccpmg_tree); @@ -308,6 +327,10 @@ proto_register_sccpmg(void) { "Affected Point Code", "sccpmg.ansi_pc", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}}, + { &hf_sccpmg_affected_chinese_pc, + { "Affected Point Code", "sccpmg.chinese_pc", + FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL}}, { &hf_sccpmg_affected_pc_network, { "Affected PC Network", "sccpmg.network", FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK, |