summaryrefslogtreecommitdiff
path: root/packet-bootparams.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-bootparams.c
parent3a2f7f641a49b5eb9f369dcb29bc8a7cb1c50a91 (diff)
downloadwireshark-a7aba0a28890856d2570951c2b0a76c922fdfa72.tar.gz
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-bootparams.c')
-rw-r--r--packet-bootparams.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/packet-bootparams.c b/packet-bootparams.c
index a07b2ca60c..c7491fff10 100644
--- a/packet-bootparams.c
+++ b/packet-bootparams.c
@@ -1,7 +1,7 @@
/* packet-bootparams.c
* Routines for bootparams dissection
*
- * $Id: packet-bootparams.c,v 1.5 1999/11/15 17:16:50 nneul Exp $
+ * $Id: packet-bootparams.c,v 1.6 1999/11/16 11:42:27 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -50,6 +50,8 @@ static int hf_bootparams_filepath = -1;
static int hf_bootparams_hostaddr = -1;
static int hf_bootparams_routeraddr = -1;
+static gint ett_bootparams = -1;
+
int dissect_bp_address(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree, int hfindex)
{
@@ -172,12 +174,16 @@ proto_register_bootparams(void)
"Router Address", "bootparams.routeraddr", FT_IPv4, BASE_DEC,
NULL, 0, "Router Address" }},
};
+ static gint *ett[] = {
+ &ett_bootparams,
+ };
proto_bootparams = proto_register_protocol("Boot Parameters", "bootparams");
proto_register_field_array(proto_bootparams, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_bootparams, BOOTPARAMS_PROGRAM, ETT_BOOTPARAMS);
+ rpc_init_prog(proto_bootparams, BOOTPARAMS_PROGRAM, ett_bootparams);
/* Register the procedure tables */
rpc_init_proc_table(BOOTPARAMS_PROGRAM, 1, bootparams1_proc);
}