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-imap.c | |
parent | 3a2f7f641a49b5eb9f369dcb29bc8a7cb1c50a91 (diff) | |
download | wireshark-a7aba0a28890856d2570951c2b0a76c922fdfa72.tar.gz wireshark-a7aba0a28890856d2570951c2b0a76c922fdfa72.tar.bz2 wireshark-a7aba0a28890856d2570951c2b0a76c922fdfa72.zip |
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-imap.c')
-rw-r--r-- | packet-imap.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packet-imap.c b/packet-imap.c index 15135c19cd..2561e80ca7 100644 --- a/packet-imap.c +++ b/packet-imap.c @@ -2,7 +2,7 @@ * Routines for imap packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-imap.c,v 1.2 1999/11/14 10:48:17 deniel Exp $ + * $Id: packet-imap.c,v 1.3 1999/11/16 11:42:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -47,6 +47,8 @@ static int proto_imap = -1; static int hf_imap_response = -1; static int hf_imap_request = -1; +static gint ett_imap = -1; + void dissect_imap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { @@ -88,7 +90,7 @@ dissect_imap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { ti = proto_tree_add_item(tree, proto_imap, offset, END_OF_FRAME, NULL); - imap_tree = proto_item_add_subtree(ti, ETT_IMAP); + imap_tree = proto_item_add_subtree(ti, ett_imap); if (pi.match_port == pi.destport) { /* Request */ @@ -123,8 +125,12 @@ proto_register_imap(void) FT_BOOLEAN, BASE_NONE, NULL, 0x0, "TRUE if IMAP request" }} }; + static gint *ett[] = { + &ett_imap, + }; proto_imap = proto_register_protocol("Internet Message Access Protocol", "imap"); proto_register_field_array(proto_imap, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); } |