aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2010-10-08 11:03:08 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2010-10-08 11:03:08 +0000
commitf6ee7d8d4f62a49ca9da204c748069660c4419e7 (patch)
tree9c0d5bd780b9d708fd2f0cc4f4c19ab62caf3041
parent2239d905dbd3cf5eba7db0d11b63c55683b3dad1 (diff)
From Tobias Witek (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5283)
epan/dissectors/packet-umts_fp.c * Added mac subdissector (MAC) call to HSDSCH TYPE2 frames epan/dissectors/packet-umts_mac.c * Added support for HSDSCH TYPE2 frames by means of not nibble-shifting (4 bits) the SDU if MAC-ehs is used epan/dissectors/packet-rlc.c * Added support for "Use special value of the HE field" (3gpp 25.332-7a0 9.2.2.7) commonly used for Release 7 HSDPA. REMARK: although the specification mandates that the special value is only allowed when activated by higher layers (RRC), it is interpreted unconditionally. We assume this is OK, because a different use in future specifications is very unlikely. epan/dissectors/packet-fp_hint.c * Added decoding of MAC-ehs indicator for HSDSCH frames * Bumped fpi->release from 6 to 7 to enable proper HSDSCH TYPE2 frame decoding in the UTMS MAC parser. In general, this appears not to affect decoding of (conformant) FP frames of pevious releases. svn path=/trunk/; revision=34433
-rw-r--r--epan/dissectors/packet-fp_hint.c19
-rw-r--r--epan/dissectors/packet-rlc.c42
-rw-r--r--epan/dissectors/packet-umts_fp.c12
-rw-r--r--epan/dissectors/packet-umts_mac.c3
4 files changed, 53 insertions, 23 deletions
diff --git a/epan/dissectors/packet-fp_hint.c b/epan/dissectors/packet-fp_hint.c
index d88a797bcc..ce0b8f3df5 100644
--- a/epan/dissectors/packet-fp_hint.c
+++ b/epan/dissectors/packet-fp_hint.c
@@ -55,6 +55,7 @@ static int hf_fph_ctmux = -1;
static int hf_fph_ciphered = -1;
static int hf_fph_deciphered = -1;
static int hf_fph_macdflowid = -1;
+static int hf_fph_macehs = -1;
static int hf_fph_rb = -1;
static int hf_fph_ddi_entry = -1;
static int hf_fph_ddi_size = -1;
@@ -358,13 +359,18 @@ static void assign_fph_fach(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, f
static void assign_fph_hsdsch(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, fp_info *fpi, proto_tree *tree)
{
- guint8 rbcnt, macdflow_id;
+ guint8 rbcnt, hsdsch_info;
+ hsdsch_info = tvb_get_guint8(tvb, offset);
+ fpi->hsdsch_entity = hsdsch_info & 0x08 ? ehs : hs;
fpi->channel = CHANNEL_HSDSCH;
- macdflow_id = tvb_get_guint8(tvb, offset);
- if (tree)
- proto_tree_add_uint(tree, hf_fph_macdflowid, tvb, offset, 1, macdflow_id);
+ if (tree) {
+ proto_tree_add_bits_item(tree, hf_fph_macehs, tvb,
+ offset*8+4, 1, TRUE);
+ proto_tree_add_bits_item(tree, hf_fph_macdflowid, tvb,
+ offset*8+5, 3, TRUE);
+ }
offset++;
rbcnt = tvb_get_guint8(tvb, offset); offset++;
@@ -432,8 +438,8 @@ static void attach_info(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, guint
fpi->is_uplink = pinfo->p2p_dir == P2P_DIR_RECV;
/* TODO make this configurable */
- fpi->release = 6;
- fpi->release_year = 2006;
+ fpi->release = 7;
+ fpi->release_year = 2008;
fpi->release_month = 9;
fpi->dch_crc_present = 1;
@@ -537,6 +543,7 @@ proto_register_fp_hint(void)
{ &hf_fph_chcnt, { "Number of Channels", "fp_hint.num_chan", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
{ &hf_fph_dchid, { "DCH ID", "fp_hint.dchid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
{ &hf_fph_macdflowid, { "MACd Flow ID", "fp_hint.macdflowid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
+ { &hf_fph_macehs, { "MAC-ehs indicator", "fp_hint.mac_ehs", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } },
/* traffic format details */
{ &hf_fph_tf, { "Traffic Format", "fp_hint.tf", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
{ &hf_fph_tf_n, { "N", "fp_hint.tf.n", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } },
diff --git a/epan/dissectors/packet-rlc.c b/epan/dissectors/packet-rlc.c
index 4b2382ace5..cf29b6fbd1 100644
--- a/epan/dissectors/packet-rlc.c
+++ b/epan/dissectors/packet-rlc.c
@@ -118,6 +118,7 @@ static const true_false_string rlc_p_val = {
static const value_string rlc_he_vals[] = {
{ 0, "The succeeding octet contains data" },
{ 1, "The succeeding octet contains a length indicator and E bit" },
+ { 2, "The succeeding octet contains data and the last octet of the PDU is the last octet of an SDU" },
{ 0, NULL }
};
@@ -677,23 +678,26 @@ static tvbuff_t *get_reassembled_data(enum rlc_mode mode, tvbuff_t *tvb, packet_
if (!rlc_frag_equal(&lookup, sdu->reassembled_in)) return NULL;
#endif
- frag = sdu->frags;
- while (frag->next) {
- if (frag->next->seq - frag->seq > 1) {
- proto_item *pi = proto_tree_add_text(tree, tvb, 0, 0,
- "Error: Incomplete sequence");
- PROTO_ITEM_SET_GENERATED(pi);
- tree_add_fragment_list_incomplete(sdu, tvb, tree);
- return NULL;
+ if (tree) {
+ frag = sdu->frags;
+ while (frag->next) {
+ if (frag->next->seq - frag->seq > 1) {
+ proto_item *pi = proto_tree_add_text(tree, tvb, 0, 0,
+ "Error: Incomplete sequence");
+ PROTO_ITEM_SET_GENERATED(pi);
+ tree_add_fragment_list_incomplete(sdu, tvb, tree);
+ return NULL;
+ }
+ frag = frag->next;
}
- frag = frag->next;
}
sdu->tvb = tvb_new_real_data(sdu->data, sdu->len, sdu->len);
tvb_set_child_real_data_tvbuff(tvb, sdu->tvb);
add_new_data_source(pinfo, sdu->tvb, "Reassembled RLC Message");
/* reassembly happened here, so create the fragment list */
- tree_add_fragment_list(sdu, sdu->tvb, tree);
+ if (tree)
+ tree_add_fragment_list(sdu, sdu->tvb, tree);
return sdu->tvb;
}
@@ -1095,7 +1099,8 @@ static void dissect_rlc_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
}
static void rlc_am_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo, proto_tree *tree,
- proto_tree *top_level, enum channel_type channel, guint16 seq, struct rlc_li *li, guint16 num_li)
+ proto_tree *top_level, enum channel_type channel, guint16 seq, struct rlc_li *li, guint16 num_li,
+ gboolean final)
{
guint8 i;
gboolean piggyback = FALSE, dissected = FALSE;
@@ -1134,7 +1139,15 @@ static void rlc_am_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo, pr
ti = proto_tree_add_item(tree, hf_rlc_data, tvb, offs, -1, FALSE);
}
add_fragment(RLC_AM, tvb, pinfo, tree, offs, seq, i,
- tvb_length_remaining(tvb,offs), FALSE);
+ tvb_length_remaining(tvb,offs), final);
+ if (final) {
+ next_tvb = get_reassembled_data(RLC_AM, tvb, pinfo, NULL, seq, i);
+ }
+ }
+ if (next_tvb) {
+ dissected = TRUE;
+ rlc_call_subdissector(channel, next_tvb, pinfo, top_level);
+ next_tvb = NULL;
}
}
if (dissected == FALSE && check_col(pinfo->cinfo, COL_INFO))
@@ -1178,7 +1191,7 @@ static void dissect_rlc_am(enum channel_type channel, tvbuff_t *tvb, packet_info
}
/* header extension may only be 00 or 01 */
- if (ext > 1) {
+ if (ext > 2) {
proto_item *malformed;
malformed = proto_tree_add_protocol_format(tree,
proto_malformed, tvb, 0, 0, "[Malformed Packet: %s]", pinfo->current_proto);
@@ -1216,7 +1229,8 @@ static void dissect_rlc_am(enum channel_type channel, tvbuff_t *tvb, packet_info
proto_tree_add_uint(tree, hf_rlc_duplicate_of, tvb, 0, 0, orig_num);
return;
}
- rlc_am_reassemble(tvb, offs, pinfo, tree, top_level, channel, seq, li, num_li);
+ rlc_am_reassemble(tvb, offs, pinfo, tree, top_level, channel, seq, li, num_li,
+ ext == 2);
}
/* dissect entry functions */
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c
index e8682ad578..0f2eb88451 100644
--- a/epan/dissectors/packet-umts_fp.c
+++ b/epan/dissectors/packet-umts_fp.c
@@ -639,6 +639,7 @@ static int dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto
proto_item *pdus_ti = NULL;
proto_tree *data_tree = NULL;
int first_offset = offset;
+ gboolean dissected = FALSE;
/* Add data subtree */
if (tree)
@@ -659,6 +660,11 @@ static int dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto
pdu_ti = proto_tree_add_item(data_tree, hf_fp_mac_d_pdu, tvb,
offset, length, FALSE);
proto_item_set_text(pdu_ti, "MAC-d PDU (PDU %u)", pdu+1);
+ if (preferences_call_mac_dissectors) {
+ tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, length, -1);
+ call_dissector(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree);
+ dissected = TRUE;
+ }
}
/* Advance offset */
@@ -669,8 +675,10 @@ static int dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto
proto_item_set_len(pdus_ti, offset-first_offset);
/* Show summary in info column */
- col_append_fstr(pinfo->cinfo, COL_INFO, " %u PDUs of %u bits",
- number_of_pdus, length*8);
+ if (!dissected) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %u PDUs of %u bits",
+ number_of_pdus, length*8);
+ }
return offset;
}
diff --git a/epan/dissectors/packet-umts_mac.c b/epan/dissectors/packet-umts_mac.c
index 1d05072cd2..36b03d636d 100644
--- a/epan/dissectors/packet-umts_mac.c
+++ b/epan/dissectors/packet-umts_mac.c
@@ -509,7 +509,7 @@ static void dissect_mac_fdd_hsdsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
fp_info *fpinf;
umts_mac_info *macinf;
guint16 pos;
- guint8 bitoffs = 4;
+ guint8 bitoffs;
tvbuff_t *next_tvb;
proto_item *ti = NULL;
@@ -522,6 +522,7 @@ static void dissect_mac_fdd_hsdsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
fpinf = p_get_proto_data(pinfo->fd, proto_fp);
macinf = p_get_proto_data(pinfo->fd, proto_umts_mac);
pos = fpinf->cur_tb;
+ bitoffs = fpinf->hsdsch_entity == ehs ? 0 : 4;
if (!macinf) {
proto_tree_add_text(hsdsch_tree, tvb, 0, -1,