diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-11-16 11:44:20 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-11-16 11:44:20 +0000 |
commit | e4c62806db219ae013652ae479827fb38a0a9635 (patch) | |
tree | bcc3d6ea4d23e60c7841a408e9b1876ed6a93106 /packet-aarp.c | |
parent | 8f0f1f9ae49aca3671a8c4c3aa81858684a4f05c (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1043 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-aarp.c')
-rw-r--r-- | packet-aarp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packet-aarp.c b/packet-aarp.c index 757a79cc51..d7b51c5bf8 100644 --- a/packet-aarp.c +++ b/packet-aarp.c @@ -1,7 +1,7 @@ /* packet-aarp.c * Routines for Appletalk ARP packet disassembly * - * $Id: packet-aarp.c,v 1.13 1999/11/04 08:21:04 guy Exp $ + * $Id: packet-aarp.c,v 1.14 1999/11/16 11:42:23 guy Exp $ * * Simon Wilkinson <sxw@dcs.ed.ac.uk> * @@ -44,6 +44,8 @@ static int hf_aarp_src_id = -1; static int hf_aarp_dst_ether = -1; static int hf_aarp_dst_id = -1; +static gint ett_aarp = -1; + #ifndef AARP_REQUEST #define AARP_REQUEST 0x0001 #endif @@ -185,7 +187,7 @@ dissect_aarp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { MIN_AARP_HEADER_SIZE + 2*ar_hln + 2*ar_pln, NULL, "Unknown AARP (opcode 0x%04x)", ar_op); - aarp_tree = proto_item_add_subtree(ti, ETT_AARP); + aarp_tree = proto_item_add_subtree(ti, ett_aarp); proto_tree_add_item(aarp_tree, hf_aarp_hard_type, offset + AR_HRD, 2, ar_hrd); proto_tree_add_item(aarp_tree, hf_aarp_proto_type, offset + AR_PRO, 2, @@ -260,8 +262,12 @@ proto_register_aarp(void) FT_BYTES, BASE_HEX, NULL, 0x0, "" }}, }; + static gint *ett[] = { + &ett_aarp, + }; proto_aarp = proto_register_protocol("Appletalk Address Resolution Protocol", "aarp"); proto_register_field_array(proto_aarp, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); } |