From f6e92a9e939a28327eea49b5931715ba97a62970 Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Sun, 12 Mar 2000 04:48:32 +0000 Subject: 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 --- packet-udp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packet-udp.c') diff --git a/packet-udp.c b/packet-udp.c index 65b608ef5f..f0d724de7e 100644 --- a/packet-udp.c +++ b/packet-udp.c @@ -1,7 +1,7 @@ /* packet-udp.c * Routines for UDP packet disassembly * - * $Id: packet-udp.c,v 1.51 2000/02/23 22:28:50 oabad Exp $ + * $Id: packet-udp.c,v 1.52 2000/03/12 04:47:50 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -252,16 +252,16 @@ dissect_udp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { ti = proto_tree_add_item(tree, proto_udp, offset, 8); udp_tree = proto_item_add_subtree(ti, ett_udp); - proto_tree_add_item_format(udp_tree, hf_udp_srcport, offset, 2, uh_sport, + proto_tree_add_uint_format(udp_tree, hf_udp_srcport, offset, 2, uh_sport, "Source port: %s (%u)", get_udp_port(uh_sport), uh_sport); - proto_tree_add_item_format(udp_tree, hf_udp_dstport, offset + 2, 2, uh_dport, + proto_tree_add_uint_format(udp_tree, hf_udp_dstport, offset + 2, 2, uh_dport, "Destination port: %s (%u)", get_udp_port(uh_dport), uh_dport); proto_tree_add_item_hidden(udp_tree, hf_udp_port, offset, 2, uh_sport); proto_tree_add_item_hidden(udp_tree, hf_udp_port, offset+2, 2, uh_dport); proto_tree_add_item(udp_tree, hf_udp_length, offset + 4, 2, uh_ulen); - proto_tree_add_item_format(udp_tree, hf_udp_checksum, offset + 6, 2, uh_sum, + proto_tree_add_uint_format(udp_tree, hf_udp_checksum, offset + 6, 2, uh_sum, "Checksum: 0x%04x", uh_sum); } -- cgit v1.2.3