diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-04-26 20:59:42 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-04-26 20:59:42 +0000 |
commit | c7f627d4be1e05e6c75843ce4dea5590ae2e7c89 (patch) | |
tree | 8131f74b6bdd1555bb51b1fd9b5e22d173ad44cf /packet-ftp.c | |
parent | 5da26c43d34e6089313306441026c692cec0c991 (diff) |
Use "proto_tree_add_item()" to add strings to the protocol tree; this
simplifies the code (and makes the name in the protocol tree match the
name in the dialog box for constructing filter expressions), and also
fixes a bug where the item for the request command contained the entire
request, not just the request command.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5257 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-ftp.c')
-rw-r--r-- | packet-ftp.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/packet-ftp.c b/packet-ftp.c index 3aa7664374..c02250c279 100644 --- a/packet-ftp.c +++ b/packet-ftp.c @@ -3,7 +3,7 @@ * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * Copyright 2001, Juan Toledo <toledo@users.sourceforge.net> (Passive FTP) * - * $Id: packet-ftp.c,v 1.42 2002/04/03 22:35:08 guy Exp $ + * $Id: packet-ftp.c,v 1.43 2002/04/26 20:59:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -53,9 +53,9 @@ static int proto_ftp_data = -1; static int hf_ftp_response = -1; static int hf_ftp_request = -1; static int hf_ftp_request_command = -1; -static int hf_ftp_request_data = -1; +static int hf_ftp_request_arg = -1; static int hf_ftp_response_code = -1; -static int hf_ftp_response_data = -1; +static int hf_ftp_response_arg = -1; static gint ett_ftp = -1; static gint ett_ftp_data = -1; @@ -274,10 +274,9 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tokenlen != 0) { if (is_request) { if (tree) { - proto_tree_add_string_format(ftp_tree, + proto_tree_add_item(ftp_tree, hf_ftp_request_command, tvb, offset, - tokenlen, line, "Request: %s", - format_text(line, tokenlen)); + tokenlen, FALSE); } } else { /* @@ -294,10 +293,9 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) strncmp("227", line, tokenlen) == 0) is_pasv_response = TRUE; if (tree) { - proto_tree_add_uint_format(ftp_tree, + proto_tree_add_uint(ftp_tree, hf_ftp_response_code, tvb, offset, - tokenlen, atoi(line), "Response: %s", - format_text(line, tokenlen)); + tokenlen, atoi(line)); } } offset += next_token - line; @@ -325,15 +323,13 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ if (linelen != 0) { if (is_request) { - proto_tree_add_string_format(ftp_tree, - hf_ftp_request_data, tvb, offset, - linelen, line, "Request Arg: %s", - format_text(line, linelen)); + proto_tree_add_item(ftp_tree, + hf_ftp_request_arg, tvb, offset, + linelen, FALSE); } else { - proto_tree_add_string_format(ftp_tree, - hf_ftp_response_data, tvb, offset, - linelen, line, "Response Arg: %s", - format_text(line, linelen)); + proto_tree_add_item(ftp_tree, + hf_ftp_response_arg, tvb, offset, + linelen, FALSE); } } offset = next_offset; @@ -409,8 +405,8 @@ proto_register_ftp(void) FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, - { &hf_ftp_request_data, - { "Request data", "ftp.request.data", + { &hf_ftp_request_arg, + { "Request arg", "ftp.request.arg", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, @@ -419,8 +415,8 @@ proto_register_ftp(void) FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }}, - { &hf_ftp_response_data, - { "Response data", "ftp.reponse.data", + { &hf_ftp_response_arg, + { "Response arg", "ftp.reponse.arg", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }} }; |