A-bis/RSL: fix dissection of Mobile Allocation in CHANnel ACTIVation

According to 3GPP TS 48.058 (version 15.0.0), section 9.3.5,
3GPP TS 44.018 "Mobile Allocation" IE shall for compatibility
reasons be included but empty, i.e. the length shall be zero.

It does not mean that the Mobile Allocation IE should not be
decoded by Wireshark though. Some BSC implementations may still
be sending it with length greather than 0.

Let's expose de_rr_mob_all() and use it in dissect_rsl_ie_ch_id().
If the length is greather than 0, raise a protocol warning.

Change-Id: Idd0f2b3cd1e684f2c812b566fde71a1cc727c2c4
Signed-off-by: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
Reviewed-on: https://code.wireshark.org/review/37575
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Vadim Yanitskiy 2020-06-29 11:26:43 +07:00 committed by Anders Broman
parent 408bc4cb1d
commit 39b4d2eb3e
3 changed files with 23 additions and 7 deletions

View File

@ -774,6 +774,7 @@ guint16 de_rr_cip_mode_set(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
WS_DLL_PUBLIC
guint16 de_rr_cm_enq_mask(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
guint16 de_rr_meas_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
guint16 de_rr_mob_all(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
WS_DLL_PUBLIC
guint16 de_rr_multirate_conf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
WS_DLL_PUBLIC

View File

@ -4335,7 +4335,7 @@ de_rr_meas_res(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint
/*
* [3] 10.5.2.21 Mobile Allocation
*/
static guint16
guint16
de_rr_mob_all(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
{
guint32 curr_offset;

View File

@ -128,6 +128,7 @@ static int hf_rsl_cstat_avg_tx_dly = -1;
/* Generated from convert_proto_tree_add_text.pl */
static int hf_rsl_channel_description_tag = -1;
static int hf_rsl_mobile_allocation_tag = -1;
static int hf_rsl_mobile_allocation_len = -1;
static int hf_rsl_no_resources_required = -1;
static int hf_rsl_llsdu_ccch = -1;
static int hf_rsl_llsdu_sacch = -1;
@ -247,6 +248,7 @@ static int ett_phy_ctx_rxlvl_ext = -1;
static expert_field ei_rsl_speech_or_data_indicator = EI_INIT;
static expert_field ei_rsl_facility_information_element_3gpp_ts_44071 = EI_INIT;
static expert_field ei_rsl_embedded_message_tfo_configuration = EI_INIT;
static expert_field ei_rsl_mobile_allocation_deprecated = EI_INIT;
static proto_tree *top_tree;
static dissector_handle_t rsl_handle;
@ -1011,6 +1013,7 @@ dissect_rsl_ie_ch_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, in
{
proto_item *ti;
proto_tree *ie_tree;
guint32 ma_length;
guint8 length;
int ie_offset;
guint8 ie_id;
@ -1042,11 +1045,19 @@ dissect_rsl_ie_ch_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, in
proto_tree_add_item(ie_tree, hf_rsl_channel_description_tag, tvb, offset, 1, ENC_NA);
de_rr_ch_dsc(tvb, ie_tree, pinfo, offset+1, length, NULL, 0);
offset += 4;
/*
* The 3GPP TS 24.008 "Mobile Allocation" shall for compatibility reasons be
* included but empty, i.e. the length shall be zero.
*/
proto_tree_add_item(ie_tree, hf_rsl_mobile_allocation_tag, tvb, offset, 2, ENC_NA);
/* 3GPP TS 48.058 (version 15.0.0), section 9.3.5 "Channel Identification" states
* that the 3GPP TS 44.018 "Mobile Allocation" IE shall for compatibility reasons
* be included but empty, i.e. the length shall be zero. Decode it anyway. */
proto_tree_add_item(ie_tree, hf_rsl_mobile_allocation_tag, tvb, offset++, 1, ENC_NA);
proto_tree_add_item_ret_uint(ie_tree, hf_rsl_mobile_allocation_len,
tvb, offset++, 1, ENC_NA, &ma_length);
if (ma_length > 0) {
de_rr_mob_all(tvb, ie_tree, pinfo, offset, ma_length, NULL, 0);
proto_tree_add_expert(ie_tree, pinfo, &ei_rsl_mobile_allocation_deprecated,
tvb, offset, ma_length);
}
return ie_offset + length;
}
/*
@ -5047,7 +5058,8 @@ void proto_register_rsl(void)
},
/* Generated from convert_proto_tree_add_text.pl */
{ &hf_rsl_channel_description_tag, { "Channel Description Tag", "gsm_abis_rsl.channel_description_tag", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_mobile_allocation_tag, { "Mobile Allocation Tag+Length(0)", "gsm_abis_rsl.mobile_allocation_tag", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_mobile_allocation_tag, { "Mobile Allocation Tag", "gsm_abis_rsl.mobile_allocation_tag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_mobile_allocation_len, { "Mobile Allocation Length", "gsm_abis_rsl.mobile_allocation_len", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_no_resources_required, { "0 No resources required(All other values are reserved)", "gsm_abis_rsl.no_resources_required", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_llsdu_ccch, { "Link Layer Service Data Unit (L3 Message)(CCCH)", "gsm_abis_rsl.llsdu.ccch", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_llsdu_sacch, { "Link Layer Service Data Unit (L3 Message)(SACCH)", "gsm_abis_rsl.llsdu.sacch", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
@ -5142,6 +5154,9 @@ void proto_register_rsl(void)
{ &ei_rsl_speech_or_data_indicator, { "gsm_abis_rsl.speech_or_data_indicator.bad", PI_PROTOCOL, PI_WARN, "Speech or data indicator != 1,2 or 3", EXPFILL }},
{ &ei_rsl_facility_information_element_3gpp_ts_44071, { "gsm_abis_rsl.facility_information_element_3gpp_ts_44071", PI_PROTOCOL, PI_NOTE, "Facility Information Element as defined in 3GPP TS 44.071", EXPFILL }},
{ &ei_rsl_embedded_message_tfo_configuration, { "gsm_abis_rsl.embedded_message_tfo_configuration", PI_PROTOCOL, PI_NOTE, "Embedded message that contains the TFO configuration", EXPFILL }},
{ &ei_rsl_mobile_allocation_deprecated, { "gsm_abis_rsl.mobile_allocation_deprecated", PI_PROTOCOL, PI_NOTE,
"3GPP TS 24.008 Mobile Allocation IE shall for compatibility reasons "
"be included but empty (see 3GPP TS 48.058, section 9.3.5)", EXPFILL }},
};
module_t *rsl_module;