From a7aba0a28890856d2570951c2b0a76c922fdfa72 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 16 Nov 1999 11:44:20 +0000 Subject: 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 --- packet-ypserv.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'packet-ypserv.c') diff --git a/packet-ypserv.c b/packet-ypserv.c index 15b414972b..667bc65b98 100644 --- a/packet-ypserv.c +++ b/packet-ypserv.c @@ -1,7 +1,7 @@ /* packet-ypserv.c * Routines for ypserv dissection * - * $Id: packet-ypserv.c,v 1.5 1999/11/15 17:16:51 nneul Exp $ + * $Id: packet-ypserv.c,v 1.6 1999/11/16 11:43:04 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -45,6 +45,8 @@ static int hf_ypserv_key = -1; static int hf_ypserv_value = -1; static int hf_ypserv_status = -1; +static gint ett_ypserv = -1; + /* Dissect a domain call */ int dissect_domain_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) @@ -233,14 +235,17 @@ proto_register_ypserv(void) "Status", "ypserv.status", FT_BOOLEAN, BASE_DEC, &okfailed , 0, "Status" }}, }; + static gint *ett[] = { + &ett_ypserv, + }; proto_ypserv = proto_register_protocol("Yellow Pages Service", "ypserv"); proto_register_field_array(proto_ypserv, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); /* Register the protocol as RPC */ - rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ETT_YPSERV); + rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ett_ypserv); /* Register the procedure tables */ rpc_init_proc_table(YPSERV_PROGRAM, 1, ypserv1_proc); rpc_init_proc_table(YPSERV_PROGRAM, 2, ypserv2_proc); } - -- cgit v1.2.3