aboutsummaryrefslogtreecommitdiffstats
path: root/packet-auto_rp.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-03-12 04:48:32 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-03-12 04:48:32 +0000
commitf6e92a9e939a28327eea49b5931715ba97a62970 (patch)
tree0b5f52ee7613baacc77f73697eb895592aa6a137 /packet-auto_rp.c
parent3d6cb57256c889b2f1ba51e89886d9bb9ea812fb (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-auto_rp.c')
-rw-r--r--packet-auto_rp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/packet-auto_rp.c b/packet-auto_rp.c
index 90e17473f2..4436bbef0c 100644
--- a/packet-auto_rp.c
+++ b/packet-auto_rp.c
@@ -4,7 +4,7 @@
*
* Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-auto_rp.c,v 1.2 2000/01/07 22:05:29 guy Exp $
+ * $Id: packet-auto_rp.c,v 1.3 2000/03/12 04:47:35 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -152,7 +152,7 @@ void dissect_auto_rp(const u_char *pd, int offset, frame_data *fd, proto_tree *t
ti = proto_tree_add_item(tree, proto_auto_rp, offset, END_OF_FRAME, NULL);
auto_rp_tree = proto_item_add_subtree(ti, ett_auto_rp);
- tv = proto_tree_add_item_format(auto_rp_tree, hf_auto_rp_ver_type, offset, 1,
+ tv = proto_tree_add_uint_format(auto_rp_tree, hf_auto_rp_ver_type, offset, 1,
arh.ver_type, "Version: %s, Packet type: %s",
val_to_str(hi_nibble(arh.ver_type), auto_rp_ver_vals, "Unknown"),
val_to_str(lo_nibble(arh.ver_type), auto_rp_type_vals, "Unknown"));
@@ -254,7 +254,7 @@ static int do_auto_rp_map(const u_char *pd, int offset, frame_data *fd, proto_tr
return -1;
memcpy(&m, pd+offset, sizeof(struct auto_rp_map_hdr));
- ti = proto_tree_add_item_format(auto_rp_tree, hf_auto_rp_map, offset,
+ ti = proto_tree_add_uint_format(auto_rp_tree, hf_auto_rp_map, offset,
MIN(sizeof(m) + m.group_count*sizeof(g), END_OF_FRAME), 1,
"RP %s: %u group%s", ip_to_str((void *)&m.rp_address),
m.group_count, plurality(m.group_count, "", "s"));
@@ -273,7 +273,7 @@ static int do_auto_rp_map(const u_char *pd, int offset, frame_data *fd, proto_tr
if (2*sizeof(guint8) + sizeof(guint32) > END_OF_FRAME) /* struct auto_rp_enc_grp_hdr */
return -1;
- gi = proto_tree_add_item_format(map_tree, hf_auto_rp_group, offset, 6, 1,
+ gi = proto_tree_add_uint_format(map_tree, hf_auto_rp_group, offset, 6, 1,
"group %s/%u (%s)", ip_to_str(pd + offset + 2),
pd[offset + 1],
val_to_str(pd[offset]&AUTO_RP_SIGN_MASK, auto_rp_mask_sign_vals, ""));