aboutsummaryrefslogtreecommitdiffstats
path: root/packet-clip.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1999-11-16 11:44:20 +0000
committerGuy Harris <guy@alum.mit.edu>1999-11-16 11:44:20 +0000
commita7aba0a28890856d2570951c2b0a76c922fdfa72 (patch)
treebcc3d6ea4d23e60c7841a408e9b1876ed6a93106 /packet-clip.c
parent3a2f7f641a49b5eb9f369dcb29bc8a7cb1c50a91 (diff)
Replace the ETT_ "enum" members, declared in "packet.h", with
dynamically-assigned "ett_" integer values, assigned by "proto_register_subtree_array()"; this: obviates the need to update "packet.h" whenever you add a new subtree type - you only have to add a call to "proto_register_subtree_array()" to a "register" routine and an array of pointers to "ett_", if they're not already there, and add a pointer to the new "ett_" variable to the array, if they are there; would allow run-time-loaded dissectors to allocate subtree types when they're loaded. svn path=/trunk/; revision=1043
Diffstat (limited to 'packet-clip.c')
-rw-r--r--packet-clip.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/packet-clip.c b/packet-clip.c
index b2f64cd216..cfc4c0fd50 100644
--- a/packet-clip.c
+++ b/packet-clip.c
@@ -1,7 +1,7 @@
/* packet-clip.c
* Routines for clip packet disassembly
*
- * $Id: packet-clip.c,v 1.2 1999/08/24 06:16:27 guy Exp $
+ * $Id: packet-clip.c,v 1.3 1999/11/16 11:42:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -36,6 +36,8 @@
#include <glib.h>
#include "packet.h"
+static gint ett_clip = -1;
+
void
capture_clip( const u_char *pd, guint32 cap_len, packet_counts *ld ) {
@@ -70,8 +72,18 @@ dissect_clip( const u_char *pd, frame_data *fd, proto_tree *tree ) {
header. */
if(tree) {
ti = proto_tree_add_text(tree, 0, 0, "Classical IP frame" );
- fh_tree = proto_item_add_subtree(ti, ETT_CLIP);
+ fh_tree = proto_item_add_subtree(ti, ett_clip);
proto_tree_add_text(fh_tree, 0, 0, "No link information available");
}
dissect_ip(pd, 0, fd, tree);
}
+
+void
+proto_register_clip(void)
+{
+ static gint *ett[] = {
+ &ett_clip,
+ };
+
+ proto_register_subtree_array(ett, array_length(ett));
+}