aboutsummaryrefslogtreecommitdiffstats
path: root/packet-lpd.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-lpd.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-lpd.c')
-rw-r--r--packet-lpd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/packet-lpd.c b/packet-lpd.c
index f1851c5cee..02a06b362d 100644
--- a/packet-lpd.c
+++ b/packet-lpd.c
@@ -2,7 +2,7 @@
* Routines for LPR and LPRng packet disassembly
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-lpd.c,v 1.12 1999/11/05 15:55:09 gram Exp $
+ * $Id: packet-lpd.c,v 1.13 1999/11/16 11:42:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -41,6 +41,8 @@ static int proto_lpd = -1;
static int hf_lpd_response = -1;
static int hf_lpd_request = -1;
+static gint ett_lpd = -1;
+
enum lpr_type { request, response };
void
@@ -98,7 +100,7 @@ dissect_lpd(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
if (tree) {
ti = proto_tree_add_item(tree, proto_lpd, offset,
END_OF_FRAME, NULL);
- lpd_tree = proto_item_add_subtree(ti, ETT_LPD);
+ lpd_tree = proto_item_add_subtree(ti, ett_lpd);
if (lpr_packet_type == response) {
proto_tree_add_item_hidden(lpd_tree, hf_lpd_response,
@@ -171,8 +173,11 @@ proto_register_lpd(void)
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"TRUE if LPD request" }}
};
+ static gint *ett[] = {
+ &ett_lpd,
+ };
proto_lpd = proto_register_protocol("Line Printer Daemon Protocol", "lpd");
proto_register_field_array(proto_lpd, hf, array_length(hf));
-
+ proto_register_subtree_array(ett, array_length(ett));
}