path: root/packet-nbns.c
diff options
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-nbns.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-nbns.c')
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-nbns.c b/packet-nbns.c
index 8daca2331c..c9ad53dc5f 100644
--- a/packet-nbns.c
+++ b/packet-nbns.c
@@ -4,7 +4,7 @@
* Gilbert Ramirez <gram@xiexie.org>
* Much stuff added by Guy Harris <guy@alum.mit.edu>
- * $Id: packet-nbns.c,v 1.37 2000/02/15 21:02:37 gram Exp $
+ * $Id: packet-nbns.c,v 1.38 2000/03/12 04:47:42 gram Exp $
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1314,22 +1314,22 @@ dissect_nbdgm(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_nbdgm, offset, header.dgm_length, NULL);
nbdgm_tree = proto_item_add_subtree(ti, ett_nbdgm);
- proto_tree_add_item_format(nbdgm_tree, hf_nbdgm_type,
+ proto_tree_add_uint_format(nbdgm_tree, hf_nbdgm_type,
offset, 1,
"Message Type: %s",
- proto_tree_add_item_format(nbdgm_tree, hf_nbdgm_fragment,
+ proto_tree_add_boolean_format(nbdgm_tree, hf_nbdgm_fragment,
offset+1, 1,
"More fragments follow: %s",
- proto_tree_add_item_format(nbdgm_tree, hf_nbdgm_first,
+ proto_tree_add_boolean_format(nbdgm_tree, hf_nbdgm_first,
offset+1, 1,
"This is first fragment: %s",
- proto_tree_add_item_format(nbdgm_tree, hf_nbdgm_node_type,
+ proto_tree_add_uint_format(nbdgm_tree, hf_nbdgm_node_type,
offset+1, 1,
"Node Type: %s",
@@ -1466,7 +1466,7 @@ dissect_nbss_packet(const u_char *pd, int offset, frame_data *fd, proto_tree *tr
ti = proto_tree_add_item(tree, proto_nbss, offset, length + 4, NULL);
nbss_tree = proto_item_add_subtree(ti, ett_nbss);
- proto_tree_add_item_format(nbss_tree, hf_nbss_type,
+ proto_tree_add_uint_format(nbss_tree, hf_nbss_type,
offset, 1,
"Message Type: %s",