aboutsummaryrefslogtreecommitdiffstats
path: root/packet-udp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-31 05:09:07 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-31 05:09:07 +0000
commit283ce59938ad2be252a6232e40a958e177a40e1a (patch)
treeb451d4a712d9b914022ba872296e70e55b8d9bc5 /packet-udp.c
parentaa553f63ecc7b9e310a05b743502c50f6dffb800 (diff)
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-udp.c')
-rw-r--r--packet-udp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/packet-udp.c b/packet-udp.c
index 7ebe966c2a..46a126bbd2 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.71 2000/05/30 03:35:55 guy Exp $
+ * $Id: packet-udp.c,v 1.72 2000/05/31 05:07:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -165,7 +165,7 @@ dissect_udp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
get_udp_port(uh_sport), get_udp_port(uh_dport));
if (tree) {
- ti = proto_tree_add_item(tree, proto_udp, NullTVB, offset, 8);
+ ti = proto_tree_add_item(tree, proto_udp, NullTVB, offset, 8, FALSE);
udp_tree = proto_item_add_subtree(ti, ett_udp);
proto_tree_add_uint_format(udp_tree, hf_udp_srcport, NullTVB, offset, 2, uh_sport,
@@ -173,10 +173,10 @@ dissect_udp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
proto_tree_add_uint_format(udp_tree, hf_udp_dstport, NullTVB, 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, NullTVB, offset, 2, uh_sport);
- proto_tree_add_item_hidden(udp_tree, hf_udp_port, NullTVB, offset+2, 2, uh_dport);
+ proto_tree_add_uint_hidden(udp_tree, hf_udp_port, NullTVB, offset, 2, uh_sport);
+ proto_tree_add_uint_hidden(udp_tree, hf_udp_port, NullTVB, offset+2, 2, uh_dport);
- proto_tree_add_item(udp_tree, hf_udp_length, NullTVB, offset + 4, 2, uh_ulen);
+ proto_tree_add_uint(udp_tree, hf_udp_length, NullTVB, offset + 4, 2, uh_ulen);
proto_tree_add_uint_format(udp_tree, hf_udp_checksum, NullTVB, offset + 6, 2, uh_sum,
"Checksum: 0x%04x", uh_sum);
}