diff options
author | Michael Mann <mmann78@netscape.net> | 2015-03-29 10:45:16 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-04-01 04:40:38 +0000 |
commit | e74cb413b474afd416eb25e30e5572b9e775ed3e (patch) | |
tree | 922f556a5b93560ea36963825ce5ea8b10fd5276 /epan/dissectors | |
parent | 752f5de7194c96803a7c350d8b9e67b2203a01bf (diff) | |
download | wireshark-e74cb413b474afd416eb25e30e5572b9e775ed3e.tar.gz wireshark-e74cb413b474afd416eb25e30e5572b9e775ed3e.tar.bz2 wireshark-e74cb413b474afd416eb25e30e5572b9e775ed3e.zip |
Remove proto_tree_add_text from GSM dissectors.
Change-Id: I72a7c1a44bda7755d8b1376dd5e57c46f137ff31
Reviewed-on: https://code.wireshark.org/review/7870
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-gsm_a_common.c | 238 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_a_dtap.c | 324 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_a_gm.c | 623 |
3 files changed, 591 insertions, 594 deletions
diff --git a/epan/dissectors/packet-gsm_a_common.c b/epan/dissectors/packet-gsm_a_common.c index aa33ce048d..b695b26e48 100644 --- a/epan/dissectors/packet-gsm_a_common.c +++ b/epan/dissectors/packet-gsm_a_common.c @@ -550,6 +550,7 @@ static int proto_a_common = -1; int gsm_a_tap = -1; int hf_gsm_a_common_elem_id = -1; +static int hf_gsm_a_common_elem_id_f0 = -1; static int hf_gsm_a_l_ext = -1; int hf_gsm_a_tmsi = -1; static int hf_gsm_a_imei = -1; @@ -586,6 +587,7 @@ static int hf_gsm_a_mbs_ses_id_ind = -1; static int hf_gsm_a_mbs_service_id = -1; static int hf_gsm_a_mbs_session_id = -1; static int hf_gsm_a_length = -1; +static int hf_gsm_a_element_value = -1; int hf_gsm_a_extension = -1; int hf_gsm_a_L3_protocol_discriminator = -1; int hf_gsm_a_call_prio = -1; @@ -730,9 +732,27 @@ static int hf_gsm_a_geo_loc_uncertainty_radius = -1; static int hf_gsm_a_geo_loc_offset_angle = -1; static int hf_gsm_a_geo_loc_included_angle = -1; +/* Generated from convert_proto_tree_add_text.pl */ +static int hf_gsm_a_filler = -1; +static int hf_gsm_a_identity_digit1 = -1; +static int hf_gsm_a_group_call_reference = -1; +static int hf_gsm_a_service_flag = -1; +static int hf_gsm_a_af_acknowledgement = -1; +static int hf_gsm_a_call_priority = -1; +static int hf_gsm_a_ciphering_info = -1; +static int hf_gsm_a_sapi = -1; +static int hf_gsm_a_mobile_country_code = -1; +static int hf_gsm_a_mobile_network_code = -1; + +static int ett_gsm_a_plmn = -1; + static expert_field ei_gsm_a_extraneous_data = EI_INIT; static expert_field ei_gsm_a_unknown_element = EI_INIT; static expert_field ei_gsm_a_unknown_pdu_type = EI_INIT; +static expert_field ei_gsm_a_no_element_dissector = EI_INIT; +static expert_field ei_gsm_a_format_not_supported = EI_INIT; +static expert_field ei_gsm_a_mobile_identity_type = EI_INIT; + static char a_bigbuf[1024]; @@ -1270,9 +1290,7 @@ guint16 elem_tlv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint8 iei { if (elem_funcs[idx] == NULL) { - proto_tree_add_text(subtree, - tvb, curr_offset + 1 + lengt_length, parm_len, - "Element Value"); + proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 1 + lengt_length, parm_len, ENC_NA); /* See ASSERT above */ consumed = (guint8)parm_len; } @@ -1364,9 +1382,7 @@ guint16 elem_telv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint8 ie { if (elem_funcs[idx] == NULL) { - proto_tree_add_text(subtree, - tvb, curr_offset + 1 + lengt_length, parm_len, - "Element Value"); + proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 1 + lengt_length, parm_len, ENC_NA); /* See ASSERT above */ consumed = parm_len; } @@ -1446,9 +1462,7 @@ guint16 elem_tlv_e(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint8 i { if (elem_funcs[idx] == NULL) { - proto_tree_add_text(subtree, - tvb, curr_offset + 1 + 2, parm_len, - "Element Value"); + proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 1 + 2, parm_len, ENC_NA); /* See ASSERT above */ consumed = parm_len; } @@ -1522,10 +1536,7 @@ guint16 elem_tv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint8 iei, if (elem_funcs[idx] == NULL) { /* BAD THING, CANNOT DETERMINE LENGTH */ - - proto_tree_add_text(subtree, - tvb, curr_offset + 1, 1, - "No element dissector, rest of dissection may be incorrect"); + expert_add_info(pinfo, item, &ei_gsm_a_no_element_dissector); consumed = 1; } @@ -1569,7 +1580,6 @@ guint16 elem_tv_short(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint gint *elem_ett; const gchar *elem_name; guint16 (**elem_funcs)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len); - char buf[10+1]; curr_offset = offset; consumed = 0; @@ -1593,19 +1603,13 @@ guint16 elem_tv_short(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, -1, elem_ett[idx], &item, "%s%s", elem_name, (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add); - other_decode_bitfield_value(buf, oct, 0xf0, 8); - proto_tree_add_text(subtree, - tvb, curr_offset, 1, - "%s = Element ID: 0x%1x-", - buf, oct>>4); + proto_tree_add_item(subtree, hf_gsm_a_common_elem_id_f0, tvb, curr_offset, 1, ENC_NA); if (elem_funcs[idx] == NULL) { /* BAD THING, CANNOT DETERMINE LENGTH */ - proto_tree_add_text(subtree, - tvb, curr_offset, 1, - "No element dissector, rest of dissection may be incorrect"); + expert_add_info(pinfo, item, &ei_gsm_a_no_element_dissector); consumed++; } @@ -1709,9 +1713,7 @@ elem_lv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint pdu_type, int { if (elem_funcs[idx] == NULL) { - proto_tree_add_text(subtree, - tvb, curr_offset + 1, parm_len, - "Element Value"); + proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 1, parm_len, ENC_NA); consumed = parm_len; } @@ -1777,9 +1779,7 @@ guint16 elem_lv_e(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint pdu_ { if (elem_funcs[idx] == NULL) { - proto_tree_add_text(subtree, - tvb, curr_offset + 2, parm_len, - "Element Value"); + proto_tree_add_item(subtree, hf_gsm_a_element_value, tvb, curr_offset + 2, parm_len, ENC_NA); consumed = parm_len; } @@ -1829,10 +1829,7 @@ guint16 elem_v(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint pdu_typ if (elem_name == NULL || elem_funcs[idx] == NULL) { /* BAD THING, CANNOT DETERMINE LENGTH */ - - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "No element dissector, rest of dissection may be incorrect"); + proto_tree_add_expert(tree, pinfo, &ei_gsm_a_no_element_dissector, tvb, curr_offset, 1); consumed = 1; } @@ -2185,6 +2182,7 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin guint32 value; gboolean odd; const gchar *digit_str; + proto_item* ti; curr_offset = offset; @@ -2204,8 +2202,7 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin if (len > 1) { - proto_tree_add_text(tree, tvb, curr_offset, len - 1, - "Format not supported"); + expert_add_info(pinfo, tree, &ei_gsm_a_format_not_supported); } curr_offset += len - 1; @@ -2250,26 +2247,18 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin { oct = tvb_get_guint8(tvb, curr_offset - 1); - other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8); - proto_tree_add_text(tree, - tvb, curr_offset - 1, 1, - "%s = Filler", - a_bigbuf); + proto_tree_add_item(tree, hf_gsm_a_filler, tvb, curr_offset - 1, 1, ENC_NA); } break; case 2: /* IMEI */ - other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8); - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "%s = Identity Digit 1: %c", - a_bigbuf, - Dgt1_9_bcd.out[(oct & 0xf0) >> 4]); + proto_tree_add_uint_format_value(tree, hf_gsm_a_identity_digit1, tvb, curr_offset, 1, oct, "%c", Dgt1_9_bcd.out[(oct & 0xf0) >> 4]); proto_tree_add_item(tree, hf_gsm_a_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN); + /* XXX - dynamically allocate a_bigbuf since the only use is now here */ a_bigbuf[0] = Dgt1_9_bcd.out[(oct & 0xf0) >> 4]; curr_offset++; @@ -2342,9 +2331,8 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin default: /* Reserved */ proto_tree_add_item(tree, hf_gsm_a_odd_even_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_text(tree, tvb, curr_offset, len, - "Mobile station identity Format %u, Format Unknown", (oct & 0x07)); + ti = proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN); + expert_add_info_format(pinfo, ti, &ei_gsm_a_mobile_identity_type, "Unknown format %u", (oct & 0x07)); if (add_string) g_snprintf(add_string, string_len, " - Format Unknown"); @@ -3256,66 +3244,32 @@ guint16 de_spare_nibble(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, /* * [3] 10.5.1.9 Descriptive group or broadcast call reference */ +static const true_false_string tfs_vgcs_vbs = { "VGCS (Group call reference)", "VBS (Broadcast call reference)" }; + +static const value_string gsm_a_call_priority_vals[] = { + { 0, "no priority applied"}, + { 1, "call priority level 4"}, + { 2, "call priority level 3"}, + { 3, "call priority level 2"}, + { 4, "call priority level 1"}, + { 5, "call priority level 0"}, + { 6, "call priority level B"}, + { 7, "call priority level A"}, + { 0, NULL } +}; + guint16 de_d_gb_call_ref(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint8 oct; - guint32 value; - guint32 curr_offset; - const gchar *str; - - curr_offset = offset; - - value = tvb_get_ntohl(tvb, curr_offset); - - other_decode_bitfield_value(a_bigbuf, value, 0xffffffe0, 32); - proto_tree_add_text(tree, tvb, curr_offset, 4, - "%s = Group or Broadcast call reference: %u (0x%04x)", - a_bigbuf, - (value & 0xffffffe0) >> 5, - (value & 0xffffffe0) >> 5); - - other_decode_bitfield_value(a_bigbuf, value, 0x00000010, 32); - proto_tree_add_text(tree, tvb, curr_offset, 4, - "%s = SF Service Flag: %s", - a_bigbuf, - (value & 0x00000010) ? - "VGCS (Group call reference)" : "VBS (Broadcast call reference)"); - - other_decode_bitfield_value(a_bigbuf, value, 0x00000008, 32); - proto_tree_add_text(tree, tvb, curr_offset, 4, - "%s = AF Acknowledgement Flag: acknowledgment is %srequired", - a_bigbuf, - (value & 0x00000008) ? "" : "not "); - - switch (value & 0x00000007) - { - case 1: str = "call priority level 4"; break; - case 2: str = "call priority level 3"; break; - case 3: str = "call priority level 2"; break; - case 4: str = "call priority level 1"; break; - case 5: str = "call priority level 0"; break; - case 6: str = "call priority level B"; break; - case 7: str = "call priority level A"; break; - default: - str = "no priority applied"; - break; - } - - other_decode_bitfield_value(a_bigbuf, value, 0x00000007, 32); - proto_tree_add_text(tree, tvb, curr_offset, 4, - "%s = Call Priority: %s", - a_bigbuf, - str); + guint32 curr_offset = offset; + proto_tree_add_item(tree, hf_gsm_a_group_call_reference, tvb, curr_offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_gsm_a_service_flag, tvb, curr_offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_gsm_a_af_acknowledgement, tvb, curr_offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_gsm_a_call_priority, tvb, curr_offset, 4, ENC_BIG_ENDIAN); curr_offset += 4; - oct = tvb_get_guint8(tvb, curr_offset); - - other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8); - proto_tree_add_text(tree, tvb, curr_offset, 1, - "%s = Ciphering Information", - a_bigbuf); + proto_tree_add_item(tree, hf_gsm_a_ciphering_info, tvb, curr_offset, 1, ENC_NA); proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 4, ENC_BIG_ENDIAN); curr_offset++; @@ -3328,18 +3282,22 @@ de_d_gb_call_ref(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint3 /* * [3] 10.5.1.10a PD and SAPI $(CCBS)$ */ +static const value_string gsm_a_sapi_vals[] = { + { 0, "SAPI 0"}, + { 1, "Reserved"}, + { 2, "Reserved"}, + { 3, "SAPI 3"}, + { 0, NULL } +}; + static guint16 de_pd_sapi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint8 oct; guint32 curr_offset; proto_tree *subtree; - const gchar *str; curr_offset = offset; - oct = tvb_get_guint8(tvb, curr_offset); - subtree = proto_tree_add_subtree(tree, tvb, curr_offset, 1, ett_gsm_dtap_elem[DE_PD_SAPI], NULL, @@ -3347,20 +3305,7 @@ de_pd_sapi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offs proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, curr_offset<<3, 2, ENC_BIG_ENDIAN); - switch ((oct & 0x30) >> 4) - { - case 0: str = "SAPI 0"; break; - case 3: str = "SAPI 3"; break; - default: - str = "Reserved"; - break; - } - - other_decode_bitfield_value(a_bigbuf, oct, 0x30, 8); - proto_tree_add_text(subtree, tvb, curr_offset, 1, - "%s = SAPI (Service Access Point Identifier): %s", - a_bigbuf, - str); + proto_tree_add_item(subtree, hf_gsm_a_sapi, tvb, curr_offset, 1, ENC_NA); proto_tree_add_item(tree, hf_gsm_a_L3_protocol_discriminator, tvb, curr_offset, 1, ENC_BIG_ENDIAN); @@ -3489,33 +3434,31 @@ de_plmn_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset gchar mcc[4]; gchar mnc[4]; guint8 num_plmn; + proto_tree* subtree; curr_offset = offset; num_plmn = 0; while ((len - (curr_offset - offset)) >= 3) { - octs[0] = tvb_get_guint8(tvb, curr_offset); - octs[1] = tvb_get_guint8(tvb, curr_offset + 1); - octs[2] = tvb_get_guint8(tvb, curr_offset + 2); + octs[0] = tvb_get_guint8(tvb, curr_offset); + octs[1] = tvb_get_guint8(tvb, curr_offset + 1); + octs[2] = tvb_get_guint8(tvb, curr_offset + 2); - mcc_mnc_aux(octs, mcc, mnc); + mcc_mnc_aux(octs, mcc, mnc); - proto_tree_add_text(tree, - tvb, curr_offset, 3, - "PLMN[%u] Mobile Country Code (MCC): %s, Mobile Network Code (MNC): %s", - num_plmn + 1, - mcc, - mnc); + subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, 3, ett_gsm_a_plmn, NULL, "PLMN[%u]", num_plmn + 1); + proto_tree_add_string(subtree, hf_gsm_a_mobile_country_code, tvb, curr_offset, 3, mcc); + proto_tree_add_string(subtree, hf_gsm_a_mobile_network_code, tvb, curr_offset, 3, mnc); - curr_offset += 3; + curr_offset += 3; - num_plmn++; + num_plmn++; } if (add_string) - g_snprintf(add_string, string_len, " - %u PLMN%s", - num_plmn, plurality(num_plmn, "", "s")); + g_snprintf(add_string, string_len, " - %u PLMN%s", + num_plmn, plurality(num_plmn, "", "s")); EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data); @@ -3622,6 +3565,11 @@ proto_register_gsm_a_common(void) FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, + { &hf_gsm_a_common_elem_id_f0, + { "Element ID", "gsm_a.common.elem_id", + FT_UINT8, BASE_HEX, NULL, 0xF0, + NULL, HFILL } + }, { &hf_gsm_a_l_ext, { "ext", "gsm_a.l_ext", FT_UINT8, BASE_DEC, NULL, 0x80, @@ -3792,6 +3740,11 @@ proto_register_gsm_a_common(void) FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, + { &hf_gsm_a_element_value, + { "Element Value", "gsm_a.element_value", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL } + }, { &hf_gsm_a_extension, { "Extension", "gsm_a.extension", FT_BOOLEAN, 8, TFS(&gsm_a_extension_value), 0x80, @@ -4497,10 +4450,21 @@ proto_register_gsm_a_common(void) FT_UINT8, BASE_DEC_HEX, NULL, 0x00, NULL, HFILL } }, + /* Generated from convert_proto_tree_add_text.pl */ + { &hf_gsm_a_filler, { "Filler", "gsm_a.filler", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL }}, + { &hf_gsm_a_identity_digit1, { "Identity Digit 1", "gsm_a.identity_digit1", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL }}, + { &hf_gsm_a_group_call_reference, { "Group or Broadcast call reference", "gsm_a.group_call_reference", FT_UINT32, BASE_DEC_HEX, NULL, 0xffffffe0, NULL, HFILL }}, + { &hf_gsm_a_service_flag, { "SF Service Flag", "gsm_a.service_flag", FT_BOOLEAN, 32, TFS(&tfs_vgcs_vbs), 0x00000010, NULL, HFILL }}, + { &hf_gsm_a_af_acknowledgement, { "AF Acknowledgement", "gsm_a.af_acknowledgement", FT_BOOLEAN, 32, TFS(&tfs_required_not_required), 0x00000008, NULL, HFILL }}, + { &hf_gsm_a_call_priority, { "Call Priority", "gsm_a.call_priority", FT_UINT32, BASE_DEC, VALS(gsm_a_call_priority_vals), 0x00000007, NULL, HFILL }}, + { &hf_gsm_a_ciphering_info, { "Ciphering Information", "gsm_a.ciphering_info", FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL }}, + { &hf_gsm_a_sapi, { "SAPI (Service Access Point Identifier)", "gsm_a.sapi", FT_UINT8, BASE_DEC, VALS(gsm_a_sapi_vals), 0x30, NULL, HFILL }}, + { &hf_gsm_a_mobile_country_code, { "Mobile Country Code (MCC)", "gsm_a.mobile_country_code", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_mobile_network_code, { "Mobile Network Code (MNC)", "gsm_a.mobile_network_code", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ -#define NUM_INDIVIDUAL_ELEMS 0 +#define NUM_INDIVIDUAL_ELEMS 1 static gint *ett[NUM_INDIVIDUAL_ELEMS + NUM_GSM_COMMON_ELEM]; @@ -4508,12 +4472,16 @@ proto_register_gsm_a_common(void) { &ei_gsm_a_extraneous_data, { "gsm_a.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }}, { &ei_gsm_a_unknown_element, { "gsm_a.unknown_element", PI_PROTOCOL, PI_ERROR, "Unknown - aborting dissection", EXPFILL }}, { &ei_gsm_a_unknown_pdu_type, { "gsm_a.unknown_pdu_type", PI_PROTOCOL, PI_WARN, "Unknown PDU type", EXPFILL }}, + { &ei_gsm_a_no_element_dissector, { "gsm_a.no_element_dissector", PI_PROTOCOL, PI_WARN, "No element dissector, rest of dissection may be incorrect", EXPFILL }}, + { &ei_gsm_a_format_not_supported, { "gsm_a.format_not_supported", PI_PROTOCOL, PI_WARN, "Format not supported", EXPFILL }}, + { &ei_gsm_a_mobile_identity_type, { "gsm_a.ie.mobileid.type.unknown", PI_PROTOCOL, PI_WARN, "Format unknown", EXPFILL }}, }; expert_module_t* expert_a_common; last_offset = NUM_INDIVIDUAL_ELEMS; + ett[0] = &ett_gsm_a_plmn; for (i=0; i < NUM_GSM_COMMON_ELEM; i++, last_offset++) { ett_gsm_common_elem[i] = -1; diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index 085664aa2d..2fa89d0a26 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -535,6 +535,7 @@ static int hf_gsm_a_dtap_location = -1; static int hf_gsm_a_dtap_progress_description = -1; static int hf_gsm_a_dtap_afi = -1; static int hf_gsm_a_dtap_rej_cause = -1; +static int hf_gsm_a_dtap_timezone = -1; static int hf_gsm_a_dtap_u2u_prot_discr = -1; static int hf_gsm_a_dtap_mcat = -1; static int hf_gsm_a_dtap_enicm = -1; @@ -591,6 +592,9 @@ static int hf_gsm_a_dtap_multi_party_auxiliary_state = -1; static int hf_gsm_a_dtap_parity_information = -1; static int hf_gsm_a_dtap_channel_coding03 = -1; static int hf_gsm_a_dtap_channel_coding30 = -1; +static int hf_gsm_a_dtap_loop_mechanism0E = -1; +static int hf_gsm_a_dtap_loop_mechanism1C = -1; +static int hf_gsm_a_dtap_multislot_tch = -1; static int hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F43_2 = -1; static int hf_gsm_a_dtap_ue_positioning_technology = -1; static int hf_gsm_a_dtap_acceptable_channel_codings_TCH_F4_8 = -1; @@ -609,6 +613,7 @@ static int hf_gsm_a_dtap_other_itc = -1; static int hf_gsm_a_dtap_negotiation = -1; static int hf_gsm_a_dtap_rate_adaption = -1; static int hf_gsm_a_dtap_ms_positioning_technology = -1; +static int hf_gsm_a_dtap_ue_test_loop_mode = -1; static int hf_gsm_a_dtap_number_of_data_bits = -1; static int hf_gsm_a_dtap_follow_on_request = -1; static int hf_gsm_a_dtap_repeat_indicator = -1; @@ -620,9 +625,13 @@ static int hf_gsm_a_dtap_congestion_level = -1; static int hf_gsm_a_dtap_access_identity = -1; static int hf_gsm_a_dtap_modem_type = -1; static int hf_gsm_a_dtap_test_loop = -1; +static int hf_gsm_a_dtap_subchannel = -1; +static int hf_gsm_a_dtap_ack_element = -1; static int hf_gsm_a_dtap_layer_1_identity = -1; static int hf_gsm_a_dtap_ciphering_key_sequence_number70 = -1; static int hf_gsm_a_dtap_tp_pdu_description = -1; +static int hf_gsm_a_dtap_mode_flag = -1; +static int hf_gsm_a_dtap_egprs_mode_flag = -1; static int hf_gsm_a_dtap_dtmf = -1; static int hf_gsm_a_dtap_coding = -1; static int hf_gsm_a_dtap_nic_on_rx = -1; @@ -660,6 +669,17 @@ static int hf_gsm_a_dtap_time_zone_time = -1; static int hf_gsm_a_dtap_acceptable_channel_codings_spare20 = -1; static int hf_gsm_a_dtap_establishment = -1; static int hf_gsm_a_dtap_duplex_mode = -1; +static int hf_gsm_a_dtap_subaddress = -1; +static int hf_gsm_a_dtap_subaddress_information = -1; +static int hf_gsm_a_dtap_message_elements = -1; +static int hf_gsm_a_dtap_rpdu = -1; +static int hf_gsm_a_dtap_timeslot_number = -1; +static int hf_gsm_a_dtap_uplink_rlc_sdu_size = -1; +static int hf_gsm_a_dtap_radio_bearer = -1; +static int hf_gsm_a_dtap_mbms_short_transmission_identity = -1; +static int hf_gsm_a_dtap_ue_received_rlc_sdu_counter_value = -1; +static int hf_gsm_a_dtap_num_lb_entities = -1; + static int hf_gsm_a_dtap_gcc_call_ref = -1; static int hf_gsm_a_dtap_gcc_call_ref_has_priority = -1; @@ -720,6 +740,7 @@ static gint ett_bc_oct_6g = -1; static gint ett_bc_oct_7 = -1; static gint ett_epc_ue_tl_a_lb_setup = -1; static gint ett_mm_timer = -1; +static gint ett_ue_test_loop_mode = -1; static expert_field ei_gsm_a_dtap_keypad_info_not_dtmf_digit = EI_INIT; static expert_field ei_gsm_a_dtap_text_string_not_multiple_of_7 = EI_INIT; @@ -729,6 +750,8 @@ static expert_field ei_gsm_a_dtap_auts = EI_INIT; static expert_field ei_gsm_a_dtap_end_mark_unexpected = EI_INIT; static expert_field ei_gsm_a_dtap_extraneous_data = EI_INIT; static expert_field ei_gsm_a_dtap_missing_mandatory_element = EI_INIT; +static expert_field ei_gsm_a_dtap_coding_scheme = EI_INIT; + static char a_bigbuf[1024]; @@ -871,12 +894,22 @@ static const value_string gsm_a_dtap_number_of_spare_bits_vals[] = { const true_false_string tfs_add_ci = { "The MS should add the letters for the Country's Initials and a separator (e.g. a space) to the text string", "The MS should not add the letters for the Country's Initials to the text string" }; +static const value_string gsm_a_dtap_coding_scheme_vals[] = { + { 0, "Cell Broadcast data coding scheme, GSM default alphabet, language unspecified, defined in 3GPP TS 23.038"}, + { 1, "UCS2 (16 bit)"}, + { 2, "Reserved"}, + { 3, "Reserved"}, + { 4, "Reserved"}, + { 5, "Reserved"}, + { 6, "Reserved"}, + { 7, "Reserved"}, + { 0, NULL } +}; static guint16 de_network_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) { guint8 oct; guint32 curr_offset; - const gchar *str; guint8 coding_scheme, num_spare_bits; guint32 num_text_bits; gchar *net_name = NULL; @@ -889,16 +922,8 @@ de_network_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off proto_tree_add_item(tree, hf_gsm_a_extension, tvb, curr_offset, 1, ENC_BIG_ENDIAN); coding_scheme = (oct & 0x70) >> 4; - switch (coding_scheme) - { - case 0x00: str = "Cell Broadcast data coding scheme, GSM default alphabet, language unspecified, defined in 3GPP TS 23.038"; break; - case 0x01: str = "UCS2 (16 bit)"; break; - default: - str = "Reserved"; - break; - } + proto_tree_add_item(tree, hf_gsm_a_dtap_coding_scheme, tvb, curr_offset, 1, ENC_NA); - proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_coding_scheme, tvb, curr_offset, 1, oct, "%s", str); proto_tree_add_item(tree, hf_gsm_a_dtap_add_ci, tvb, curr_offset, 1, ENC_NA); num_spare_bits = oct & 0x07; @@ -922,9 +947,7 @@ de_network_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off proto_tree_add_string(tree, hf_gsm_a_dtap_text_string, tvb, curr_offset, len - 1, net_name); break; default: - proto_tree_add_text(tree, - tvb, curr_offset, len - 1, - "Text string encoded according to an unknown Coding Scheme"); + proto_tree_add_expert(tree, pinfo, &ei_gsm_a_dtap_coding_scheme, tvb, curr_offset, len - 1); } return (len); @@ -1019,10 +1042,7 @@ de_time_zone(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 of sign = (oct & 0x08)?'-':'+'; oct = (oct >> 4) + (oct & 0x07) * 10; - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Timezone: GMT %c %d hours %d minutes", - sign, oct / 4, oct % 4 * 15); + proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_timezone, tvb, curr_offset, 1, oct, "GMT %c %d hours %d minutes", sign, oct / 4, oct % 4 * 15); curr_offset++; /* no length check possible */ @@ -1082,10 +1102,7 @@ de_time_zone_time(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint sign = (oct & 0x08)?'-':'+'; oct = (oct >> 4) + (oct & 0x07) * 10; - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Timezone: GMT %c %d hours %d minutes", - sign, oct / 4, oct % 4 * 15); + proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_timezone, tvb, curr_offset, 1, oct, "GMT %c %d hours %d minutes", sign, oct / 4, oct % 4 * 15); curr_offset++; @@ -1109,7 +1126,7 @@ de_lsa_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offse curr_offset = offset; if (len == 0) { - proto_tree_add_text(tree,tvb, curr_offset, len,"LSA ID not included"); + proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_lsa_id, tvb, curr_offset, len, 0, "not included"); } else { @@ -2344,9 +2361,7 @@ de_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, IA5_7BIT_decode(a_bigbuf, ia5_string, ia5_string_len); *address_extracted = TRUE; - item = proto_tree_add_text(tree, - tvb, curr_offset, len - (curr_offset - offset), - "Subaddress: %s", a_bigbuf); + item = proto_tree_add_string(tree, hf_gsm_a_dtap_subaddress, tvb, curr_offset, len - (curr_offset - offset), a_bigbuf); if (invalid_ia5_char) expert_add_info(pinfo, item, &ei_gsm_a_dtap_invalid_ia5_character); @@ -2355,9 +2370,7 @@ de_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, } } - proto_tree_add_text(tree, - tvb, curr_offset, len - (curr_offset - offset), - "Subaddress information"); + proto_tree_add_item(tree, hf_gsm_a_dtap_subaddress_information, tvb, curr_offset, len - (curr_offset - offset), ENC_NA); return (len); } @@ -3359,8 +3372,7 @@ de_cp_user_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off curr_offset = offset; - proto_tree_add_text(tree, tvb, curr_offset, len, - "RPDU (not displayed)"); + proto_tree_add_bytes_format(tree, hf_gsm_a_dtap_rpdu, tvb, curr_offset, len, NULL, "RPDU (not displayed)"); /* * dissect the embedded RP message @@ -3415,6 +3427,9 @@ de_cp_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 off return (curr_offset - offset); } +static const true_false_string tfs_gsm_a_dtap_subchannel = { "Only one TCH active or sub-channel 0 of two half rate channels is to be looped", "Sub-channel 1 of two half rate channels is to be looped" }; + + static guint16 de_tp_sub_channel(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { @@ -3442,18 +3457,8 @@ de_tp_sub_channel(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint else str = "unknown"; - proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_test_loop, tvb, curr_offset, 1, - oct, "%s", str); - - if (oct & 0x01) - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Only one TCH active or sub-channel 0 of two half rate channels is to be looped"); - else - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Sub-channel 1 of two half rate channels is to be looped"); - + proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_test_loop, tvb, curr_offset, 1, oct, "%s", str); + proto_tree_add_item(tree, hf_gsm_a_dtap_subchannel, tvb, curr_offset, 1, ENC_NA); curr_offset+= 1; return (curr_offset - offset); @@ -3470,9 +3475,9 @@ de_tp_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offse oct = tvb_get_guint8(tvb, curr_offset); if ((oct & 0xF0) == 0x80) - proto_tree_add_text(tree,tvb, curr_offset, 1, "Acknowledgment element: %d",oct&0x01); + proto_tree_add_uint(tree, hf_gsm_a_dtap_ack_element, tvb, curr_offset, 1, oct&0x01); else - proto_tree_add_text(tree,tvb, curr_offset, 1, "No acknowledgment element present"); + proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_ack_element, tvb, curr_offset, 1, 0xFF, "No acknowledgment element present"); curr_offset+= 1; @@ -3487,6 +3492,18 @@ static const value_string gsm_channel_coding_vals[] = { { 0, NULL } }; +static const value_string gsm_a_dtap_loop_mech_vals[] = { + { 0, "Multi-slot mechanism 1"}, + { 1, "Multi-slot mechanism 2"}, + { 2, "Reserved"}, + { 3, "Reserved"}, + { 4, "Reserved"}, + { 5, "Reserved"}, + { 6, "Reserved"}, + { 7, "Reserved"}, + { 0, NULL } +}; + static guint16 de_tp_loop_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { @@ -3498,19 +3515,11 @@ de_tp_loop_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 oct = tvb_get_guint8(tvb, curr_offset); proto_tree_add_item(tree, hf_gsm_a_dtap_channel_coding03, tvb, curr_offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_gsm_a_dtap_loop_mechanism1C, tvb, curr_offset, 1, ENC_BIG_ENDIAN); - switch (oct & 0x1c) + if ((oct & 0x1c) == 0) { - case 0x00: - proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 1"); - proto_tree_add_text(tree, tvb, curr_offset, 1, "Timeslot number %d",(oct & 0xe0)>>5); - break; - case 0x04: - proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 2"); - break; - default: - proto_tree_add_text(tree, tvb, curr_offset, 1, "Loop mechanism reserved (%d)",(oct & 0x1c)>>2); - break; + proto_tree_add_item(tree, hf_gsm_a_dtap_timeslot_number, tvb, curr_offset, 1, ENC_NA); } curr_offset+= 1; @@ -3518,36 +3527,16 @@ de_tp_loop_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 return (curr_offset - offset); } +static const true_false_string tfs_multislot_tch = { "not closed due to error", "closed successfully" }; + static guint16 de_tp_loop_ack(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint32 curr_offset; - guchar oct; - - curr_offset = offset; - - oct = tvb_get_guint8(tvb, curr_offset); + guint32 curr_offset = offset; proto_tree_add_item(tree, hf_gsm_a_dtap_channel_coding30, tvb, curr_offset, 1, ENC_BIG_ENDIAN); - - switch (oct & 0x0e) - { - case 0x00: - proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 1"); - break; - case 0x02: - proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot mechanism 2"); - break; - default: - proto_tree_add_text(tree, tvb, curr_offset, 1, "Loop mechanism reserved (%d)",(oct & 0x0e)>>1); - break; - } - - if (oct & 0x01) - proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot TCH loop was not closed due to error"); - else - proto_tree_add_text(tree, tvb, curr_offset, 1, "Multi-slot TCH loop was closed successfully"); - + proto_tree_add_item(tree, hf_gsm_a_dtap_loop_mechanism0E, tvb, curr_offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_gsm_a_dtap_multislot_tch, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset+= 1; return (curr_offset - offset); @@ -3604,21 +3593,14 @@ de_tp_pdu_description(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, g return (curr_offset - offset); } +static const true_false_string tfs_gsm_a_dtap_mode_flag = { "MS shall select the loop back option", "MS shall itself generate the pseudorandom data" }; + static guint16 de_tp_mode_flag(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint32 curr_offset; - guchar oct; - - curr_offset = offset; - - oct = tvb_get_guint8(tvb, curr_offset); - - if (oct & 0x01) - proto_tree_add_text(tree, tvb, curr_offset, 1, "MS shall select the loop back option"); - else - proto_tree_add_text(tree, tvb, curr_offset, 1, "MS shall itself generate the pseudorandom data"); + guint32 curr_offset = offset; + proto_tree_add_item(tree, hf_gsm_a_dtap_mode_flag, tvb, curr_offset, 1, ENC_NA); proto_tree_add_item(tree, hf_gsm_a_dtap_downlink_timeslot_offset, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset+= 1; @@ -3626,21 +3608,15 @@ de_tp_mode_flag(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 return (curr_offset - offset); } +static const true_false_string tfs_gsm_a_dtap_egprs_mode_flag = { "MS loops back blocks on the uplink using GMSK modulation only", + "MS loops back blocks on the uplink using either GMSK or 8-PSK modulation following the detected received modulation" }; + static guint16 de_tp_egprs_mode_flag(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint32 curr_offset; - guchar oct; - - curr_offset = offset; - - oct = tvb_get_guint8(tvb, curr_offset); - - if (oct & 0x01) - proto_tree_add_text(tree, tvb, curr_offset, 1, "MS loops back blocks on the uplink using GMSK modulation only"); - else - proto_tree_add_text(tree, tvb, curr_offset, 1, "MS loops back blocks on the uplink using either GMSK or 8-PSK modulation following the detected received modulation"); + guint32 curr_offset = offset; + proto_tree_add_item(tree, hf_gsm_a_dtap_egprs_mode_flag, tvb, curr_offset, 1, ENC_NA); proto_tree_add_item(tree, hf_gsm_a_dtap_downlink_timeslot_offset, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset+= 1; @@ -3670,6 +3646,14 @@ de_tp_ms_positioning_technology(tvbuff_t *tvb, proto_tree *tree, packet_info *pi return (curr_offset - offset); } +static const value_string gsm_a_dtap_ue_test_loop_mode_vals[] = { + { 0, "Mode 1 loop back (loopback of RLC SDUs or PDCP SDUs)"}, + { 1, "Mode 2 loop back (loopback of transport block data and CRC bits)"}, + { 2, "Mode 3 RLC SDU counting (counting of received RLC SDUs)"}, + { 3, "Reserved"}, + { 0, NULL } +}; + static guint16 de_tp_ue_test_loop_mode(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { @@ -3677,42 +3661,35 @@ de_tp_ue_test_loop_mode(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guchar oct; guint8 lb_setup_length,i,j; guint16 value; + proto_tree* subtree; curr_offset = offset; oct = tvb_get_guint8(tvb, curr_offset); + proto_tree_add_item(tree, hf_gsm_a_dtap_ue_test_loop_mode, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset+= 1; switch (oct & 0x03) { case 0: { - proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode 1 loop back (loopback of RLC SDUs or PDCP SDUs)"); lb_setup_length = tvb_get_guint8(tvb, curr_offset); curr_offset += 1; for (i=0,j=0; (i<lb_setup_length) && (j<4); i+=3,j++) { - proto_tree_add_text(tree, tvb, curr_offset, 1, "LB setup RB IE %d",j+1); + subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, 3, ett_ue_test_loop_mode, NULL, "LB setup RB IE: %d",j+1); value = tvb_get_ntohs(tvb, curr_offset); + proto_tree_add_uint_format_value(subtree, hf_gsm_a_dtap_uplink_rlc_sdu_size, tvb, curr_offset, 2, value, "%d bits", value); curr_offset += 2; - proto_tree_add_text(tree, tvb, curr_offset, 1, "Uplink RLC SDU size is %d bits",value); - oct = tvb_get_guint8(tvb, curr_offset); + proto_tree_add_item(subtree, hf_gsm_a_dtap_radio_bearer, tvb, curr_offset, 1, ENC_NA); curr_offset+= 1; - proto_tree_add_text(tree, tvb, curr_offset, 1, "Radio Bearer %d",oct & 0x1f); } break; } - case 1: - proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode 2 loop back (loopback of transport block data and CRC bits)"); - break; case 2: - proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode 3 RLC SDU counting (counting of received RLC SDUs)"); oct = tvb_get_guint8(tvb, curr_offset); curr_offset+= 1; - proto_tree_add_text(tree, tvb, curr_offset, 1, "MBMS short transmission identity %d",(oct & 0x1f)+1); - break; - default: - proto_tree_add_text(tree, tvb, curr_offset, 1, "UE test loop mode reserved (%d)",oct & 0x03); + proto_tree_add_uint(tree, hf_gsm_a_dtap_mbms_short_transmission_identity, tvb, curr_offset, 1, (oct & 0x1f)+1); break; } @@ -3739,15 +3716,11 @@ de_tp_ue_positioning_technology(tvbuff_t *tvb, proto_tree *tree, packet_info *pi static guint16 de_tp_rlc_sdu_counter_value(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint32 curr_offset; - guint32 value; - - curr_offset = offset; + guint32 curr_offset = offset; - value = tvb_get_ntohl(tvb, curr_offset); + proto_tree_add_item(tree, hf_gsm_a_dtap_ue_received_rlc_sdu_counter_value, tvb, curr_offset, 4, ENC_BIG_ENDIAN); curr_offset+= 4; - proto_tree_add_text(tree, tvb, curr_offset, 1, "UE received RLC SDU counter value: %d",value); return (curr_offset - offset); } @@ -3786,13 +3759,15 @@ de_tp_epc_ue_tl_a_lb_setup(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _ guint32 count, nb_lb; guint8 drb; proto_tree *lb_setup_tree = NULL; + proto_item *ti; curr_offset = offset; count = 0; nb_lb = len / 3; - proto_tree_add_text(tree, tvb, curr_offset, len, "Number of LB entities: %d", nb_lb); + ti = proto_tree_add_uint(tree, hf_gsm_a_dtap_num_lb_entities, tvb, curr_offset, 1, nb_lb); + proto_item_set_len(ti, len); while ((count < nb_lb) && (count < 8)) { lb_setup_tree = proto_tree_add_subtree_format(tree, tvb, curr_offset, 3, ett_epc_ue_tl_a_lb_setup, NULL, "LB entity %d", count); @@ -7035,9 +7010,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) */ if (dtap_msg_fcn == NULL) { - proto_tree_add_text(dtap_tree, - tvb, offset, len - offset, - "Message Elements"); + proto_tree_add_item(dtap_tree, hf_gsm_a_dtap_message_elements, tvb, offset, len - offset, ENC_NA); } else { @@ -7398,6 +7371,11 @@ proto_register_gsm_a_dtap(void) FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_gsm_a_dtap_timezone, + { "Timezone", "gsm_a.dtap.timezone", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, { &hf_gsm_a_dtap_u2u_prot_discr, { "User-user protocol discriminator", "gsm_a.dtap.u2u_prot_discr", FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(gsm_a_dtap_u2u_prot_discr_vals), 0x00, @@ -7706,7 +7684,7 @@ proto_register_gsm_a_dtap(void) /* Generated from convert_proto_tree_add_text.pl */ { &hf_gsm_a_dtap_coding_scheme, { "Coding Scheme", "gsm_a.dtap.coding_scheme", - FT_UINT8, BASE_DEC, NULL, 0x70, + FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_coding_scheme_vals), 0x70, NULL, HFILL } }, { &hf_gsm_a_dtap_add_ci, @@ -7794,6 +7772,26 @@ proto_register_gsm_a_dtap(void) FT_BOOLEAN, 8, TFS(&tfs_full_half), 0x08, NULL, HFILL } }, + { &hf_gsm_a_dtap_subaddress, + { "Subaddress", "gsm_a.dtap.subaddress", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_subaddress_information, + { "Subaddress information", "gsm_a.dtap.subaddress_information", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_message_elements, + { "Message Elements", "gsm_a.dtap.message_elements", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_rpdu, + { "RPDU", "gsm_a.dtap.rpdu", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_gsm_a_dtap_configuration, { "Configuration", "gsm_a.dtap.configuration", FT_BOOLEAN, 8, TFS(&tfs_bearer_cap_configuration), 0x04, @@ -8074,6 +8072,16 @@ proto_register_gsm_a_dtap(void) FT_UINT8, BASE_DEC, NULL, 0x3f, NULL, HFILL } }, + { &hf_gsm_a_dtap_subchannel, + { "Subchannel", "gsm_a.dtap.subchannel", + FT_BOOLEAN, 8, TFS(&tfs_gsm_a_dtap_subchannel), 0x01, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_ack_element, + { "Acknowledgment element", "gsm_a.dtap.ack_element", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, { &hf_gsm_a_dtap_channel_coding03, { "Channel coding", "gsm_a.dtap.channel_coding", FT_UINT8, BASE_DEC, VALS(gsm_channel_coding_vals), 0x03, @@ -8084,6 +8092,21 @@ proto_register_gsm_a_dtap(void) FT_UINT8, BASE_DEC, VALS(gsm_channel_coding_vals), 0x30, NULL, HFILL } }, + { &hf_gsm_a_dtap_loop_mechanism0E, + { "Loop mechanism", "gsm_a.dtap.loop_mechanism", + FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_loop_mech_vals), 0x0e, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_loop_mechanism1C, + { "Loop mechanism", "gsm_a.dtap.loop_mechanism", + FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_loop_mech_vals), 0x1c, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_multislot_tch, + { "Multi-slot TCH loop", "gsm_a.dtap.multislot_tch", + FT_BOOLEAN, 8, TFS(&tfs_multislot_tch), 0x01, + NULL, HFILL } + }, { &hf_gsm_a_dtap_tp_tested_device, { "Tested device", "gsm_a.dtap.tp_tested_device", FT_UINT8, BASE_DEC, NULL, 0x0, @@ -8094,6 +8117,16 @@ proto_register_gsm_a_dtap(void) FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_gsm_a_dtap_mode_flag, + { "Mode flag", "gsm_a.dtap.mode_flag", + FT_BOOLEAN, 8, TFS(&tfs_gsm_a_dtap_mode_flag), 0x01, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_egprs_mode_flag, + { "EGPRS Mode flag", "gsm_a.dtap.egprs_mode_flag", + FT_BOOLEAN, 8, TFS(&tfs_gsm_a_dtap_egprs_mode_flag), 0x01, + NULL, HFILL } + }, { &hf_gsm_a_dtap_downlink_timeslot_offset, { "Downlink Timeslot Offset", "gsm_a.dtap.downlink_timeslot_offset", FT_UINT8, BASE_DEC, NULL, 0x0E, @@ -8104,6 +8137,11 @@ proto_register_gsm_a_dtap(void) FT_UINT8, BASE_DEC, VALS(gsm_positioning_technology_vals), 0x0, NULL, HFILL } }, + { &hf_gsm_a_dtap_ue_test_loop_mode, + { "UE test loop mode", "gsm_a.dtap.ue_test_loop_mode", + FT_UINT8, BASE_DEC, VALS(gsm_a_dtap_ue_test_loop_mode_vals), 0x03, + NULL, HFILL } + }, { &hf_gsm_a_dtap_ue_positioning_technology, { "UE positioning technology", "gsm_a.dtap.ue_positioning_technology", FT_UINT8, BASE_DEC, VALS(gsm_positioning_technology_vals), 0x0, @@ -8164,10 +8202,40 @@ proto_register_gsm_a_dtap(void) FT_UINT8, BASE_DEC, NULL, DTAP_TIE_MASK, NULL, HFILL } }, + { &hf_gsm_a_dtap_timeslot_number, + { "Timeslot number", "gsm_a_dtap.timeslot_number", + FT_UINT8, BASE_DEC, NULL, 0xe0, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_uplink_rlc_sdu_size, + { "Uplink RLC SDU size", "gsm_a_dtap.uplink_rlc_sdu_size", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_radio_bearer, + { "Radio Bearer", "gsm_a_dtap.radio_bearer", + FT_UINT8, BASE_DEC, NULL, 0x1F, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_mbms_short_transmission_identity, + { "MBMS short transmission identity", "gsm_a_dtap.mbms_short_transmission_identity", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_ue_received_rlc_sdu_counter_value, + { "UE received RLC SDU counter value", "gsm_a_dtap.ue_received_rlc_sdu_counter_value", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_gsm_a_dtap_num_lb_entities, + { "Number of LB entities", "gsm_a_dtap.num_lb_entities", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, }; /* Setup protocol subtree array */ -#define NUM_INDIVIDUAL_ELEMS 21 +#define NUM_INDIVIDUAL_ELEMS 22 gint *ett[NUM_INDIVIDUAL_ELEMS + NUM_GSM_DTAP_MSG_MM + NUM_GSM_DTAP_MSG_CC + NUM_GSM_DTAP_MSG_SMS + NUM_GSM_DTAP_MSG_SS + NUM_GSM_DTAP_MSG_TP + @@ -8182,6 +8250,7 @@ proto_register_gsm_a_dtap(void) { &ei_gsm_a_dtap_keypad_info_not_dtmf_digit, { "gsm_a.dtap.keypad_info_not_dtmf_digit", PI_MALFORMED, PI_WARN, "Keypad information contains character that is not a DTMF digit", EXPFILL }}, { &ei_gsm_a_dtap_extraneous_data, { "gsm_a.dtap.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }}, { &ei_gsm_a_dtap_missing_mandatory_element, { "gsm_a.dtap.missing_mandatory_element", PI_PROTOCOL, PI_WARN, "Missing Mandatory element, rest of dissection is suspect", EXPFILL }}, + { &ei_gsm_a_dtap_coding_scheme, { "gsm_a.dtap.coding_scheme.unknown", PI_PROTOCOL, PI_WARN, "Text string encoded according to an unknown Coding Scheme", EXPFILL }}, }; expert_module_t* expert_a_dtap; @@ -8207,6 +8276,7 @@ proto_register_gsm_a_dtap(void) ett[18] = &ett_bc_oct_7; ett[19] = &ett_epc_ue_tl_a_lb_setup; ett[20] = &ett_mm_timer; + ett[21] = &ett_ue_test_loop_mode; last_offset = NUM_INDIVIDUAL_ELEMS; diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c index 2579640a79..5e6b299cf0 100644 --- a/epan/dissectors/packet-gsm_a_gm.c +++ b/epan/dissectors/packet-gsm_a_gm.c @@ -283,6 +283,7 @@ static int hf_gsm_a_gm_fop = -1; static int hf_gsm_a_gm_res_of_attach = -1; static int hf_gsm_a_gm_type_of_ciph_alg = -1; static int hf_gsm_a_gm_imeisv_req = -1; +static int hf_gsm_a_gm_nsapi = -1; static int hf_gsm_a_gm_ac_ref_nr = -1; static int hf_gsm_a_gm_force_to_standby = -1; static int hf_gsm_a_gm_serv_type = -1; @@ -293,10 +294,13 @@ static int hf_gsm_a_gm_power_off = -1; static int hf_gsm_a_gm_type_of_detach_mo = -1; static int hf_gsm_a_gm_type_of_detach_mt = -1; static int hf_gsm_a_gm_update_type = -1; +static int hf_gsm_a_gm_gprs_timer = -1; static int hf_gsm_a_gm_gprs_timer_unit = -1; static int hf_gsm_a_gm_gprs_timer_value = -1; +static int hf_gsm_a_gm_gprs_timer2 = -1; static int hf_gsm_a_gm_gprs_timer2_unit = -1; static int hf_gsm_a_gm_gprs_timer2_value = -1; +static int hf_gsm_a_gm_gprs_timer3 = -1; static int hf_gsm_a_gm_gprs_timer3_unit = -1; static int hf_gsm_a_gm_gprs_timer3_value = -1; static int hf_gsm_a_gm_nsapi_5_ul_stat = -1; @@ -460,6 +464,42 @@ static int hf_gsm_a_gmm_net_cap_epc = -1; static int hf_gsm_a_gmm_net_cap_nf = -1; static int hf_gsm_a_gmm_net_geran_net_sharing = -1; +/* Generated from convert_proto_tree_add_text.pl */ +static int hf_gsm_a_gm_presence = -1; +static int hf_gsm_a_gm_8psk_power_class = -1; +static int hf_gsm_a_gm_rf_power_capability = -1; +static int hf_gsm_a_gm_a5_bits = -1; +static int hf_gsm_a_gm_8psk_power_capability = -1; +static int hf_gsm_a_gm_extended_dtm_gprs_multi_slot_class = -1; +static int hf_gsm_a_gm_extended_dtm_egprs_multi_slot_class = -1; +static int hf_gsm_a_gm_high_multislot_capability = -1; +static int hf_gsm_a_gm_gmsk_multislot_power_profile = -1; +static int hf_gsm_a_gm_8psk_multislot_power_profile = -1; +static int hf_gsm_a_gm_update_result = -1; +static int hf_gsm_a_gm_radio_priority_pdp = -1; +static int hf_gsm_a_gm_radio_priority_tom8 = -1; +static int hf_gsm_a_gm_configuration_protocol = -1; +static int hf_gsm_a_gm_sm_pco_length = -1; +static int hf_gsm_a_gm_sm_pco_ipv6 = -1; +static int hf_gsm_a_gm_sm_pco_reject_code = -1; +static int hf_gsm_a_gm_sm_pco_prefix_length = -1; +static int hf_gsm_a_gm_sm_pco_ipv4 = -1; +static int hf_gsm_a_gm_sm_pco_ipv4_link_mtu_size = -1; +static int hf_gsm_a_sm_pdp_type_number = -1; +static int hf_gsm_a_sm_pdp_address = -1; +static int hf_gsm_a_gm_maximum_sdu_size = -1; +static int hf_gsm_a_gm_ti_value = -1; +static int hf_gsm_a_gm_packet_filter = -1; +static int hf_gsm_a_gm_packet_evaluation_precedence = -1; +static int hf_gsm_a_gm_packet_filter_length = -1; +static int hf_gsm_a_gm_authorization_token_value = -1; +static int hf_gsm_a_gm_media_component_number_value = -1; +static int hf_gsm_a_gm_ip_flow_number = -1; +static int hf_gsm_a_gm_packet_filter_identifier = -1; +static int hf_gsm_a_gm_parameter_content = -1; +static int hf_gsm_a_sm_packet_filter_component_type_id = -1; +static int hf_gsm_a_gm_sm_pco_ms = -1; + /* Initialize the subtree pointers */ static gint ett_gmm_radio_cap = -1; static gint ett_gmm_network_cap = -1; @@ -471,6 +511,8 @@ static gint ett_sm_tft = -1; static gint ett_sm_pco = -1; static expert_field ei_gsm_a_gm_extraneous_data = EI_INIT; +static expert_field ei_gsm_a_gm_not_enough_data = EI_INIT; +static expert_field ei_gsm_a_gm_undecoded = EI_INIT; static dissector_handle_t data_handle; static dissector_handle_t rrc_irat_ho_info_handle; @@ -961,12 +1003,7 @@ de_gmm_rec_npdu_lst(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 curr_len -= 2; oct <<= 8; - proto_tree_add_text(tree, - tvb, curr_offset, 2, - "NSAPI %d: 0x%02x (%u)", - oct>>20, - (oct>>12)&0xff, - (oct>>12)&0xff); + proto_tree_add_uint_format(tree, hf_gsm_a_gm_nsapi, tvb, curr_offset, 2, (oct>>12)&0xff, "NSAPI %d: 0x%02x (%u)", oct>>20, (oct>>12)&0xff, (oct>>12)&0xff); curr_offset += 2; if (curr_len > 2) @@ -975,12 +1012,7 @@ de_gmm_rec_npdu_lst(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 curr_len--; oct <<= 12; - proto_tree_add_text(tree, - tvb, curr_offset-1, 2, - "NSAPI %d: 0x%02x (%u)", - oct>>20, - (oct>>12)&0xff, - (oct>>12)&0xff); + proto_tree_add_uint_format(tree, hf_gsm_a_gm_nsapi, tvb, curr_offset-1, 2, (oct>>12)&0xff, "NSAPI %d: 0x%02x (%u)", oct>>20, (oct>>12)&0xff, (oct>>12)&0xff); curr_offset++; } @@ -1176,9 +1208,7 @@ de_gmm_ms_net_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 o guint32 tmp_oct; \ if (curr_len == 0) \ { \ - proto_tree_add_text(tf_tree, \ - tvb, curr_offset, 1, \ - "Not enough data available"); \ + proto_tree_add_expert(tf_tree, pinfo, &ei_gsm_a_gm_not_enough_data, tvb, curr_offset, 1); \ } \ tmp_oct = tvb_get_guint8(tvb, curr_offset); \ oct |= tmp_oct<<(32-8-bits_in_oct); \ @@ -1410,13 +1440,66 @@ static const value_string gsm_a_gm_dlmc_max_nb_dl_carriers_vals[] = { { 0, NULL } }; +static const value_string gsm_a_gm_8psk_power_class_vals[] = { + {0x00, "8PSK modulation not supported for uplink" }, + {0x01, "Power class E1"}, + {0x02, "Power class E2"}, + {0x03, "Power class E3"}, + {0, NULL}, +}; + + +static const value_string gsm_a_gm_8psk_power_cap_vals[] = { + {0x00, "Reserved" }, + {0x01, "Power class E1"}, + {0x02, "Power class E2"}, + {0x03, "Power class E3"}, + {0, NULL}, +}; + +static const value_string gsm_a_gm_extended_dtm_gprs_multi_slot_class_vals[] = { + {0x00, "Unused. If received, it shall be interpreted as Multislot class 5 supported" }, + {0x01, "Unused. If received, it shall be interpreted as Multislot class 5 supported"}, + {0x02, "Unused. If received, it shall be interpreted as Multislot class 5 supported"}, + {0x03, "Unused. If received, it shall be interpreted as Multislot class 5 supported"}, + {0x10, "Multislot class 5 supported"}, + {0x11, "Multislot class 6 supported"}, + {0x12, "Unused. If received, it shall be interpreted as Multislot class 5 supported"}, + {0x13, "Unused. If received, it shall be interpreted as Multislot class 5 supported"}, + {0x20, "Multislot class 9 supported"}, + {0x21, "Multislot class 10 supported"}, + {0x22, "Unused. If received, it shall be interpreted as Multislot class 9 supported"}, + {0x23, "Unused. If received, it shall be interpreted as Multislot class 9 supported"}, + {0x30, "Multislot class 11 supported"}, + {0x31, "Unused. If received, it shall be interpreted as Multislot class 11 supported"}, + {0x32, "Unused. If received, it shall be interpreted as Multislot class 11 supported"}, + {0x33, "Unused. If received, it shall be interpreted as Multislot class 11 supported"}, + {0, NULL} +}; + +static const value_string gsm_a_gm_gmsk_multislot_power_profile_vals[] = { + {0x00, "GMSK_MULTISLOT_POWER_PROFILE 0" }, + {0x01, "GMSK_MULTISLOT_POWER_PROFILE 1"}, + {0x02, "GMSK_MULTISLOT_POWER_PROFILE 2"}, + {0x03, "GMSK_MULTISLOT_POWER_PROFILE 3"}, + {0, NULL} +}; + +static const value_string gsm_a_gm_8psk_multislot_power_profile_vals[] = { + {0x00, "8-PSK_MULTISLOT_POWER_PROFILE 0" }, + {0x01, "8-PSK_MULTISLOT_POWER_PROFILE 1"}, + {0x02, "8-PSK_MULTISLOT_POWER_PROFILE 2"}, + {0x03, "8-PSK_MULTISLOT_POWER_PROFILE 3"}, + {0, NULL} +}; + guint16 de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) { guint32 curr_offset; guint curr_len; int bit_offset; - proto_item *tf = NULL, *mc_item = NULL; + proto_item *tf = NULL, *mc_item = NULL, *ti; proto_tree *tf_tree = NULL, *mc_tree = NULL; guint32 oct; guchar bits_in_oct; @@ -1531,9 +1614,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui default: str = "This should not happen"; } - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "Presence: %s (%u)", str, oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(tf_tree, hf_gsm_a_gm_presence, tvb, curr_offset-1-add_octets, 1+add_octets, oct>>(32-bits_needed), "%s (%u)", str, oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -1628,9 +1709,8 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui str = "Not specified??"; /* decode_bits_in_field(gint bit_offset, gint no_of_bits, guint64 value)*/ - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(bit_offset, 3, value), str, value); + proto_tree_add_uint_format(tf_tree, hf_gsm_a_gm_rf_power_capability, tvb, curr_offset-1-add_octets, 1+add_octets, value, + "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(bit_offset, 3, value), str, value); bit_offset += 3; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -1644,18 +1724,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui value = tvb_get_bits8(tvb, bit_offset, 2); /* analyse bits */ - switch (value) - { - case 0x00: str = "8PSK modulation not supported for uplink"; break; - case 0x01: str = "Power class E1"; break; - case 0x02: str = "Power class E2"; break; - case 0x03: str = "Power class E3"; break; - default: str = "This should not happen"; - } - - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "8PSK Power Class: %s (%u)", str, value); + proto_tree_add_uint(tf_tree, hf_gsm_a_gm_8psk_power_class, tvb, curr_offset-1-add_octets, 1+add_octets, value); bit_offset += 2; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -1708,9 +1777,8 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui else str = "Not specified??"; - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(bit_offset, 3, value), str, value); + proto_tree_add_uint_format(tf_tree, hf_gsm_a_gm_rf_power_capability, tvb, curr_offset-1-add_octets, 1+add_octets, value, + "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(bit_offset, 3, value), str, value); bit_offset += 3; curr_bits_length -= bits_needed; @@ -1726,10 +1794,9 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* analyse bits */ if ((oct>>(32-bits_needed)) == 0) { - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "A5 Bits: Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (%u)", - oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(tf_tree, hf_gsm_a_gm_a5_bits, tvb, curr_offset-1-add_octets, 1+add_octets, oct>>(32-bits_needed), + "Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (%u)", + oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -1739,9 +1806,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui { int i; - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "A5 Bits: A5 bits follow (%u)", oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(tf_tree, hf_gsm_a_gm_a5_bits, tvb, curr_offset-1-add_octets, 1+add_octets, oct>>(32-bits_needed), "A5 bits follow (%u)", oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; @@ -1764,9 +1829,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui default: str = "This should not happen"; } - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "A5/%d: %s (%u)", i, str, oct>>(32-bits_needed)); + proto_tree_add_uint_format(tf_tree, hf_gsm_a_gm_a5_bits, tvb, curr_offset-1-add_octets, 1+add_octets, oct>>(32-bits_needed), "A5/%d: %s (%u)", i, str, oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -1850,9 +1913,8 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* analyse bits */ if ((oct>>(32-bits_needed)) == 0) { - proto_tree_add_text(mc_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "HSCSD multislot class: Bits are not available (%u)", oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(mc_tree, hf_gsm_a_gm_rac_hscsd_multi_slot_class, tvb, curr_offset-1-add_octets, 1+add_octets, 0xFF, + "Bits are not available (%u)", oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -1887,9 +1949,8 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* analyse bits */ if ((oct>>(32-bits_needed)) == 0) { - proto_tree_add_text(mc_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "GPRS multislot class: Bits are not available (%u)", oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(mc_tree, hf_gsm_a_gm_rac_gprs_multi_slot_class, tvb, curr_offset-1-add_octets, 1+add_octets, 0xFF, + "Bits are not available (%u)", oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -1936,9 +1997,8 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* analyse bits */ if ((oct>>(32-bits_needed)) == 0) { - proto_tree_add_text(mc_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "SMS/SM values: Bits are not available (%u)", oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(mc_tree, hf_gsm_a_gm_sms_value, tvb, curr_offset-1-add_octets, 1+add_octets, 0xFF, + "Bits are not available (%u)", oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -1987,9 +2047,8 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* analyse bits */ if ((oct>>(32-bits_needed)) == 0) { - proto_tree_add_text(mc_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "ECSD multislot class: Bits are not available (%u)", oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(mc_tree, hf_gsm_a_gm_rac_ecsd_multi_slot_class, tvb, curr_offset-1-add_octets, 1+add_octets, 0xFF, + "Bits are not available (%u)", oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -2024,9 +2083,8 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* analyse bits */ if ((oct>>(32-bits_needed)) == 0) { - proto_tree_add_text(mc_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "EGPRS multislot class: Bits are not available (%u)", oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(mc_tree, hf_gsm_a_gm_rac_egprs_multi_slot_class, tvb, curr_offset-1-add_octets, 1+add_octets, 0xFF, + "Bits are not available (%u)", oct>>(32-bits_needed)); curr_bits_length -= bits_needed; oct <<= bits_needed; bits_in_oct -= bits_needed; @@ -2073,9 +2131,8 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* analyse bits */ if ((oct>>(32-bits_needed)) == 0) { - proto_tree_add_text(mc_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "DTM GPRS Multi Slot Class: Bits are not available (%u)", oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(mc_tree, hf_gsm_a_gm_rac_dtm_gprs_multi_slot_class, tvb, curr_offset-1-add_octets, 1+add_octets, 0xFF, + "Bits are not available (%u)", oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -2168,19 +2225,8 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui bits_needed = 2; GET_DATA; - /* analyse bits */ - switch (oct>>(32-bits_needed)) - { - case 0x00: str = "Reserved"; break; - case 0x01: str = "Power class E1"; break; - case 0x02: str = "Power class E2"; break; - case 0x03: str = "Power class E3"; break; - default: str = "This should not happen"; - } - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "8PSK Power Capability: %s (%u)", str, oct>>(32-bits_needed)); + proto_tree_add_uint(tf_tree, hf_gsm_a_gm_8psk_power_capability, tvb, curr_offset-1-add_octets, 1+add_octets, oct>>(32-bits_needed)); bit_offset += 2; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -2281,9 +2327,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* analyse bits */ if ((oct>>(32-bits_needed)) == 0) { - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "Extended DTM (E)GPRS Multi Slot Class: Bits are not available (%u)", oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(tf_tree, hf_gsm_a_gm_extended_dtm_egprs_multi_slot_class, tvb, curr_offset-1-add_octets, 1+add_octets, 0xFF, "Bits are not available (%u)", oct>>(32-bits_needed)); curr_bits_length -= bits_needed; oct <<= bits_needed; bits_in_oct -= bits_needed; @@ -2303,30 +2347,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui GET_DATA; /* analyse bits */ - switch ((oct>>(32-bits_needed))|(dtm_gprs_mslot<<4)) - { - case 0x00: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x01: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x02: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x03: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x10: str = "Multislot class 5 supported"; break; - case 0x11: str = "Multislot class 6 supported"; break; - case 0x12: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x13: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x20: str = "Multislot class 9 supported"; break; - case 0x21: str = "Multislot class 10 supported"; break; - case 0x22: str = "Unused. If received, it shall be interpreted as Multislot class 9 supported"; break; - case 0x23: str = "Unused. If received, it shall be interpreted as Multislot class 9 supported"; break; - case 0x30: str = "Multislot class 11 supported"; break; - case 0x31: str = "Unused. If received, it shall be interpreted as Multislot class 11 supported"; break; - case 0x32: str = "Unused. If received, it shall be interpreted as Multislot class 11 supported"; break; - case 0x33: str = "Unused. If received, it shall be interpreted as Multislot class 11 supported"; break; - default: str = "This should not happen"; - } - - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "Extended DTM GPRS Multi Slot Class: %s (%u)", str, oct>>(32-bits_needed)); + proto_tree_add_uint(tf_tree, hf_gsm_a_gm_extended_dtm_gprs_multi_slot_class, tvb, curr_offset-1-add_octets, 1+add_octets, (oct>>(32-bits_needed))|(dtm_gprs_mslot<<4)); bit_offset += 2; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -2341,30 +2362,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui GET_DATA; /* analyse bits */ - switch ((oct>>(32-bits_needed))|(dtm_egprs_mslot<<4) ) - { - case 0x00: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x01: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x02: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x03: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x10: str = "Multislot class 5 supported"; break; - case 0x11: str = "Multislot class 6 supported"; break; - case 0x12: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x13: str = "Unused. If received, it shall be interpreted as Multislot class 5 supported"; break; - case 0x20: str = "Multislot class 9 supported"; break; - case 0x21: str = "Multislot class 10 supported"; break; - case 0x22: str = "Unused. If received, it shall be interpreted as Multislot class 9 supported"; break; - case 0x23: str = "Unused. If received, it shall be interpreted as Multislot class 9 supported"; break; - case 0x30: str = "Multislot class 11 supported"; break; - case 0x31: str = "Unused. If received, it shall be interpreted as Multislot class 11 supported"; break; - case 0x32: str = "Unused. If received, it shall be interpreted as Multislot class 11 supported"; break; - case 0x33: str = "Unused. If received, it shall be interpreted as Multislot class 11 supported"; break; - default: str = "This should not happen"; - } - - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "Extended DTM EGPRS Multi Slot Class: %s (%u)", str, oct>>(32-bits_needed)); + proto_tree_add_uint(tf_tree, hf_gsm_a_gm_extended_dtm_egprs_multi_slot_class, tvb, curr_offset-1-add_octets, 1+add_octets, (oct>>(32-bits_needed))|(dtm_egprs_mslot<<4)); bit_offset += 2; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -2393,9 +2391,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* analyse bits */ if ((oct>>(32-bits_needed)) == 0) { - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "High Multislot Capability: Bits are not available (%u)", oct>>(32-bits_needed)); + proto_tree_add_uint_format_value(tf_tree, hf_gsm_a_gm_high_multislot_capability, tvb, curr_offset-1-add_octets, 1+add_octets, 0xFF, "Bits are not available (%u)", oct>>(32-bits_needed)); bit_offset++; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -2415,14 +2411,10 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui GET_DATA; /* analyse bits */ - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "High Multislot Capability: 0x%02x (%u)" - " - This field effect all other multislot fields." - " To understand the value please read TS 24.008 5.6.0" - " Release 5 Chap 10.5.5.12 Page 406", - oct>>(32-bits_needed), - oct>>(32-bits_needed)); + ti = proto_tree_add_uint(tf_tree, hf_gsm_a_gm_high_multislot_capability, tvb, curr_offset-1-add_octets, 1+add_octets, oct>>(32-bits_needed)); + proto_item_append_text(ti, " - This field effect all other multislot fields." + " To understand the value please read TS 24.008 5.6.0" + " Release 5 Chap 10.5.5.12 Page 406"); bit_offset += 2; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -2480,18 +2472,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui GET_DATA; /* analyse bits */ - switch (oct>>(32-bits_needed) ) - { - case 0x00: str = "GMSK_MULTISLOT_POWER_PROFILE 0"; break; - case 0x01: str = "GMSK_MULTISLOT_POWER_PROFILE 1"; break; - case 0x02: str = "GMSK_MULTISLOT_POWER_PROFILE 2"; break; - case 0x03: str = "GMSK_MULTISLOT_POWER_PROFILE 3"; break; - default: str = "This should not happen"; - } - - proto_tree_add_text(tf_tree, - tvb, curr_offset-1-add_octets, 1+add_octets, - "GMSK Multislot Power Profile: %s (%u)", str, oct>>(32-bits_needed)); + proto_tree_add_uint(tf_tree, hf_gsm_a_gm_gmsk_multislot_power_profile, tvb, curr_offset-1-add_octets, 1+add_octets, oct>>(32-bits_needed)); bit_offset += 2; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -2504,17 +2485,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui GET_DATA; /* analyse bits */ - switch (oct>>(32-bits_needed) ) - { - case 0x00: str = "8-PSK_MULTISLOT_POWER_PROFILE 0"; break; - case 0x01: str = "8-PSK_MULTISLOT_POWER_PROFILE 1"; break; - case 0x02: str = "8-PSK_MULTISLOT_POWER_PROFILE 2"; break; - case 0x03: str = "8-PSK_MULTISLOT_POWER_PROFILE 3"; break; - default: str = "This should not happen"; - } - - proto_tree_add_text(tf_tree, tvb, curr_offset-1-add_octets, 1+add_octets, - "8-PSK Multislot Power Profile: %s (%u)", str, oct>>(32-bits_needed)); + proto_tree_add_uint(tf_tree, hf_gsm_a_gm_8psk_multislot_power_profile, tvb, curr_offset-1-add_octets, 1+add_octets, oct>>(32-bits_needed)); bit_offset += 2; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -3290,32 +3261,26 @@ de_gmm_rai2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, /* * [7] 10.5.5.17 */ +static const value_string gsm_a_gm_update_res_vals[] = { + {0, "RA updated" }, + {1, "Combined RA/LA updated"}, + {2, "Reserved"}, + {3, "Reserved"}, + {4, "Reserved"}, + {5, "Reserved"}, + {6, "Reserved"}, + {7, "Reserved"}, + {0, NULL} +}; + + static guint16 de_gmm_update_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint8 oct; - guint32 curr_offset; - const gchar *str; - - curr_offset = offset; - - oct = tvb_get_guint8(tvb, curr_offset); + guint32 curr_offset = offset; /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */ - oct >>= 4; - - switch (oct&7) - { - case 0: str = "RA updated"; break; - case 1: str = "combined RA/LA updated"; break; - default: str = "reserved"; - } - - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Update Result: %s (%u)", - str, - oct&7); + proto_tree_add_item(tree, hf_gsm_a_gm_update_result, tvb, curr_offset, 1, ENC_NA); curr_offset++; @@ -3524,7 +3489,7 @@ defined in 3GPP TS 25.331 [23c]. If this field includes padding bits, they are d if (rrc_irat_ho_info_handle) call_dissector(rrc_irat_ho_info_handle, rrc_irat_ho_info_tvb, pinfo, tree); else - proto_tree_add_text(tree, tvb, curr_offset, len, "INTER RAT HANDOVER INFO - Not decoded"); + proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_gm_undecoded, tvb, curr_offset, len, "INTER RAT HANDOVER INFO - Not decoded"); return len; @@ -3579,7 +3544,7 @@ de_gmm_eutran_irat_info_container(tvbuff_t *tvb, proto_tree *tree, packet_info * if (lte_rrc_ue_eutra_cap_handle) call_dissector(lte_rrc_ue_eutra_cap_handle, lte_rrc_ue_eutra_cap_tvb, pinfo, tree); else - proto_tree_add_text(tree, tvb, curr_offset, len, "E-UTRAN Inter RAT information container - Not decoded"); + proto_tree_add_expert_format(tree, pinfo, &ei_gsm_a_gm_undecoded, tvb, curr_offset, len, "E-UTRAN Inter RAT information container - Not decoded"); return len; } @@ -3686,11 +3651,7 @@ de_gc_context_stat(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 curr_offset++; oct = tvb_get_guint8(tvb, curr_offset); } - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "NSAPI %d: %s (%u)", pdp_nr, - pdp_str[oct&1], - oct&1); + proto_tree_add_uint_format(tree, hf_gsm_a_gm_nsapi, tvb, curr_offset, 1, oct&1, "NSAPI %d: %s (%u)", pdp_nr, pdp_str[oct&1], oct&1); oct>>=1; } @@ -3704,31 +3665,24 @@ de_gc_context_stat(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 /* * [7] 10.5.7.2 */ +static const value_string gsm_a_gm_radio_prio_vals[] = { + {0, "priority level 4 (lowest)" }, + {1, "priority level 1 (highest)"}, + {2, "priority level 2"}, + {3, "priority level 3"}, + {4, "priority level 4 (lowest)"}, + {5, "priority level 4 (lowest)"}, + {6, "priority level 4 (lowest)"}, + {7, "priority level 4 (lowest)"}, + {0, NULL} +}; + static guint16 de_gc_radio_prio(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint8 oct; - guint32 curr_offset; - const gchar *str; - - curr_offset = offset; - - oct = tvb_get_guint8(tvb, curr_offset); - - switch (oct&7) - { - case 1: str = "priority level 1 (highest)"; break; - case 2: str = "priority level 2"; break; - case 3: str = "priority level 3"; break; - case 4: str = "priority level 4 (lowest)"; break; - default: str = "priority level 4 (lowest)"; - } + guint32 curr_offset = offset; - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Radio Priority (PDP or SMS): %s (%u)", - str, - oct&7); + proto_tree_add_item(tree, hf_gsm_a_gm_radio_priority_pdp, tvb, curr_offset, 1, ENC_NA); curr_offset++; @@ -3771,15 +3725,13 @@ de_gc_timer(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 off break; case 7: str = ""; - item = proto_tree_add_text(tree, tvb, offset, 1, - "GPRS Timer: timer is deactivated"); + item = proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_gprs_timer, tvb, offset, 1, val, "timer is deactivated"); break; default: str = "min"; } if (item == NULL) { - item = proto_tree_add_text(tree, tvb, offset, 1, - "GPRS Timer: %u %s", val, str); + item = proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_gprs_timer, tvb, offset, 1, val, "%u %s", val, str); } subtree = proto_item_add_subtree(item, ett_gmm_gprs_timer); @@ -3821,16 +3773,13 @@ de_gc_timer2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 of str = "min"; val*=6; break; case 7: - item = proto_tree_add_text(tree, tvb, curr_offset, 1, - "GPRS Timer: timer is deactivated"); + item = proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_gprs_timer2, tvb, curr_offset, 1, val, "timer is deactivated"); break; default: str = "min"; } if (item == NULL) { - item = proto_tree_add_text(tree, tvb, curr_offset, 1, - "GPRS Timer: %u %s %s", - val, str, add_string ? add_string : ""); + item = proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_gprs_timer2, tvb, curr_offset, 1, val, "%u %s %s", val, str, add_string ? add_string : ""); } subtree = proto_item_add_subtree(item, ett_gmm_gprs_timer); @@ -3880,15 +3829,13 @@ de_gc_timer3(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 of case 4: str = "sec"; val*=30; break; case 5: str = "min"; break; case 7: - item = proto_tree_add_text(tree, tvb, curr_offset, 1, - "GPRS Timer: timer is deactivated"); + item = proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_gprs_timer3, tvb, curr_offset, 1, val, "timer is deactivated"); break; default: str = "hr"; } if (item == NULL) { - item = proto_tree_add_text(tree, tvb, curr_offset, 1, - "GPRS Timer: %u %s", val, str); + item = proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_gprs_timer3, tvb, curr_offset, 1, val, "%u %s", val, str); } subtree = proto_item_add_subtree(item, ett_gmm_gprs_timer); @@ -3905,31 +3852,10 @@ de_gc_timer3(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 of static guint16 de_gc_radio_prio2(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) { - guint8 oct; - guint32 curr_offset; - const gchar *str; - - curr_offset = offset; - - oct = tvb_get_guint8(tvb, curr_offset); + guint32 curr_offset = offset; /* IMPORTANT - IT'S ASSUMED THAT THE INFORMATION IS IN THE HIGHER NIBBLE */ - oct >>= 4; - - switch (oct&7) - { - case 1: str = "priority level 1 (highest)"; break; - case 2: str = "priority level 2"; break; - case 3: str = "priority level 3"; break; - case 4: str = "priority level 4 (lowest)"; break; - default: str = "priority level 4 (lowest)"; - } - - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Radio Priority (TOM8): %s (%u)", - str, - oct&7); + proto_tree_add_item(tree, hf_gsm_a_gm_radio_priority_tom8, tvb, curr_offset, 1, ENC_NA); curr_offset++; @@ -3954,11 +3880,7 @@ de_gc_mbms_context_stat(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, for (j=0; j<8; j++) { - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "NSAPI %d: %s (%u)", 128+i*8+j, - pdp_str[oct&1], - oct&1); + proto_tree_add_uint_format(tree, hf_gsm_a_gm_nsapi, tvb, curr_offset, 1, oct&1, "NSAPI %d: %s (%u)", 128+i*8+j, pdp_str[oct&1], oct&1); oct>>=1; } curr_offset++; @@ -4088,10 +4010,7 @@ de_sm_nsapi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 off oct = tvb_get_guint8(tvb, curr_offset); - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "NSAPI: 0x%02x (%u) %s", - oct&0x0f, oct&0x0f, add_string ? add_string : ""); + proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_nsapi, tvb, curr_offset, 1, oct&0x0f, "0x%02x (%u) %s", oct&0x0f, oct&0x0f, add_string ? add_string : ""); curr_offset++; @@ -4153,6 +4072,12 @@ static const value_string gsm_a_gm_link_dir_vals[] = { { 0, NULL } }; +static const value_string gsm_a_gm_ms_vals[] = { + { 1, "MS only" }, + { 2, "MS/NW" }, + { 0, NULL } +}; + guint16 de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) { @@ -4184,7 +4109,7 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g * All other values are interpreted as PPP in this version of the protocol. * (3GPP TS 24.008 version 9.4.0 Release 9) */ - proto_tree_add_text(tree, tvb, curr_offset, 1, "Configuration Protocol: PPP for use with IP PDP type or IP PDN type (%u)", oct&0x07); + proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_configuration_protocol, tvb, curr_offset, 1, oct&0x07, "PPP for use with IP PDP type or IP PDN type (%u)", oct&0x07); curr_len--; curr_offset++; @@ -4212,7 +4137,7 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g curr_len -= 2; curr_offset += 2; e_len = tvb_get_guint8(tvb, curr_offset); - proto_tree_add_text(pco_tree, tvb, curr_offset, 1, "Length: 0x%02x (%u)", e_len, e_len); + proto_tree_add_item(pco_tree, hf_gsm_a_gm_sm_pco_length, tvb, curr_offset, 1, ENC_NA); curr_len -= 1; curr_offset += 1; @@ -4222,7 +4147,7 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g case 0x0003: case 0x0007: if ((link_dir == P2P_DIR_DL) && (e_len > 0)) { - proto_tree_add_text(pco_tree, tvb, curr_offset, 16, "IPv6: %s", tvb_ip6_to_str(tvb, curr_offset)); + proto_tree_add_item(pco_tree, hf_gsm_a_gm_sm_pco_ipv6, tvb, curr_offset, 16, ENC_NA); } break; case 0x0002: @@ -4235,29 +4160,27 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g case 0x0004: if ((link_dir == P2P_DIR_DL) && (e_len == 1)) { oct = tvb_get_guint8(tvb, curr_offset); - proto_tree_add_text(pco_tree, tvb, curr_offset, 1, "Reject Code: 0x%02x (%u)", oct, oct); + proto_tree_add_item(pco_tree, hf_gsm_a_gm_sm_pco_reject_code, tvb, curr_offset, 1, ENC_NA); } break; case 0x0005: if ((link_dir == P2P_DIR_DL) && (e_len == 1)) { oct = tvb_get_guint8(tvb, curr_offset); - proto_tree_add_text(pco_tree, tvb, curr_offset, 1, "%s", (oct == 1) ? "MS only" : - ((oct == 2) ? "MS/NW" : "Unknown")); + proto_tree_add_item(pco_tree, hf_gsm_a_gm_sm_pco_ms, tvb, curr_offset, 1, ENC_NA); } break; case 0x0008: if ((link_dir == P2P_DIR_DL) && (e_len > 0)) { - proto_tree_add_text(pco_tree, tvb, curr_offset, 16, "IPv6: %s", tvb_ip6_to_str(tvb, curr_offset)); + proto_tree_add_item(pco_tree, hf_gsm_a_gm_sm_pco_ipv6, tvb, curr_offset, 16, ENC_NA); oct = tvb_get_guint8(tvb, curr_offset+16); - proto_tree_add_text(pco_tree, tvb, curr_offset+16, 1, "Prefix length: %u", oct); + proto_tree_add_item(pco_tree, hf_gsm_a_gm_sm_pco_prefix_length, tvb, curr_offset+16, 1, ENC_NA); } break; case 0x0009: case 0x000C: case 0x000D: if ((link_dir == P2P_DIR_DL) && (e_len > 0)) { - proto_tree_add_text(pco_tree, tvb, curr_offset, 4, "IPv4: %s", - tvb_ip_to_str(tvb, curr_offset)); + proto_tree_add_item(pco_tree, hf_gsm_a_gm_sm_pco_ipv4, tvb, curr_offset, 4, ENC_BIG_ENDIAN); } break; case 0x000E: @@ -4269,7 +4192,7 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g case 0x0010: if ((link_dir == P2P_DIR_DL) && (e_len == 2)) { guint16 word = tvb_get_ntohs(tvb, curr_offset); - proto_tree_add_text(pco_tree, tvb, curr_offset, 2, "IPv4 link MTU size: %u octets", word); + proto_tree_add_uint_format(pco_tree, hf_gsm_a_gm_sm_pco_ipv4_link_mtu_size, tvb, curr_offset, 2, word, "%u octets", word); } break; default: @@ -4368,23 +4291,17 @@ de_sm_pdp_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offs else str = "Not specified"; - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "PDP type number: %s (%u)", str, pdp_type_num); + proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_pdp_type_number, tvb, curr_offset, 1, pdp_type_num, "%s (%u)", str, pdp_type_num); if ((len == 2) && ((pdp_type_num == 0x21) || (pdp_type_num == 0x57) || (pdp_type_num == 0x8d))) { - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Dynamic addressing"); + proto_tree_add_uint_format(tree, hf_gsm_a_sm_pdp_address, tvb, curr_offset, 1, pdp_type_num, "Dynamic addressing"); curr_offset += 1; return (curr_offset - offset); } else if (len == 2) { - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "No PDP address is included"); + proto_tree_add_uint_format(tree, hf_gsm_a_sm_pdp_address, tvb, curr_offset, 1, 0, "No PDP address is included"); curr_offset += 1; return (curr_offset - offset); } @@ -4654,13 +4571,9 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g } if ((oct >= 1) && (oct <= 0x96)) - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Maximum SDU size: %u octets (%u)", oct*10, oct); + proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_maximum_sdu_size, tvb, curr_offset, 1, oct, "%u octets (%u)", oct*10, oct); else - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Maximum SDU size: %s (%u)", str, oct); + proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_maximum_sdu_size, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); curr_offset += 1; @@ -5049,9 +4962,7 @@ de_sm_linked_ti(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off curr_offset++; oct = tvb_get_guint8(tvb, curr_offset); - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "TI value: 0x%02x (%u)", oct&0x7f, oct&0x7f); + proto_tree_add_uint(tree, hf_gsm_a_gm_ti_value, tvb, curr_offset, 1, oct&0x7f); proto_tree_add_item(tree, hf_gsm_a_sm_ext, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -5059,9 +4970,7 @@ de_sm_linked_ti(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off } else { - proto_tree_add_text(tree, - tvb, curr_offset, 1, - "TI value: 0x%02x (%u)", (oct>>4)&7, (oct>>4)&7); + proto_tree_add_uint(tree, hf_gsm_a_gm_ti_value, tvb, curr_offset, 1, (oct>>4)&7); curr_offset++; } @@ -5180,6 +5089,23 @@ static const value_string gsm_a_sm_tft_param_id_vals[] = { { 0, NULL } }; +static const value_string packet_filter_component_type_vals[] = { + {0x10, "IPv4 remote address type" }, + {0x11, "IPv4 local address type"}, + {0x20, "IPv6 remote address type"}, + {0x21, "IPv6 remote address/prefix length type"}, + {0x23, "IPv6 local address/prefix length type"}, + {0x30, "Protocol identifier/Next header type"}, + {0x40, "Single local port type"}, + {0x41, "Local port range type"}, + {0x50, "Single remote port type"}, + {0x51, "Remote port range type"}, + {0x60, "Security parameter index type"}, + {0x70, "Type of service/Traffic class type"}, + {0x80, "Flow label type"}, + {0, NULL} +}; + guint16 de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) { @@ -5188,7 +5114,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of guint8 op_code; guint8 pkt_fil_count; guint8 e_bit; - const gchar *str; guint8 count; guint8 oct; gint pf_length; @@ -5224,16 +5149,14 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of { proto_item *tf; proto_tree *tf_tree; - tf = proto_tree_add_text(tree, - tvb, curr_offset, 1, - "Packet filter %d", count); /* 0-> 7 */ + tf = proto_tree_add_uint(tree, hf_gsm_a_gm_packet_filter, tvb, curr_offset, 1, count); /* 0-> 7 */ tf_tree = proto_item_add_subtree(tf, ett_sm_tft); if (op_code == 5) /* Delete packet filters from existing TFT - just a list of identifiers */ { if ((curr_offset-offset)<1) { - proto_tree_add_text(tf_tree, tvb, curr_offset, 1, "Not enough data"); + proto_tree_add_expert(tf_tree, pinfo, &ei_gsm_a_gm_not_enough_data, tvb, curr_offset, 1); return (len); } proto_tree_add_bits_item(tf_tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3), 4, ENC_BIG_ENDIAN); @@ -5247,7 +5170,7 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of { if ((curr_offset-offset)<1) { - proto_tree_add_text(tf_tree, tvb, curr_offset, 1, "Not enough data"); + proto_tree_add_expert(tf_tree, pinfo, &ei_gsm_a_gm_not_enough_data, tvb, curr_offset, 1); return (len); } proto_tree_add_bits_item(tf_tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3), 2, ENC_BIG_ENDIAN); @@ -5258,25 +5181,24 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of curr_len--; if ((curr_offset-offset) < 1) { - proto_tree_add_text(tf_tree, tvb, curr_offset, 1, "Not enough data"); + proto_tree_add_expert(tf_tree, pinfo, &ei_gsm_a_gm_not_enough_data, tvb, curr_offset, 1); return (len); } oct = tvb_get_guint8(tvb, curr_offset); + proto_tree_add_item(tf_tree, hf_gsm_a_gm_packet_evaluation_precedence, tvb, curr_offset, 1, ENC_NA); curr_offset++; curr_len--; - proto_tree_add_text(tf_tree, - tvb, curr_offset-1, 1, - "Packet evaluation precedence: 0x%02x (%u)", oct, oct); - - if ((curr_offset-offset)<1) { proto_tree_add_text(tf_tree, tvb, curr_offset, 1, "Not enough data"); return (len);} + if ((curr_offset-offset)<1) + { + proto_tree_add_expert(tf_tree, pinfo, &ei_gsm_a_gm_not_enough_data, tvb, curr_offset, 1); + return (len); + } pf_length = tvb_get_guint8(tvb, curr_offset); + proto_tree_add_item(tf_tree, hf_gsm_a_gm_packet_filter_length, tvb, curr_offset, 1, ENC_NA); curr_offset++; curr_len--; - proto_tree_add_text(tf_tree, - tvb, curr_offset-1, 1, - "Packet filter length: 0x%02x (%u)", pf_length, pf_length); /* New tree for component */ /* Dissect Packet filter Component */ @@ -5286,21 +5208,20 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of while (pf_length > 0) { proto_tree *comp_tree; if ((curr_offset-offset) < 1) { - proto_tree_add_text(tf_tree, tvb, curr_offset, 1, "Not enough data"); + proto_tree_add_expert(tf_tree, pinfo, &ei_gsm_a_gm_not_enough_data, tvb, curr_offset, 1); return (len); } pack_component_type = tvb_get_guint8(tvb, curr_offset); + tf = proto_tree_add_item(tf_tree, hf_gsm_a_sm_packet_filter_component_type_id, tvb, curr_offset, 1, ENC_NA); + comp_tree = proto_item_add_subtree(tf, ett_sm_tft); + curr_offset++; curr_len--; pf_length--; - tf = proto_tree_add_text(tf_tree, tvb, curr_offset-1, 1, "Packet filter component type identifier: "); - comp_tree = proto_item_add_subtree(tf, ett_sm_tft); - switch (pack_component_type) { case 0x10: - str = "IPv4 remote address type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_ip4_address, tvb, curr_offset, 4, ENC_BIG_ENDIAN); curr_offset += 4; curr_len -= 4; @@ -5311,7 +5232,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x11: - str = "IPv4 local address type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_ip4_address, tvb, curr_offset, 4, ENC_BIG_ENDIAN); curr_offset += 4; curr_len -= 4; @@ -5322,7 +5242,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x20: - str = "IPv6 remote address type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_ip6_address, tvb, curr_offset, 16, ENC_NA); curr_offset += 16; curr_len -= 16; @@ -5333,7 +5252,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x21: - str = "IPv6 remote address/prefix length type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_ip6_address, tvb, curr_offset, 16, ENC_NA); curr_offset += 16; curr_len -= 16; @@ -5344,7 +5262,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x23: - str = "IPv6 local address/prefix length type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_ip6_address, tvb, curr_offset, 16, ENC_NA); curr_offset += 16; curr_len -= 16; @@ -5355,7 +5272,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x30: - str = "Protocol identifier/Next header type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_protocol_header, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset += 1; curr_len -= 1; @@ -5363,7 +5279,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x40: - str = "Single local port type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_port, tvb, curr_offset, 2, ENC_BIG_ENDIAN); curr_offset += 2; curr_len -= 2; @@ -5371,7 +5286,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x41: - str = "Local port range type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_port_low, tvb, curr_offset, 2, ENC_BIG_ENDIAN); curr_offset += 2; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_port_high, tvb, curr_offset, 2, ENC_BIG_ENDIAN); @@ -5381,7 +5295,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x50: - str = "Single remote port type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_port, tvb, curr_offset, 2, ENC_BIG_ENDIAN); curr_offset += 2; curr_len -= 2; @@ -5389,7 +5302,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x51: - str = "Remote port range type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_port_low, tvb, curr_offset, 2, ENC_BIG_ENDIAN); curr_offset += 2; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_port_high, tvb, curr_offset, 2, ENC_BIG_ENDIAN); @@ -5399,7 +5311,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x60: - str = "Security parameter index type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_security, tvb, curr_offset, 4, ENC_BIG_ENDIAN); curr_offset += 4; curr_len -= 4; @@ -5408,7 +5319,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of case 0x70: - str = "Type of service/Traffic class type"; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_traffic_class, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset++; proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_traffic_mask, tvb, curr_offset, 1, ENC_BIG_ENDIAN); @@ -5418,7 +5328,6 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; case 0x80: - str = "Flow label type"; proto_tree_add_bits_item(comp_tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3), 4, ENC_BIG_ENDIAN); proto_tree_add_item(comp_tree, hf_gsm_a_sm_tft_flow_label_type, tvb, curr_offset, 3, ENC_BIG_ENDIAN); curr_offset += 3; @@ -5427,12 +5336,10 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of break; default: - str = "not specified"; curr_offset += pf_length; curr_len -= pf_length; pf_length = 0; } - proto_item_append_text(tf, "%s (%u)", str, pack_component_type); } count++; } @@ -5454,28 +5361,23 @@ de_sm_tflow_temp(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of curr_len -= 2; switch (param) { case 0x01: - proto_tree_add_text(tf_tree, tvb, curr_offset, pf_length, "Authorization token value: 0x%s", - tvb_bytes_to_str(wmem_packet_scope(), tvb, curr_offset, pf_length)); + proto_tree_add_item(tf_tree, hf_gsm_a_gm_authorization_token_value, tvb, curr_offset, pf_length, ENC_NA); break; case 0x02: - proto_tree_add_text(tf_tree, tvb, curr_offset, 2, "Media Component number value: 0x%x", - tvb_get_bits16(tvb, curr_offset<<3, 16, ENC_BIG_ENDIAN)); - proto_tree_add_text(tf_tree, tvb, curr_offset+2, 2, "IP flow number: 0x%x", - tvb_get_bits16(tvb, (curr_offset+2)<<3, 16, ENC_BIG_ENDIAN)); + proto_tree_add_item(tf_tree, hf_gsm_a_gm_media_component_number_value, tvb, curr_offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(tf_tree, hf_gsm_a_gm_ip_flow_number, tvb, curr_offset+2, 2, ENC_BIG_ENDIAN); break; case 0x03: for (i=0; i<pf_length; i++) { oct = tvb_get_guint8(tvb, curr_offset+i) & 0x0f; - proto_tree_add_text(tf_tree, tvb, curr_offset+i, 1, "Packet filter identifier %d: %d (%d)", - i, oct+1, oct); + proto_tree_add_uint_format(tf_tree, hf_gsm_a_gm_packet_filter_identifier, tvb, curr_offset+i, 1, oct+1, "Packet filter identifier %d: %d (%d)", i, oct+1, oct); } break; default: - proto_tree_add_text(tf_tree, tvb, curr_offset, pf_length, "Parameter content: 0x%s", - tvb_bytes_to_str(wmem_packet_scope(), tvb, curr_offset, pf_length)); + proto_tree_add_item(tf_tree, hf_gsm_a_gm_parameter_content, tvb, curr_offset, pf_length, ENC_NA); break; } curr_offset += pf_length; @@ -7570,6 +7472,11 @@ proto_register_gsm_a_gm(void) FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gsm_a_gm_imeisv_req_vals), 0x00, NULL, HFILL } }, + { &hf_gsm_a_gm_nsapi, + { "NSAPI", "gsm_a.gm.gmm.nsapi", + FT_UINT16, BASE_HEX_DEC, NULL, 0x0, + NULL, HFILL } + }, { &hf_gsm_a_gm_ac_ref_nr, { "A&C reference number", "gsm_a.gm.gmm.ac_ref_nr", FT_UINT8, BASE_DEC, NULL, 0x0, @@ -7620,6 +7527,11 @@ proto_register_gsm_a_gm(void) FT_UINT8, BASE_DEC, VALS(gsm_a_gm_update_type_vals), 0x07, NULL, HFILL } }, + { &hf_gsm_a_gm_gprs_timer, + { "GPRS Timer", "gsm_a.gm.gmm.gprs_timer", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, { &hf_gsm_a_gm_gprs_timer_unit, { "Unit", "gsm_a.gm.gmm.gprs_timer_unit", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_gprs_timer_unit_vals), 0xe0, @@ -7630,6 +7542,11 @@ proto_register_gsm_a_gm(void) FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } }, + { &hf_gsm_a_gm_gprs_timer2, + { "GPRS Timer", "gsm_a.gm.gmm.gprs_timer2", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, { &hf_gsm_a_gm_gprs_timer2_unit, { "Unit", "gsm_a.gm.gmm.gprs_timer2_unit", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_gprs_timer_unit_vals), 0xe0, @@ -7640,6 +7557,11 @@ proto_register_gsm_a_gm(void) FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } }, + { &hf_gsm_a_gm_gprs_timer3, + { "GPRS Timer", "gsm_a.gm.gmm.gprs_timer3", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, { &hf_gsm_a_gm_gprs_timer3_unit, { "Unit", "gsm_a.gm.gmm.gprs_timer3_unit", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_gprs_timer3_unit_vals), 0xe0, @@ -8445,10 +8367,47 @@ proto_register_gsm_a_gm(void) FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, + /* Generated from convert_proto_tree_add_text.pl */ + { &hf_gsm_a_gm_presence, { "Presence", "gsm_a.gm.gmm.presence", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_8psk_power_class, { "8PSK Power Class", "gsm_a.gm.8psk_power_class", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_8psk_power_class_vals), 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_rf_power_capability, { "RF Power Capability", "gsm_a.gm.rf_power_capability", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_a5_bits, { "A5 Bits", "gsm_a.gm.a5_bits", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_8psk_power_capability, { "8PSK Power Capability", "gsm_a.gm.8psk_power_capability", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_8psk_power_cap_vals), 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_extended_dtm_gprs_multi_slot_class, { "Extended DTM GPRS Multi Slot Class", "gsm_a.gm.extended_dtm_gprs_multi_slot_class", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_extended_dtm_gprs_multi_slot_class_vals), 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_extended_dtm_egprs_multi_slot_class, { "Extended DTM EGPRS Multi Slot Class", "gsm_a.gm.extended_dtm_egprs_multi_slot_class", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_extended_dtm_gprs_multi_slot_class_vals), 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_high_multislot_capability, { "High Multislot Capability", "gsm_a.gm.high_multislot_capability", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_gmsk_multislot_power_profile, { "GMSK Multislot Power Profile", "gsm_a.gm.gmsk_multislot_power_profile", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_gmsk_multislot_power_profile_vals), 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_8psk_multislot_power_profile, { "8-PSK Multislot Power Profile", "gsm_a.gm.8psk_multislot_power_profile", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_8psk_multislot_power_profile_vals), 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_update_result, { "Update Result", "gsm_a.gm.gmm.update_result", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_update_res_vals), 0x70, NULL, HFILL }}, + { &hf_gsm_a_gm_radio_priority_pdp, { "Radio Priority (PDP or SMS)", "gsm_a.gm.radio_priority_pdp", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_radio_prio_vals), 0x07, NULL, HFILL }}, + { &hf_gsm_a_gm_radio_priority_tom8, { "Radio Priority (TOM8)", "gsm_a.gm.radio_priority_tom8", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_radio_prio_vals), 0x07, NULL, HFILL }}, + { &hf_gsm_a_gm_configuration_protocol, { "Configuration Protocol", "gsm_a.gm.configuration_protocol", FT_UINT8, BASE_DEC, NULL, 0x7, NULL, HFILL }}, + { &hf_gsm_a_gm_sm_pco_length, { "Length", "gsm_a.gm.sm.pco_length", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_sm_pco_ipv6, { "IPv6", "gsm_a.gm.sm.pco_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_sm_pco_reject_code, { "Reject Code", "gsm_a.gm.sm.pco_reject_code", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_sm_pco_prefix_length, { "Prefix length", "gsm_a.gm.sm.pco_prefix_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_sm_pco_ipv4, { "IPv4", "gsm_a.gm.sm.pco_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_sm_pco_ipv4_link_mtu_size, { "IPv4 link MTU size", "gsm_a.gm.sm.pco_ipv4.link_mtu_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_sm_pdp_type_number, { "PDP type number", "gsm_a.gm.sm.pdp_type_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_sm_pdp_address, { "PDP address", "gsm_a.gm.sm.pdp_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_maximum_sdu_size, { "Maximum SDU size", "gsm_a.gm.maximum_sdu_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_ti_value, { "TI value", "gsm_a.gm.ti_value", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_packet_filter, { "Packet filter", "gsm_a.gm.packet_filter", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_packet_evaluation_precedence, { "Packet evaluation precedence", "gsm_a.gm.packet_evaluation_precedence", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_packet_filter_length, { "Packet filter length", "gsm_a.gm.packet_filter_length", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_authorization_token_value, { "Authorization token value", "gsm_a.gm.authorization_token_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_media_component_number_value, { "Media Component number value", "gsm_a.gm.media_component_number_value", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_ip_flow_number, { "IP flow number", "gsm_a.gm.ip_flow_number", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_packet_filter_identifier, { "Packet filter identifier", "gsm_a.gm.packet_filter_identifier", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_parameter_content, { "Parameter content", "gsm_a.gm.parameter_content", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_gsm_a_sm_packet_filter_component_type_id, { "Packet filter component type identifier", "gsm_a.gm.sm.packet_filter_component_type_id", FT_UINT8, BASE_DEC, VALS(packet_filter_component_type_vals), 0x0, NULL, HFILL }}, + { &hf_gsm_a_gm_sm_pco_ms, { "MS", "gsm_a.gm.sm.pco_ms", FT_UINT8, BASE_DEC, VALS(gsm_a_gm_ms_vals), 0x0, NULL, HFILL }}, }; static ei_register_info ei[] = { { &ei_gsm_a_gm_extraneous_data, { "gsm_a.gm.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }}, + { &ei_gsm_a_gm_not_enough_data, { "gsm_a.gm.not_enough_data", PI_PROTOCOL, PI_WARN, "Not enough data", EXPFILL }}, + { &ei_gsm_a_gm_undecoded, { "gsm_a.gm.undecoded", PI_UNDECODED, PI_WARN, "Not decoded", EXPFILL }}, }; expert_module_t* expert_gsm_a_gm; |