aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tftp.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-tftp.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-tftp.c')
-rw-r--r--packet-tftp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/packet-tftp.c b/packet-tftp.c
index 175927c322..e7d368ae1c 100644
--- a/packet-tftp.c
+++ b/packet-tftp.c
@@ -5,7 +5,7 @@
* Craig Newell <CraigN@cheque.uq.edu.au>
* RFC2347 TFTP Option Extension
*
- * $Id: packet-tftp.c,v 1.11 2000/05/11 08:15:53 gram Exp $
+ * $Id: packet-tftp.c,v 1.12 2000/05/31 05:07:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -97,11 +97,11 @@ dissect_tftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
if (tree) {
- ti = proto_tree_add_item(tree, proto_tftp, NullTVB, offset, END_OF_FRAME, NULL);
+ ti = proto_tree_add_item(tree, proto_tftp, NullTVB, offset, END_OF_FRAME, FALSE);
tftp_tree = proto_item_add_subtree(ti, ett_tftp);
i1 = pntohs(pd+offset);
- proto_tree_add_item_hidden(tftp_tree, hf_tftp_type, NullTVB, offset, 2, i1);
+ proto_tree_add_uint_hidden(tftp_tree, hf_tftp_type, NullTVB, offset, 2, i1);
switch (i1) {
case RRQ:
@@ -159,7 +159,7 @@ dissect_tftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
proto_tree_add_text(tftp_tree, NullTVB, offset, 2, "Error Code");
offset += 2;
i1 = pntohs(pd+offset);
- proto_tree_add_item_hidden(tftp_tree, hf_tftp_error_code, NullTVB, offset, 2, i1);
+ proto_tree_add_uint_hidden(tftp_tree, hf_tftp_error_code, NullTVB, offset, 2, i1);
proto_tree_add_text(tftp_tree, NullTVB, offset, 2, "Code = %s", tftp_errors[i1 % 8]);
offset += 2;
proto_tree_add_text(tftp_tree, NullTVB, offset, END_OF_FRAME, "Error Message: %s", pd + offset);