aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ftp.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2000-03-12 04:48:32 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>2000-03-12 04:48:32 +0000
commit929f70ac0b14506508e6de9dc357608b91667120 (patch)
tree0b5f52ee7613baacc77f73697eb895592aa6a137 /packet-ftp.c
parent45942c1c41dfad28ac1aeca038e69c888d9a95c4 (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(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1713 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-ftp.c')
-rw-r--r--packet-ftp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/packet-ftp.c b/packet-ftp.c
index 7ee3aef157..62a97d50d4 100644
--- a/packet-ftp.c
+++ b/packet-ftp.c
@@ -2,7 +2,7 @@
* Routines for ftp packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-ftp.c,v 1.11 2000/01/07 22:05:30 guy Exp $
+ * $Id: packet-ftp.c,v 1.12 2000/03/12 04:47:37 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -114,9 +114,9 @@ dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
offset, i1, TRUE);
proto_tree_add_item_hidden(ftp_tree, hf_ftp_response,
offset, i1, FALSE);
- proto_tree_add_item_format(ftp_tree, hf_ftp_request_command,
+ proto_tree_add_string_format(ftp_tree, hf_ftp_request_command,
offset, i1, rr, "Request: %s", rr);
- proto_tree_add_item_format(ftp_tree, hf_ftp_request_data,
+ proto_tree_add_string_format(ftp_tree, hf_ftp_request_data,
offset + i1 + 1, END_OF_FRAME,
rd, "Request Arg: %s", rd);
}
@@ -126,10 +126,10 @@ dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
offset, i1, FALSE);
proto_tree_add_item_hidden(ftp_tree, hf_ftp_response,
offset, i1, TRUE);
- proto_tree_add_item_format(ftp_tree, hf_ftp_response_code,
+ proto_tree_add_uint_format(ftp_tree, hf_ftp_response_code,
offset, i1,
atoi(rr), "Response: %s", rr);
- proto_tree_add_item_format(ftp_tree, hf_ftp_response_data,
+ proto_tree_add_string_format(ftp_tree, hf_ftp_response_data,
offset + i1 + 1, END_OF_FRAME,
rd, "Response Arg: %s", rd);
}