diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-03-12 04:48:32 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-03-12 04:48:32 +0000 |
commit | f6e92a9e939a28327eea49b5931715ba97a62970 (patch) | |
tree | 0b5f52ee7613baacc77f73697eb895592aa6a137 /packet-ipv6.c | |
parent | 3d6cb57256c889b2f1ba51e89886d9bb9ea812fb (diff) |
Break proto_tree_add_item_format() into multiple functions:
proto_tree_add_protocol_format()
proto_tree_add_uint_format()
proto_tree_add_ipxnet_format()
proto_tree_add_ipv4_format()
proto_tree_add_ipv6_format()
proto_tree_add_bytes_format()
proto_tree_add_string_format()
proto_tree_add_ether_format()
proto_tree_add_time_format()
proto_tree_add_double_format()
proto_tree_add_boolean_format()
If using GCC 2.x, we can check the print-format against the variable args
passed in. Regardless of compiler, we can now check at run-time that the
field type passed into the function corresponds to what that function
expects (FT_UINT, FT_BOOLEAN, etc.)
Note that proto_tree_add_protocol_format() does not require a value field,
since the value of a protocol is always NULL. It's more intuitive w/o the
vestigial argument.
Fixed a proto_tree_add_item_format-related bug in packet-isis-hello.c
Fixed a variable usage bug in packet-v120.c. (ett_* was used instead of hf_*)
Checked in Guy's fix for the function declearation for proto_tree_add_text()
and proto_tree_add_notext().
svn path=/trunk/; revision=1713
Diffstat (limited to 'packet-ipv6.c')
-rw-r--r-- | packet-ipv6.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packet-ipv6.c b/packet-ipv6.c index 4b8df2cf1c..d8c7e425a2 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.28 2000/03/07 05:26:05 guy Exp $ + * $Id: packet-ipv6.c,v 1.29 2000/03/12 04:47:40 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -286,7 +286,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { * there should be no alignment problems for ip6_flow, since it's the first * guint32 in the ipv6 struct */ - proto_tree_add_item_format(ipv6_tree, hf_ipv6_flow, + proto_tree_add_uint_format(ipv6_tree, hf_ipv6_flow, offset + offsetof(struct ip6_hdr, ip6_flow), 4, (unsigned long)(ntohl(ipv6.ip6_flow & IPV6_FLOWLABEL_MASK)), "Flowlabel: 0x%05lx", @@ -296,7 +296,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { offset + offsetof(struct ip6_hdr, ip6_plen), 2, ntohs(ipv6.ip6_plen)); - proto_tree_add_item_format(ipv6_tree, hf_ipv6_nxt, + proto_tree_add_uint_format(ipv6_tree, hf_ipv6_nxt, offset + offsetof(struct ip6_hdr, ip6_nxt), 1, ipv6.ip6_nxt, "Next header: %s (0x%02x)", @@ -306,7 +306,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { offset + offsetof(struct ip6_hdr, ip6_hlim), 1, ipv6.ip6_hlim); - proto_tree_add_item_format(ipv6_tree, hf_ipv6_src, + proto_tree_add_ipv6_format(ipv6_tree, hf_ipv6_src, offset + offsetof(struct ip6_hdr, ip6_src), 16, &ipv6.ip6_src, #ifdef INET6 @@ -317,7 +317,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { #endif ip6_to_str(&ipv6.ip6_src)); - proto_tree_add_item_format(ipv6_tree, hf_ipv6_dst, + proto_tree_add_ipv6_format(ipv6_tree, hf_ipv6_dst, offset + offsetof(struct ip6_hdr, ip6_dst), 16, &ipv6.ip6_dst, #ifdef INET6 |