From 607b0b1048020344ffc46328ff2f4e0b80d70849 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Wed, 20 Jun 2007 21:54:40 +0000 Subject: [PATCH] Add call to the sms dissector for MO-ForwardSM-Arg and MT-ForwardSM-Arg. Use a separate valuestring for forwardSM and sendRoutingInfoForSM. svn path=/trunk/; revision=22146 --- asn1/gsmmap/gsmmap.cnf | 20 +++++++- asn1/gsmmap/packet-gsm_map-template.c | 11 +++-- epan/dissectors/packet-gsm_map.c | 69 +++++++++++++++++---------- epan/dissectors/packet-gsm_sms.c | 53 ++++++++++++++++++-- 4 files changed, 118 insertions(+), 35 deletions(-) diff --git a/asn1/gsmmap/gsmmap.cnf b/asn1/gsmmap/gsmmap.cnf index 70604c9826..e40c772b9f 100644 --- a/asn1/gsmmap/gsmmap.cnf +++ b/asn1/gsmmap/gsmmap.cnf @@ -252,7 +252,7 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; actx->pinfo->p2p_dir = P2P_DIR_RECV; %(DEFAULT_BODY)s - #.FN_BODY SignalInfo VAL_PTR = ¶meter_tvb +#.FN_BODY SignalInfo VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb; %(DEFAULT_BODY)s @@ -267,6 +267,24 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; return offset; dissector_try_port(sms_dissector_table, 0, actx->value_ptr, actx->pinfo, top_tree); +#.FN_BODY MO-ForwardSM-Arg + + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ +%(DEFAULT_BODY)s + + if (!actx->value_ptr) + return offset; + dissector_try_port(sms_dissector_table, 0, actx->value_ptr, actx->pinfo, top_tree); + +#.FN_BODY MT-ForwardSM-Arg + + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ +%(DEFAULT_BODY)s + + if (!actx->value_ptr) + return offset; + dissector_try_port(sms_dissector_table, 0, actx->value_ptr, actx->pinfo, top_tree); + #.FN_BODY SS-Status VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb; diff --git a/asn1/gsmmap/packet-gsm_map-template.c b/asn1/gsmmap/packet-gsm_map-template.c index 0bcdb4dc8e..2ef5b0c005 100644 --- a/asn1/gsmmap/packet-gsm_map-template.c +++ b/asn1/gsmmap/packet-gsm_map-template.c @@ -567,9 +567,10 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr #include "packet-gsm_map-fn.c" /* Specific translation for MAP V3 */ -const value_string gsm_map_V3_opr_code_strings[] = { - { 44, "mt-forwardSM" }, - { 46, "mo-forwardSM" }, +const value_string gsm_map_V1V2_opr_code_strings[] = { + { 44, "forwardSM" }, + { 45, "sendRoutingInfoForSM" }, + { 46, "forwardSM" }, { 0, NULL } }; /* Generic translation for MAP operation */ @@ -780,8 +781,8 @@ const gchar* gsm_map_opr_code(guint32 val) { switch (val) { case 44: /*mt-forwardSM*/ case 46: /*mo-forwardSM*/ - if (application_context_version == 3) { - return val_to_str(val, gsm_map_V3_opr_code_strings, "Unknown GSM-MAP (%u)"); + if (application_context_version < 3) { + return val_to_str(val, gsm_map_V1V2_opr_code_strings, "Unknown GSM-MAP (%u)"); } /* Else use the default map operation translation */ default: diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c index 937b040bd5..f137174eb5 100644 --- a/epan/dissectors/packet-gsm_map.c +++ b/epan/dissectors/packet-gsm_map.c @@ -3251,7 +3251,7 @@ dissect_gsm_map_CellGlobalIdOrServiceAreaIdFixedLength(gboolean implicit_tag _U_ int dissect_gsm_map_LAIFixedLength(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 453 "gsmmap.cnf" +#line 471 "gsmmap.cnf" tvbuff_t *parameter_tvb; proto_item *item; @@ -3379,7 +3379,7 @@ dissect_gsm_map_EMLPP_Info(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_gsm_map_Ext_SS_Status(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 291 "gsmmap.cnf" +#line 309 "gsmmap.cnf" /* Note Ext-SS-Status can have more than one byte */ tvbuff_t *parameter_tvb; @@ -3502,7 +3502,7 @@ dissect_gsm_map_ss_RegisterSS_Arg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int dissect_gsm_map_ss_SS_Status(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 271 "gsmmap.cnf" +#line 289 "gsmmap.cnf" tvbuff_t *parameter_tvb; guint8 octet; @@ -3536,7 +3536,7 @@ dissect_gsm_map_ss_ForwardingOptions(gboolean implicit_tag _U_, tvbuff_t *tvb _U offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); -#line 356 "gsmmap.cnf" +#line 374 "gsmmap.cnf" proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,FALSE); proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,FALSE); @@ -3855,7 +3855,7 @@ dissect_gsm_map_ss_InterrogateSS_Res(gboolean implicit_tag _U_, tvbuff_t *tvb _U int dissect_gsm_map_ss_USSD_DataCodingScheme(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 318 "gsmmap.cnf" +#line 336 "gsmmap.cnf" /*The structure of the USSD-DataCodingScheme is defined by * the Cell Broadcast Data Coding Scheme as described in * TS 3GPP TS 23.038 @@ -3879,7 +3879,7 @@ dissect_gsm_map_ss_USSD_DataCodingScheme(gboolean implicit_tag _U_, tvbuff_t *tv int dissect_gsm_map_ss_USSD_String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 331 "gsmmap.cnf" +#line 349 "gsmmap.cnf" tvbuff_t *parameter_tvb; int length; @@ -5278,9 +5278,19 @@ static const ber_sequence_t MO_ForwardSM_Arg_sequence[] = { static int dissect_gsm_map_sm_MO_ForwardSM_Arg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { +#line 271 "gsmmap.cnf" + + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, MO_ForwardSM_Arg_sequence, hf_index, ett_gsm_map_sm_MO_ForwardSM_Arg); + + if (!actx->value_ptr) + return offset; + dissector_try_port(sms_dissector_table, 0, actx->value_ptr, actx->pinfo, top_tree); + + + return offset; } @@ -5311,9 +5321,19 @@ static const ber_sequence_t MT_ForwardSM_Arg_sequence[] = { static int dissect_gsm_map_sm_MT_ForwardSM_Arg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { +#line 280 "gsmmap.cnf" + + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, MT_ForwardSM_Arg_sequence, hf_index, ett_gsm_map_sm_MT_ForwardSM_Arg); + + if (!actx->value_ptr) + return offset; + dissector_try_port(sms_dissector_table, 0, actx->value_ptr, actx->pinfo, top_tree); + + + return offset; } @@ -6127,7 +6147,7 @@ dissect_gsm_map_ms_VLR_Capability(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int dissect_gsm_map_ms_GSN_Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 413 "gsmmap.cnf" +#line 431 "gsmmap.cnf" tvbuff_t *parameter_tvb; guint8 octet; @@ -6764,7 +6784,7 @@ dissect_gsm_map_ms_UpdateGprsLocationRes(gboolean implicit_tag _U_, tvbuff_t *tv static int dissect_gsm_map_ms_IntegrityProtectionInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 493 "gsmmap.cnf" +#line 511 "gsmmap.cnf" tvbuff_t *parameter_tvb; asn1_ctx_t asn1_ctx; @@ -6787,7 +6807,7 @@ dissect_gsm_map_ms_IntegrityProtectionInformation(gboolean implicit_tag _U_, tvb static int dissect_gsm_map_ms_EncryptionInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 505 "gsmmap.cnf" +#line 523 "gsmmap.cnf" tvbuff_t *parameter_tvb; asn1_ctx_t asn1_ctx; @@ -6872,7 +6892,7 @@ dissect_gsm_map_ms_AllowedUMTS_Algorithms(gboolean implicit_tag _U_, tvbuff_t *t static int dissect_gsm_map_ms_RadioResourceInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 467 "gsmmap.cnf" +#line 485 "gsmmap.cnf" tvbuff_t *parameter_tvb; proto_item *item; proto_tree *subtree; @@ -6945,7 +6965,7 @@ dissect_gsm_map_ms_BSSMAP_ServiceHandover(gboolean implicit_tag _U_, tvbuff_t *t static int dissect_gsm_map_ms_RANAP_ServiceHandover(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 481 "gsmmap.cnf" +#line 499 "gsmmap.cnf" tvbuff_t *parameter_tvb; asn1_ctx_t asn1_ctx; @@ -7679,7 +7699,7 @@ static int dissect_gsm_map_ms_T_forwardingOptions(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_gsm_map_ms_Ext_ForwOptions(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 362 "gsmmap.cnf" +#line 380 "gsmmap.cnf" proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,FALSE); proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,FALSE); @@ -8874,7 +8894,7 @@ dissect_gsm_map_ms_ContextId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_gsm_map_ms_PDP_Type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 370 "gsmmap.cnf" +#line 388 "gsmmap.cnf" guint8 pdp_type_org; tvbuff_t *parameter_tvb; @@ -8917,7 +8937,7 @@ dissect_gsm_map_ms_PDP_Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int int dissect_gsm_map_ms_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 392 "gsmmap.cnf" +#line 410 "gsmmap.cnf" tvbuff_t *parameter_tvb; @@ -8949,7 +8969,7 @@ dissect_gsm_map_ms_APN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset int dissect_gsm_map_ms_Ext_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 403 "gsmmap.cnf" +#line 421 "gsmmap.cnf" tvbuff_t *parameter_tvb; @@ -10104,7 +10124,7 @@ dissect_gsm_map_ms_SubscriberState(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int dissect_gsm_map_ms_RAIdentity(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 439 "gsmmap.cnf" +#line 457 "gsmmap.cnf" tvbuff_t *parameter_tvb; proto_item *item; @@ -15095,9 +15115,10 @@ dissect_gsm_ss_LCS_PeriodicLocationCancellationArg(gboolean implicit_tag _U_, tv #line 568 "packet-gsm_map-template.c" /* Specific translation for MAP V3 */ -const value_string gsm_map_V3_opr_code_strings[] = { - { 44, "mt-forwardSM" }, - { 46, "mo-forwardSM" }, +const value_string gsm_map_V1V2_opr_code_strings[] = { + { 44, "forwardSM" }, + { 45, "sendRoutingInfoForSM" }, + { 46, "forwardSM" }, { 0, NULL } }; /* Generic translation for MAP operation */ @@ -15308,8 +15329,8 @@ const gchar* gsm_map_opr_code(guint32 val) { switch (val) { case 44: /*mt-forwardSM*/ case 46: /*mo-forwardSM*/ - if (application_context_version == 3) { - return val_to_str(val, gsm_map_V3_opr_code_strings, "Unknown GSM-MAP (%u)"); + if (application_context_version < 3) { + return val_to_str(val, gsm_map_V1V2_opr_code_strings, "Unknown GSM-MAP (%u)"); } /* Else use the default map operation translation */ default: @@ -21601,7 +21622,7 @@ void proto_register_gsm_map(void) { "gsm_map_lcs.LCS_QoS", HFILL }}, /*--- End of included file: packet-gsm_map-hfarr.c ---*/ -#line 2402 "packet-gsm_map-template.c" +#line 2403 "packet-gsm_map-template.c" }; /* List of subtrees */ @@ -22178,7 +22199,7 @@ void proto_register_gsm_map(void) { /*--- End of included file: packet-gsm_map-ettarr.c ---*/ -#line 2424 "packet-gsm_map-template.c" +#line 2425 "packet-gsm_map-template.c" }; /* Register protocol */ @@ -22250,7 +22271,7 @@ void proto_register_gsm_map(void) { /*--- End of included file: packet-gsm_map-dis-tab.c ---*/ -#line 2442 "packet-gsm_map-template.c" +#line 2443 "packet-gsm_map-template.c" add_oid_str_name("1.2.826.0.1249.58.1.0","iso(1) member-body(2) bsi(826) disc(0) ericsson(1249) gsmNetworkApplicationsDefinition(58) gsm-Map(1) gsm-Map-Ext(0)" ); add_oid_str_name("1.3.12.2.1107.3.66.1.2","accessTypeNotAllowed-id" ); /*add_oid_str_name("0.4.0.0.1.0.1.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkLocUp(1) version3(3)" ); diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c index 406aa7f85e..ca8ef12007 100644 --- a/epan/dissectors/packet-gsm_sms.c +++ b/epan/dissectors/packet-gsm_sms.c @@ -59,7 +59,6 @@ #include "packet-gsm_sms.h" - /* PROTOTYPES/FORWARDS */ #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \ @@ -118,6 +117,9 @@ static gint ett_udh = -1; /* Initialize the protocol and registered fields */ static int proto_gsm_sms = -1; +static gint hf_gsm_sms_coding_group_bits2 = -1; +static gint hf_gsm_sms_coding_group_bits4 = -1; + static char bigbuf[1024]; static dissector_handle_t data_handle; static packet_info *g_pinfo; @@ -510,6 +512,34 @@ dis_field_pid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint8 oct) break; } } +/* 3GPP TS 23.038 version 7.0.0 Release 7 + * The TP-Data-Coding-Scheme field, defined in 3GPP TS 23.040 [4], + * indicates the data coding scheme of the TP-UD field, and may indicate a message class. + * Any reserved codings shall be assumed to be the GSM 7 bit default alphabet + * (the same as codepoint 00000000) by a receiving entity. + * The octet is used according to a coding group which is indicated in bits 7..4. + */ + +/* Coding Group Bits */ +static const value_string gsm_sms_coding_group_bits_vals[] = { + { 0, "General Data Coding indication" }, /* 00xx */ + { 1, "General Data Coding indication" }, /* 00xx */ + { 2, "General Data Coding indication" }, /* 00xx */ + { 3, "General Data Coding indication" }, /* 00xx */ + { 4, "Message Marked for Automatic Deletion Group" }, /* 01xx */ + { 5, "Message Marked for Automatic Deletion Group" }, /* 01xx */ + { 6, "Message Marked for Automatic Deletion Group" }, /* 01xx */ + { 7, "Message Marked for Automatic Deletion Group" }, /* 01xx */ + { 8, "Reserved coding groups" }, /* 1000..1011 */ + { 9, "Reserved coding groups" }, /* 1000..1011 */ + { 10, "Reserved coding groups" }, /* 1000..1011 */ + { 11, "Reserved coding groups" }, /* 1000..1011 */ + { 12, "Message Waiting Indication Group: Discard Message" },/* 1100 */ + { 13, "Message Waiting Indication Group: Store Message" }, /* 1101 */ + { 14, "Message Waiting Indication Group: Store Message" }, /* 1110 */ + { 15, "Data coding/message class" }, /* 1111 */ + { 0, NULL }, +}; /* 9.2.3.10 */ static void @@ -537,6 +567,11 @@ dis_field_dcs(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint8 oct, oct); subtree = proto_item_add_subtree(item, ett_dcs); + if(oct&0x80){ + proto_tree_add_item(subtree, hf_gsm_sms_coding_group_bits4, tvb, offset, 1, FALSE); + }else{ + proto_tree_add_item(subtree, hf_gsm_sms_coding_group_bits2, tvb, offset, 1, FALSE); + } if (oct == 0x00) { @@ -2625,12 +2660,21 @@ proto_register_gsm_sms(void) guint i; guint last_offset; -#if 0 + /* Setup list of header fields */ static hf_register_info hf[] = { + { &hf_gsm_sms_coding_group_bits2, + { "Coding Group Bits", "gsm_sms.coding_group_bits2", + FT_UINT8, BASE_DEC, VALS(gsm_sms_coding_group_bits_vals), 0xc0, + "Coding Group Bits", HFILL } + }, + { &hf_gsm_sms_coding_group_bits4, + { "Coding Group Bits", "gsm_sms.coding_group_bits4", + FT_UINT8, BASE_DEC, VALS(gsm_sms_coding_group_bits_vals), 0xf0, + "Coding Group Bits", HFILL } + }, }; -#endif /* Setup protocol subtree array */ #define NUM_INDIVIDUAL_PARMS 12 @@ -2668,9 +2712,8 @@ proto_register_gsm_sms(void) proto_gsm_sms = proto_register_protocol(gsm_sms_proto_name, gsm_sms_proto_name_short, "gsm_sms"); -#if 0 + proto_register_field_array(proto_gsm_sms, hf, array_length(hf)); -#endif proto_register_subtree_array(ett, array_length(ett)); }