aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nb_rtpmux.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2009-08-29 02:32:33 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2009-08-29 02:32:33 +0000
commit6f3b791248d8287b5420de7c26aee77eaea0597d (patch)
tree290320c22d0b1669813010956d6dc72884f005e1 /epan/dissectors/packet-nb_rtpmux.c
parent23a709f2d6b26985dc0e182a82bc64bf317194e6 (diff)
Note what the 3GPP spec is for this protocol.
Suggest a possible less-weak heuristic. Note that we're not checking the T bit and handling RTP header compression. At least as I read TS 29.414, the length indicator isn't supposed to be zero; however, a length indicator of 0 doesn't keep us from dissecting further, so just don't bother dissecting the payload. We should, perhaps, add an expert info for this. We should perhaps also catch exceptions thrown when dissecting the RTP packet, so a malformed RTP packet will still let us continue dissecting the rest of the Nb packet. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29607 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-nb_rtpmux.c')
-rw-r--r--epan/dissectors/packet-nb_rtpmux.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/epan/dissectors/packet-nb_rtpmux.c b/epan/dissectors/packet-nb_rtpmux.c
index 637fd436fc..372bf663fe 100644
--- a/epan/dissectors/packet-nb_rtpmux.c
+++ b/epan/dissectors/packet-nb_rtpmux.c
@@ -1,5 +1,5 @@
/* packet-nb_rtpmux.c
- * Routines for 3GPP RTP Multiplex dissection
+ * Routines for 3GPP RTP Multiplex dissection, 3GPP TS 29.414
* Copyright 2009, ip.access ltd <amp@ipaccess.com>
*
* $Id$
@@ -69,6 +69,9 @@ dissect_nb_rtpmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* set the port on which to dissect it, or it needs to be a non-heuristic
* dissector and *require* that a user use "Decode As..." to decode
* traffic as Nb_RTPmux.
+ *
+ * Look for a payload that looks like an RTP packet, using the
+ * same (weakish) heuristics as RTP uses?
*/
/* Check that there's enough data */
@@ -102,6 +105,7 @@ dissect_nb_rtpmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
length+5, FALSE);
nb_rtpmux_tree = proto_item_add_subtree(ti, ett_nb_rtpmux);
+ /* XXX - what if the T bit is set? */
proto_tree_add_item(nb_rtpmux_tree,
hf_nb_rtpmux_compressed, tvb, offset, 1, FALSE);
dstport = (tvb_get_ntohs(tvb, offset) & 0x7fff) << 1;
@@ -111,28 +115,24 @@ dissect_nb_rtpmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
srcport = (tvb_get_ntohs(tvb, offset+3) & 0x7fff) << 1;
proto_tree_add_uint(nb_rtpmux_tree, hf_nb_rtpmux_srcport, tvb, offset+3, 2, srcport );
- if (length == 0)
+ if (length != 0)
{
- /* XXX - is an item with a zero-length payload always
- an end marker? */
- break;
- }
-
- /* We have an RTP payload. */
- if (rtpdissector)
- {
- captured_length = tvb_length_remaining(tvb, offset + 5);
- if (captured_length > (gint)length)
- captured_length = length;
- next_tvb = tvb_new_subset(tvb, offset+5, captured_length,
- length);
-
- call_dissector(rtpdissector, next_tvb, pinfo, nb_rtpmux_tree);
- }
- else
- {
- proto_tree_add_item(nb_rtpmux_tree,
- hf_nb_rtpmux_data, tvb, offset+5, length, FALSE);
+ /* We have an RTP payload. */
+ if (rtpdissector)
+ {
+ captured_length = tvb_length_remaining(tvb, offset + 5);
+ if (captured_length > (gint)length)
+ captured_length = length;
+ next_tvb = tvb_new_subset(tvb, offset+5, captured_length,
+ length);
+
+ call_dissector(rtpdissector, next_tvb, pinfo, nb_rtpmux_tree);
+ }
+ else
+ {
+ proto_tree_add_item(nb_rtpmux_tree,
+ hf_nb_rtpmux_data, tvb, offset+5, length, FALSE);
+ }
}
offset += 5+length;
}
@@ -163,7 +163,7 @@ proto_register_nb_rtpmux(void)
},
{ &hf_nb_rtpmux_dstport,
{ "Dst port", "nb_rtpmux.dstport",
- FT_UINT16, BASE_DEC, NULL, 0x00,
+ FT_UINT16, BASE_DEC, NULL, 0x0000,
NULL, HFILL }
},
{ &hf_nb_rtpmux_length,