* Jason Lango <jal@netapp.com>
* Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-sdp.c,v 1.14 2000/11/13 01:43:02 guy Exp $
+ * $Id: packet-sdp.c,v 1.20 2001/01/25 06:14:14 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static int ett_sdp = -1;
-void
+static void
dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *sdp_tree;
const char *typename;
int datalen;
- CHECK_DISPLAY_AS_DATA(proto_sdp, tvb, pinfo, tree);
-
- pinfo->current_proto = "SDP";
-
/*
* As RFC 2327 says, "SDP is purely a format for session
* description - it does not incorporate a transport protocol,
* Show the SDP message a line at a time.
*/
section = 0;
- while (tvb_length_remaining(tvb, offset)) {
+ while (tvb_offset_exists(tvb, offset)) {
/*
* Find the end of the line.
*/
next_offset - offset,
"Invalid line: %s",
tvb_format_text(tvb, offset, next_offset - offset));
+ offset = next_offset;
continue;
}
value = line + 2;
&ett_sdp,
};
- proto_sdp = proto_register_protocol("Session Description Protocol", "sdp");
+ proto_sdp = proto_register_protocol("Session Description Protocol",
+ "SDP", "sdp");
/* proto_register_field_array(proto_sdp, hf, array_length(hf));*/
proto_register_subtree_array(ett, array_length(ett));
+
+ /*
+ * Register the dissector by name, so other dissectors can
+ * grab it by name rather than just referring to it directly
+ * (you can't refer to it directly from a plugin dissector
+ * on Windows without stuffing it into the Big Transfer Vector).
+ */
+ register_dissector("sdp", dissect_sdp, proto_sdp);
}