* Jason Lango <jal@netapp.com>
* Liberally copied from packet-http.c, by Guy Harris <guy@netapp.com>
*
- * $Id: packet-sdp.c,v 1.1 1999/07/07 00:34:56 guy Exp $
+ * $Id: packet-sdp.c,v 1.4 1999/11/16 11:42:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#include <glib.h>
#include "packet.h"
+static int proto_sdp = -1;
+
+static int ett_sdp = -1;
+
void dissect_sdp(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree)
{
if (!tree)
return;
- ti = proto_tree_add_item(tree, offset, END_OF_FRAME,
- "Session Description Protocol");
- sdp_tree = proto_tree_new();
- proto_item_add_subtree(ti, sdp_tree, ETT_SDP);
+ ti = proto_tree_add_item(tree, proto_sdp, offset, END_OF_FRAME, NULL);
+ sdp_tree = proto_item_add_subtree(ti, ett_sdp);
section = 0;
for (; data < dataend; offset += linelen, data = lineend) {
type = data[0];
if (data[1] != '=') {
- proto_tree_add_item(sdp_tree, offset, linelen,
+ proto_tree_add_text(sdp_tree, offset, linelen,
"Invalid line: %s",
format_text(data, linelen));
continue;
break;
}
- proto_tree_add_item(sdp_tree, offset, linelen,
+ proto_tree_add_text(sdp_tree, offset, linelen,
"%s (%c): %s", typename, type,
format_text(value, valuelen));
}
if (data < dataend) {
- proto_tree_add_item(sdp_tree, offset, END_OF_FRAME,
+ proto_tree_add_text(sdp_tree, offset, END_OF_FRAME,
"Data (%d bytes)", END_OF_FRAME);
}
}
+
+void
+proto_register_sdp(void)
+{
+/* static hf_register_info hf[] = {
+ { &variable,
+ { "Name", "sdp.abbreviation", TYPE, VALS_POINTER }},
+ };*/
+ static gint *ett[] = {
+ &ett_sdp,
+ };
+
+ proto_sdp = proto_register_protocol("Session Description Protocol", "sdp");
+ /* proto_register_field_array(proto_sdp, hf, array_length(hf));*/
+ proto_register_subtree_array(ett, array_length(ett));
+}