diff options
author | martinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-11-23 11:01:48 +0000 |
---|---|---|
committer | martinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-11-23 11:01:48 +0000 |
commit | 6a6b7087939fce06f9b184bf40c54671dc55bf18 (patch) | |
tree | 8b827d181ef8cb6426c530b509ddabd752894d7f /epan/dissectors/packet-umts_fp.c | |
parent | 7a9cff54e0265ada8229f2b22a40d6e532d672e5 (diff) |
Check the DDI while dissecting the header.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35013 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-umts_fp.c')
-rw-r--r-- | epan/dissectors/packet-umts_fp.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c index 0dc678ab54..f65c36f9fb 100644 --- a/epan/dissectors/packet-umts_fp.c +++ b/epan/dissectors/packet-umts_fp.c @@ -2375,12 +2375,36 @@ static void dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_ int ddi_offset; guint64 n_pdus; int n_pdus_offset; + proto_item *ddi_ti; + gint ddi_size = -1; + int p; /* DDI (6 bits) */ ddi_offset = offset + (bit_offset / 8); - proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_ddi, tvb, - offset*8 + bit_offset, 6, &ddi, FALSE); + ddi_ti = proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_ddi, tvb, + offset*8 + bit_offset, 6, &ddi, FALSE); + + /* Look up the size from this DDI value */ + for (p=0; p < p_fp_info->no_ddi_entries; p++) + { + if (ddi == p_fp_info->edch_ddi[p]) + { + ddi_size = p_fp_info->edch_macd_pdu_size[p]; + break; + } + } + if (ddi_size == -1) + { + expert_add_info_format(pinfo, ddi_ti, + PI_MALFORMED, PI_ERROR, + "DDI %u not defined for this UE!", (guint)ddi); + return; + } + else + { + proto_item_append_text(ddi_ti, " (%d bits)", ddi_size); + } subframes[n].ddi[i] = (guint8)ddi; bit_offset += 6; |