diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2017-05-31 20:42:06 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-06-03 13:54:46 +0000 |
commit | 166f9208366dbd1b75b6cacaa0a7ff347186b6cd (patch) | |
tree | a7b4e7aa0d1d138eb345de8a9ef1232651019780 /epan/dissectors/packet-ftp.c | |
parent | 6216e576fc063661a36eea3f9596bc0d1ca034e2 (diff) |
Use data-text-lines dissector for text based ftp data
Change-Id: I98c5dad4dba4a8e5eaa450bef977ca7c0b979734
Reviewed-on: https://code.wireshark.org/review/21867
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ftp.c')
-rw-r--r-- | epan/dissectors/packet-ftp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c index e507146377..b5ee90c436 100644 --- a/epan/dissectors/packet-ftp.c +++ b/epan/dissectors/packet-ftp.c @@ -69,6 +69,7 @@ static expert_field ei_ftp_response_code_invalid = EI_INIT; static dissector_handle_t ftpdata_handle; static dissector_handle_t ftp_handle; +static dissector_handle_t data_text_lines_handle; #define TCP_PORT_FTPDATA 20 #define TCP_PORT_FTP 21 @@ -923,13 +924,11 @@ dissect_ftpdata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data } } + /* Show the number of bytes */ + proto_item_append_text(ti, " (%u bytes data)", data_length); + if (is_text) { - /* Show as string, but don't format more text than will be displayed */ - proto_item_append_text(ti, " (%s)", tvb_format_text(tvb, 0, MIN(data_length, ITEM_LABEL_LENGTH))); - } - else { - /* Assume binary, just show the number of bytes */ - proto_item_append_text(ti, " (%u bytes data)", data_length); + call_dissector(data_text_lines_handle, tvb, pinfo, tree); } return tvb_captured_length(tvb); @@ -1064,6 +1063,9 @@ proto_reg_handoff_ftp(void) { dissector_add_uint_with_preference("tcp.port", TCP_PORT_FTPDATA, ftpdata_handle); dissector_add_uint_with_preference("tcp.port", TCP_PORT_FTP, ftp_handle); + + data_text_lines_handle = find_dissector_add_dependency("data-text-lines", proto_ftp_data); + } /* |