diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-11-16 11:44:20 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-11-16 11:44:20 +0000 |
commit | a7aba0a28890856d2570951c2b0a76c922fdfa72 (patch) | |
tree | bcc3d6ea4d23e60c7841a408e9b1876ed6a93106 /packet-mount.c | |
parent | 3a2f7f641a49b5eb9f369dcb29bc8a7cb1c50a91 (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-mount.c')
-rw-r--r-- | packet-mount.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/packet-mount.c b/packet-mount.c index fe2763a135..25e2376249 100644 --- a/packet-mount.c +++ b/packet-mount.c @@ -1,7 +1,7 @@ /* packet-mount.c * Routines for mount dissection * - * $Id: packet-mount.c,v 1.3 1999/11/15 17:16:51 nneul Exp $ + * $Id: packet-mount.c,v 1.4 1999/11/16 11:42:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -41,6 +41,7 @@ static int proto_mount = -1; static int hf_mount_path = -1; +static gint ett_mount = -1; int dissect_mount_dirpath_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) @@ -100,12 +101,16 @@ proto_register_mount(void) "Path", "mount.path", FT_STRING, BASE_DEC, NULL, 0, "Path" }}, }; + static gint *ett[] = { + &ett_mount, + }; proto_mount = proto_register_protocol("Mount Service", "mount"); proto_register_field_array(proto_mount, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); /* Register the protocol as RPC */ - rpc_init_prog(proto_mount, MOUNT_PROGRAM, ETT_MOUNT); + rpc_init_prog(proto_mount, MOUNT_PROGRAM, ett_mount); /* Register the procedure tables */ rpc_init_proc_table(MOUNT_PROGRAM, 1, mount1_proc); rpc_init_proc_table(MOUNT_PROGRAM, 3, mount3_proc); |