diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-05-31 05:09:07 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-05-31 05:09:07 +0000 |
commit | 283ce59938ad2be252a6232e40a958e177a40e1a (patch) | |
tree | b451d4a712d9b914022ba872296e70e55b8d9bc5 /packet-eth.c | |
parent | aa553f63ecc7b9e310a05b743502c50f6dffb800 (diff) | |
download | wireshark-283ce59938ad2be252a6232e40a958e177a40e1a.tar.gz wireshark-283ce59938ad2be252a6232e40a958e177a40e1a.tar.bz2 wireshark-283ce59938ad2be252a6232e40a958e177a40e1a.zip |
Add routines for adding items to a protocol tree that take arguments of
a particular type, rather than taking a varargs list, along the lines of
the "proto_tree_add_XXX_format()" routines.
Replace most calls to "proto_tree_add_item()" and
"proto_tree_add_item_hidden()" with calls to those routines.
Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to
"proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and
add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()"
routines that don't take the item to be added as an argument - instead,
they fetch the argument from the packet whose tvbuff was handed to them,
from the offset handed to them.
svn path=/trunk/; revision=2031
Diffstat (limited to 'packet-eth.c')
-rw-r--r-- | packet-eth.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/packet-eth.c b/packet-eth.c index 3218d0caa3..65ce8b3c1b 100644 --- a/packet-eth.c +++ b/packet-eth.c @@ -1,7 +1,7 @@ /* packet-eth.c * Routines for ethernet packet disassembly * - * $Id: packet-eth.c,v 1.41 2000/05/19 05:29:44 guy Exp $ + * $Id: packet-eth.c,v 1.42 2000/05/31 05:07:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -223,14 +223,14 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) fh_tree = proto_item_add_subtree(ti, ett_ieee8023); - proto_tree_add_item(fh_tree, hf_eth_dst, tvb, 0, 6, dst); - proto_tree_add_item(fh_tree, hf_eth_src, tvb, 6, 6, src); + proto_tree_add_ether(fh_tree, hf_eth_dst, tvb, 0, 6, dst); + proto_tree_add_ether(fh_tree, hf_eth_src, tvb, 6, 6, src); /* add items for eth.addr filter */ - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, tvb, 0, 6, dst); - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, tvb, 6, 6, src); + proto_tree_add_ether_hidden(fh_tree, hf_eth_addr, tvb, 0, 6, dst); + proto_tree_add_ether_hidden(fh_tree, hf_eth_addr, tvb, 6, 6, src); - proto_tree_add_item(fh_tree, hf_eth_len, tvb, 12, 2, length); + proto_tree_add_uint(fh_tree, hf_eth_len, tvb, 12, 2, length); } /* Convert the LLC length from the 802.3 header to a total @@ -254,11 +254,11 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) fh_tree = proto_item_add_subtree(ti, ett_ether2); - proto_tree_add_item(fh_tree, hf_eth_dst, tvb, 0, 6, dst); - proto_tree_add_item(fh_tree, hf_eth_src, tvb, 6, 6, src); + proto_tree_add_ether(fh_tree, hf_eth_dst, tvb, 0, 6, dst); + proto_tree_add_ether(fh_tree, hf_eth_src, tvb, 6, 6, src); /* add items for eth.addr filter */ - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, tvb, 0, 6, dst); - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, tvb, 6, 6, src); + proto_tree_add_ether_hidden(fh_tree, hf_eth_addr, tvb, 0, 6, dst); + proto_tree_add_ether_hidden(fh_tree, hf_eth_addr, tvb, 6, 6, src); } } eth_offset += ETH_HEADER_SIZE; @@ -298,7 +298,7 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) trailer_length = tvb_length(trailer_tvb); if (trailer_length > 0) { ptr = tvb_get_ptr(trailer_tvb, 0, trailer_length); - proto_tree_add_item(fh_tree, hf_eth_trailer, tvb, ETH_HEADER_SIZE + etype, + proto_tree_add_bytes(fh_tree, hf_eth_trailer, tvb, ETH_HEADER_SIZE + etype, trailer_length, ptr); } } |