From Mike Morrin:

GSM ENHANCED MEASUREMENT REPORT PDUs were not
dissected when present as L3_INFO in RSL MEAS_RES PDUs.

It seems that the RSL L3_INFO needs to be handled by a different dissector
depending on whether it contains a DTAP, SACCH or CCCH PDU, which fortunately
can be deduced from the RSL PDU type.  packet-rsl.c is updated to implement
this.

In packet-gsm_a_rr.c the dissection of PDUs with RR Short PD format is
improved, and also some items are renamed to make clearer the difference
between SACCH PDUs (which cna be normal or Short PD format) and RR Short PD
format PDUs (which can occur on SACCH, CCCH, or DCH).

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6699

svn path=/trunk/; revision=40357
This commit is contained in:
Anders Broman 2012-01-01 19:57:47 +00:00
parent c1e296494d
commit 56188e9d27
6 changed files with 81 additions and 55 deletions

View File

@ -714,7 +714,7 @@ WS_VAR_IMPORT const value_string gsm_a_dtap_msg_sms_strings[];
WS_VAR_IMPORT const value_string gsm_a_dtap_msg_sm_strings[];
WS_VAR_IMPORT const value_string gsm_a_dtap_msg_ss_strings[];
WS_VAR_IMPORT const value_string gsm_a_dtap_msg_tp_strings[];
WS_VAR_IMPORT const value_string gsm_a_sacch_msg_rr_strings[];
WS_VAR_IMPORT const value_string gsm_a_rr_short_pd_msg_strings[];
WS_VAR_IMPORT const gchar *gsm_a_pd_str[];
extern const value_string gsm_a_qos_del_of_err_sdu_vals[];

View File

@ -439,7 +439,10 @@ static int proto_a_sacch = -1;
static int hf_gsm_a_dtap_msg_rr_type = -1;
int hf_gsm_a_rr_elem_id = -1;
static int hf_gsm_a_sacch_msg_rr_type = -1;
static int hf_gsm_a_rr_short_pd_msg_type = -1;
static int hf_gsm_a_rr_short_pd = -1;
static int hf_gsm_a_rr_short_l2_header = -1;
static int hf_gsm_a_bcc = -1;
static int hf_gsm_a_ncc = -1;
@ -10922,7 +10925,7 @@ dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
const value_string gsm_a_sacch_msg_rr_strings[] = {
const value_string gsm_a_rr_short_pd_msg_strings[] = {
{ 0x00, "System Information Type 10" },
{ 0x01, "Notification/FACCH" },
{ 0x02, "Uplink Free" },
@ -10935,7 +10938,7 @@ const value_string gsm_a_sacch_msg_rr_strings[] = {
{ 0, NULL }
};
#define NUM_GSM_SACCH_MSG_RR (sizeof(gsm_a_sacch_msg_rr_strings)/sizeof(value_string))
#define NUM_GSM_SACCH_MSG_RR (sizeof(gsm_a_rr_short_pd_msg_strings)/sizeof(value_string))
static gint ett_gsm_sacch_msg_rr[NUM_GSM_SACCH_MSG_RR];
static void (*sacch_msg_rr_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len) = {
NULL, /* System Information Type 10 */
@ -10955,8 +10958,8 @@ get_rr_short_pd_msg_params(guint8 mess_type, const gchar **msg_str, int *ett_tre
{
gint idx;
*msg_str = match_strval_idx((guint32) mess_type, gsm_a_sacch_msg_rr_strings, &idx);
*hf_idx = hf_gsm_a_sacch_msg_rr_type;
*msg_str = match_strval_idx((guint32) mess_type, gsm_a_rr_short_pd_msg_strings, &idx);
*hf_idx = hf_gsm_a_rr_short_pd_msg_type;
if (*msg_str != NULL) {
*ett_tree = ett_gsm_sacch_msg_rr[idx];
*msg_fcn_p = sacch_msg_rr_fcn[idx];
@ -10977,7 +10980,7 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len);
guint8 oct, short_pd, mess_type;
guint32 offset;
guint32 offset, bit_offset = 0;
guint32 len;
proto_item *sacch_item = NULL;
proto_tree *sacch_tree = NULL;
@ -11039,10 +11042,7 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (short_pd == 0)
proto_tree_add_text(sacch_tree,
tvb, offset, 1,
"Short Protocol Discriminator: %s",
val_to_str(short_pd, short_protocol_discriminator_vals, "Unknown (%u)"));
proto_tree_add_bits_item(sacch_tree, hf_gsm_a_rr_short_pd, tvb, offset * 8 + bit_offset++, 1, ENC_BIG_ENDIAN);
if (hf_idx == -1)
return;
@ -11050,12 +11050,10 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* add SACCH message name
*/
proto_tree_add_uint_format(sacch_tree, hf_idx, tvb, offset, 1, oct,
"Message Type: %s",msg_str ? msg_str : "(Unknown)");
proto_tree_add_text(sacch_tree, tvb, offset, 1,
"Short Layer 2 header: %u", oct & 0x03);
proto_tree_add_bits_item(sacch_tree, hf_gsm_a_rr_short_pd_msg_type, tvb, offset * 8 + bit_offset, 5, ENC_BIG_ENDIAN);
bit_offset += 5;
proto_tree_add_bits_item(sacch_tree, hf_gsm_a_rr_short_l2_header, tvb, offset * 8 + bit_offset, 2, ENC_BIG_ENDIAN);
offset++;
tap_p->pdu_type = GSM_A_PDU_TYPE_SACCH;
@ -12832,11 +12830,21 @@ proto_register_gsm_a_rr(void)
},
};
static hf_register_info hf_sacch[] =
static hf_register_info hf_rr_short_pd[] =
{
{ &hf_gsm_a_sacch_msg_rr_type,
{ "SACCH Radio Resources Management Message Type", "gsm_a.sacch_msg_rr_type",
FT_UINT8, BASE_HEX, VALS(gsm_a_sacch_msg_rr_strings), 0x0,
{ &hf_gsm_a_rr_short_pd,
{ "Radio Resources Short Protocol Discriminator", "gsm_a.rr_short_pd",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_gsm_a_rr_short_pd_msg_type,
{ "Radio Resources Short PD Message Type", "gsm_a.rr_short_pd_type",
FT_UINT8, BASE_HEX, VALS(gsm_a_rr_short_pd_msg_strings), 0x0,
NULL, HFILL }
},
{ &hf_gsm_a_rr_short_l2_header,
{ "Radio Resources Short L2 Header", "gsm_a.rr_short_l2_header",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
}
};
@ -12892,7 +12900,7 @@ proto_register_gsm_a_rr(void)
proto_a_sacch =
proto_register_protocol("GSM SACCH", "GSM SACCH", "gsm_a_sacch");
proto_register_field_array(proto_a_sacch, hf_sacch, array_length(hf_sacch));
proto_register_field_array(proto_a_sacch, hf_rr_short_pd, array_length(hf_rr_short_pd));
/* subdissector code */
register_dissector("gsm_a_sacch", dissect_sacch, proto_a_sacch);

View File

@ -173,8 +173,7 @@ static int ett_ie_sys_info_type = -1;
static proto_tree *top_tree;
static dissector_handle_t gsm_a_ccch_handle;
static dissector_handle_t gsm_a_dtap_handle;
static gboolean is_si2q = FALSE;
static dissector_handle_t gsm_a_sacch_handle;
/* Forward declarations */
static int dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
@ -1107,6 +1106,12 @@ dissect_rsl_ie_l1_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, i
return offset;
}
typedef enum
{
L3_INF_CCCH,
L3_INF_SACCH,
L3_INF_OTHER
}l3_inf_t;
/*
* 9.3.11 L3 Information 9.3.11 M TLV >=3
*
@ -1115,7 +1120,7 @@ dissect_rsl_ie_l1_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, i
* 3GPP TS 24.008 or 3GPP TS 44.018 between BTS and BSC.
*/
static int
dissect_rsl_ie_L3_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean is_mandatory)
dissect_rsl_ie_L3_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean is_mandatory, l3_inf_t type)
{
proto_item *ti;
proto_tree *ie_tree;
@ -1141,12 +1146,29 @@ dissect_rsl_ie_L3_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset= offset+2;
/* Link Layer Service Data Unit (i.e. a layer 3 message
* as defined in 3GPP TS 24.008 or 3GPP TS 44.018)
*/
proto_tree_add_text(ie_tree, tvb,offset,length,"Link Layer Service Data Unit ( L3 Message)");
next_tvb = tvb_new_subset(tvb, offset, length, length);
call_dissector(gsm_a_dtap_handle, next_tvb, pinfo, top_tree);
if (type == L3_INF_CCCH)
{
/* L3 PDUs carried on CCCH have L2 PSEUDO LENGTH octet or are RR Short PD format */
proto_tree_add_text(ie_tree, tvb,offset,length,"Link Layer Service Data Unit ( L3 Message)(SACCH)");
next_tvb = tvb_new_subset(tvb, offset, length, length);
call_dissector(gsm_a_ccch_handle, next_tvb, pinfo, top_tree);
}
else if (type == L3_INF_SACCH)
{
/* L3 PDUs carried on SACCH are normal format or are RR Short PD format */
proto_tree_add_text(ie_tree, tvb,offset,length,"Link Layer Service Data Unit ( L3 Message)(SACCH)");
next_tvb = tvb_new_subset(tvb, offset, length, length);
call_dissector(gsm_a_sacch_handle, next_tvb, pinfo, top_tree);
}
else
{
/* Link Layer Service Data Unit (i.e. a layer 3 message
* as defined in 3GPP TS 24.008 or 3GPP TS 44.018)
*/
proto_tree_add_text(ie_tree, tvb,offset,length,"Link Layer Service Data Unit ( L3 Message)");
next_tvb = tvb_new_subset(tvb, offset, length, length);
call_dissector(gsm_a_dtap_handle, next_tvb, pinfo, top_tree);
}
offset = offset + length;
@ -1606,7 +1628,7 @@ dissect_rsl_ie_rlm_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
* 9.3.23 Starting Time
*/
static int
dissect_rsl_ie_staring_time(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
dissect_rsl_ie_starting_time(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
{
proto_item *ti;
proto_tree *ie_tree;
@ -1878,7 +1900,7 @@ dissect_rsl_ie_sys_info_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
{
proto_item *ti;
proto_tree *ie_tree;
guint8 ie_id, sitype;
guint8 ie_id;
if(is_mandatory == FALSE){
ie_id = tvb_get_guint8(tvb,offset);
@ -1894,13 +1916,8 @@ dissect_rsl_ie_sys_info_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
offset++;
/* Message Type */
proto_tree_add_item(tree, hf_rsl_sys_info_type, tvb, offset, 1, ENC_BIG_ENDIAN);
sitype = tvb_get_guint8(tvb, offset);
offset++;
/* Check if SI is 2q, if so set flag */
if (sitype==0x29) {
is_si2q = TRUE; }
return offset;
}
@ -2939,7 +2956,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Link Identifier 9.3.2 M TV 2 */
offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
/* L3 Information 9.3.11 M TLV >=3 */
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, TRUE);
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, TRUE, L3_INF_OTHER);
break;
/* 8.3.2 DATA INDICATION */
case RSL_MSG_TYPE_DATA_IND:
@ -2948,7 +2965,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Link Identifier 9.3.2 M TV 2 */
offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
/* L3 Information 9.3.11 M TLV >=3 */
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, TRUE);
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, TRUE, L3_INF_OTHER);
break;
/* 8.3.3 ERROR INDICATION */
case RSL_MSG_TYPE_ERROR_IND:
@ -2981,7 +2998,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
/* L3 Information 9.3.11 O (note 1) TLV 3-23 */
if(tvb_length_remaining(tvb,offset) >1)
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE);
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE, L3_INF_OTHER);
break;
/* 8.3.7 RELEASE REQUEST */
case RSL_MSG_REL_REQ:
@ -3014,7 +3031,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
/* L3 Information 9.3.11 O (note 1) TLV 3-23 */
if(tvb_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE);
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE, L3_INF_OTHER);
break;
/* Common Channel Management/TRX Management messages */
/* 8.5.1 BCCH INFORMATION 17*/
@ -3028,7 +3045,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
offset = dissect_rsl_ie_full_bcch_inf(tvb, pinfo, tree, offset, TRUE);
/* Starting Time 9.3.23 O 2) TV 3 */
if(tvb_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_staring_time(tvb, pinfo, tree, offset, FALSE);
offset = dissect_rsl_ie_starting_time(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.5.2 CCCH LOAD INDICATION 18*/
case RSL_MSG_CCCH_LOAD_IND:
@ -3103,10 +3120,10 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
offset = dissect_rsl_ie_sys_info_type(tvb, pinfo, tree, offset, TRUE);
/* L3 Info (SYS INFO) 9.3.11 O 1) TLV 22 */
if(tvb_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE);
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE, L3_INF_CCCH);
/* Starting Time 9.3.23 O 2) TV 3 */
if(tvb_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_staring_time(tvb, pinfo, tree, offset, FALSE);
offset = dissect_rsl_ie_starting_time(tvb, pinfo, tree, offset, FALSE);
break;
case RSL_MSG_OVERLOAD: /* 27 8.6.3 */
/* Cause 9.3.26 M TLV >=3 */
@ -3253,7 +3270,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* Link Identifier 9.3.2 M TV 2 */
offset = dissect_rsl_ie_link_id(tvb, pinfo, tree, offset, TRUE);
/* L3 Info (CIPH MOD CMD) 9.3.11 M TLV 6 */
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, TRUE);
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, TRUE, L3_INF_OTHER);
break;
/* 8.4.7 HANDOVER DETECTION */
case RSL_MSG_HANDODET: /* 39 8.4.7 */
@ -3278,7 +3295,7 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
offset = dissect_rsl_ie_l1_inf(tvb, pinfo, tree, offset, FALSE);
/* L3 Info (MEAS REP, EXT MEAS REP or ENH MEAS REP) 9.3.11 O 1) TLV 21 */
if(tvb_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE);
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE, L3_INF_SACCH);
/* MS Timing Offset 9.3.37 O 2) TV 2 */
if(tvb_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_ms_timing_offset(tvb, pinfo, tree, offset, FALSE);
@ -3386,10 +3403,10 @@ dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
offset = dissect_rsl_ie_sys_info_type(tvb, pinfo, tree, offset, TRUE);
/* L3 Info 9.3.11 O 1) TLV 22 */
if(tvb_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE);
offset = dissect_rsl_ie_L3_inf(tvb, pinfo, tree, offset, FALSE, L3_INF_SACCH);
/* Starting Time 9.3.23 O 2) TV 3 */
if(tvb_length_remaining(tvb,offset) > 0)
offset = dissect_rsl_ie_staring_time(tvb, pinfo, tree, offset, FALSE);
offset = dissect_rsl_ie_starting_time(tvb, pinfo, tree, offset, FALSE);
break;
/* 8.4.21 TALKER DETECTION */
case RSL_MSG_TALKER_DET: /* 53 8.4.21 */
@ -3970,5 +3987,6 @@ proto_reg_handoff_rsl(void)
gsm_a_ccch_handle = find_dissector("gsm_a_ccch");
gsm_a_dtap_handle = find_dissector("gsm_a_dtap");
gsm_a_sacch_handle = find_dissector("gsm_a_sacch");
}

View File

@ -594,7 +594,7 @@ gsm_a_dtap_msg_sm_strings DATA
gsm_a_dtap_msg_sms_strings DATA
gsm_a_dtap_msg_ss_strings DATA
gsm_a_dtap_msg_tp_strings DATA
gsm_a_sacch_msg_rr_strings DATA
gsm_a_rr_short_pd_msg_strings DATA
gsm_a_pd_str DATA
gsm_map_opr_code_strings DATA
gtcap_StatSRT DATA

View File

@ -377,7 +377,7 @@ gsm_a_stat_draw(
{
gsm_a_stat_draw_aux(&dlg_sacch_rr,
stat_p->sacch_rr_message_type,
gsm_a_sacch_msg_rr_strings);
gsm_a_rr_short_pd_msg_strings);
}
}

View File

@ -303,14 +303,14 @@ gsm_a_stat_draw(
printf("Message (ID)Type Number\n");
i = 0;
while (gsm_a_sacch_msg_rr_strings[i].strptr)
while (gsm_a_rr_short_pd_msg_strings[i].strptr)
{
if (stat_p->sacch_rr_message_type[gsm_a_sacch_msg_rr_strings[i].value] > 0)
if (stat_p->sacch_rr_message_type[gsm_a_rr_short_pd_msg_strings[i].value] > 0)
{
printf("0x%02x %-50s%d\n",
gsm_a_sacch_msg_rr_strings[i].value,
gsm_a_sacch_msg_rr_strings[i].strptr,
stat_p->sacch_rr_message_type[gsm_a_sacch_msg_rr_strings[i].value]);
gsm_a_rr_short_pd_msg_strings[i].value,
gsm_a_rr_short_pd_msg_strings[i].strptr,
stat_p->sacch_rr_message_type[gsm_a_rr_short_pd_msg_strings[i].value]);
}
i++;