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-ipv6.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-ipv6.c')
-rw-r--r-- | packet-ipv6.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packet-ipv6.c b/packet-ipv6.c index 8fc4ff80d5..df1ee69bc2 100644 --- a/packet-ipv6.c +++ b/packet-ipv6.c @@ -1,7 +1,7 @@ /* packet-ipv6.c * Routines for IPv6 packet disassembly * - * $Id: packet-ipv6.c,v 1.37 2000/05/24 07:52:31 guy Exp $ + * $Id: packet-ipv6.c,v 1.38 2000/05/31 05:07:09 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -268,16 +268,16 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { if (tree) { /* !!! specify length */ - ti = proto_tree_add_item(tree, proto_ipv6, NullTVB, offset, 40, NULL); + ti = proto_tree_add_item(tree, proto_ipv6, NullTVB, offset, 40, FALSE); ipv6_tree = proto_item_add_subtree(ti, ett_ipv6); /* !!! warning: version also contains 4 Bit priority */ - proto_tree_add_item(ipv6_tree, hf_ipv6_version, NullTVB, + proto_tree_add_uint(ipv6_tree, hf_ipv6_version, NullTVB, offset + offsetof(struct ip6_hdr, ip6_vfc), 1, (ipv6.ip6_vfc >> 4) & 0x0f); - proto_tree_add_item(ipv6_tree, hf_ipv6_class, NullTVB, + proto_tree_add_uint(ipv6_tree, hf_ipv6_class, NullTVB, offset + offsetof(struct ip6_hdr, ip6_flow), 4, (guint8)((ntohl(ipv6.ip6_flow) >> 20) & 0xff)); @@ -291,7 +291,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Flowlabel: 0x%05lx", (unsigned long)(ntohl(ipv6.ip6_flow & IPV6_FLOWLABEL_MASK))); - proto_tree_add_item(ipv6_tree, hf_ipv6_plen, NullTVB, + proto_tree_add_uint(ipv6_tree, hf_ipv6_plen, NullTVB, offset + offsetof(struct ip6_hdr, ip6_plen), 2, ntohs(ipv6.ip6_plen)); @@ -301,7 +301,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Next header: %s (0x%02x)", ipprotostr(ipv6.ip6_nxt), ipv6.ip6_nxt); - proto_tree_add_item(ipv6_tree, hf_ipv6_hlim, NullTVB, + proto_tree_add_uint(ipv6_tree, hf_ipv6_hlim, NullTVB, offset + offsetof(struct ip6_hdr, ip6_hlim), 1, ipv6.ip6_hlim); @@ -363,7 +363,7 @@ again: } #ifdef TEST_FINALHDR - proto_tree_add_item_hidden(ipv6_tree, hf_ipv6_final, NullTVB, poffset, 1, nxt); + proto_tree_add_uint_hidden(ipv6_tree, hf_ipv6_final, NullTVB, poffset, 1, nxt); #endif if (frag) { /* fragmented */ |