aboutsummaryrefslogtreecommitdiffstats
path: root/packet-fddi.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-11-16 11:44:20 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-11-16 11:44:20 +0000
commite4c62806db219ae013652ae479827fb38a0a9635 (patch)
treebcc3d6ea4d23e60c7841a408e9b1876ed6a93106 /packet-fddi.c
parent8f0f1f9ae49aca3671a8c4c3aa81858684a4f05c (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1043 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-fddi.c')
-rw-r--r--packet-fddi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/packet-fddi.c b/packet-fddi.c
index 6f9538bb14..cdfae657b5 100644
--- a/packet-fddi.c
+++ b/packet-fddi.c
@@ -3,7 +3,7 @@
*
* Laurent Deniel <deniel@worldnet.fr>
*
- * $Id: packet-fddi.c,v 1.24 1999/10/22 07:17:31 guy Exp $
+ * $Id: packet-fddi.c,v 1.25 1999/11/16 11:42:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -43,6 +43,8 @@ static int hf_fddi_fc = -1;
static int hf_fddi_dst = -1;
static int hf_fddi_src = -1;
+static gint ett_fddi = -1;
+
/* FDDI Frame Control values */
#define FDDI_FC_VOID 0x00 /* Void frame */
@@ -296,7 +298,7 @@ void dissect_fddi(const u_char *pd, frame_data *fd, proto_tree *tree,
swap_mac_addr(dst_swapped, (u_char*)&pd[FDDI_P_DHOST]);
swap_mac_addr(src_swapped, (u_char*)&pd[FDDI_P_SHOST]);
- fh_tree = proto_item_add_subtree(ti, ETT_FDDI);
+ fh_tree = proto_item_add_subtree(ti, ett_fddi);
proto_tree_add_item(fh_tree, hf_fddi_fc, FDDI_P_FC, 1, fc);
proto_tree_add_item(fh_tree, hf_fddi_dst, FDDI_P_DHOST, 6, dst);
proto_tree_add_item(fh_tree, hf_fddi_src, FDDI_P_SHOST, 6, src);
@@ -358,7 +360,11 @@ proto_register_fddi(void)
{ "Source", "fddi.src", FT_ETHER, BASE_NONE, NULL, 0x0,
"" }},
};
+ static gint *ett[] = {
+ &ett_fddi,
+ };
proto_fddi = proto_register_protocol ("Fiber Distributed Data Interface", "fddi" );
proto_register_field_array(proto_fddi, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}