Add RFC 1702 GRE-over-IPv4.
[obnox/wireshark/wip.git] / packet-sdp.c
index 25f5f28a83e323451ddce0918e6b49a0ba3bfdfe..ec10169380d37ef260780d17e9415a47d8b1b8f0 100644 (file)
@@ -4,7 +4,7 @@
  * 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)
 {
@@ -68,10 +72,8 @@ void dissect_sdp(const u_char *pd, int offset, frame_data *fd,
        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) {
@@ -89,7 +91,7 @@ void dissect_sdp(const u_char *pd, int offset, frame_data *fd,
 
                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;
@@ -164,13 +166,29 @@ void dissect_sdp(const u_char *pd, int offset, frame_data *fd,
                        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));
+}