diff options
author | cmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-13 18:15:41 +0000 |
---|---|---|
committer | cmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-13 18:15:41 +0000 |
commit | a4c3d9cb78ba2ab1dea4a0ac91567cbeb0d209c0 (patch) | |
tree | f3810ebc43e8ef864eed5acca4871310c385162d /epan/dissectors/packet-tcp.c | |
parent | ab742e2baa71f58cc2b5a33b971726870fcbc947 (diff) |
Allow TCP segment data to be filterable via "tcp.data".
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36629 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-tcp.c')
-rw-r--r-- | epan/dissectors/packet-tcp.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index 18d5381379..bb57125986 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -215,6 +215,7 @@ static int hf_tcp_proc_dst_uid = -1; static int hf_tcp_proc_dst_pid = -1; static int hf_tcp_proc_dst_uname = -1; static int hf_tcp_proc_dst_cmd = -1; +static int hf_tcp_data = -1; static gint ett_tcp = -1; static gint ett_tcp_flags = -1; @@ -1642,9 +1643,9 @@ again: } nbytes = tvb_reported_length_remaining(tvb, offset); - proto_tree_add_text(tcp_tree, tvb, offset, nbytes, - "%sTCP segment data (%u byte%s)", - str, nbytes, plurality(nbytes, "", "s")); + proto_tree_add_bytes_format(tcp_tree, hf_tcp_data, tvb, offset, + nbytes, NULL, "%sTCP segment data (%u byte%s)", str, nbytes, + plurality(nbytes, "", "s")); return; } @@ -1835,9 +1836,9 @@ again: nbytes = another_pdu_follows > 0 ? another_pdu_follows : tvb_reported_length_remaining(tvb, offset); - proto_tree_add_text(tcp_tree, tvb, offset, nbytes, - "TCP segment data (%u byte%s)", nbytes, - plurality(nbytes, "", "s")); + proto_tree_add_bytes_format(tcp_tree, hf_tcp_data, tvb, offset, + nbytes, NULL, "TCP segment data (%u byte%s)", nbytes, + plurality(nbytes, "", "s")); print_tcp_fragment_tree(ipfd_head, tree, tcp_tree, pinfo, next_tvb); @@ -1983,9 +1984,9 @@ again: * was, and report it as a continuation of that, instead? */ nbytes = tvb_reported_length_remaining(tvb, deseg_offset); - proto_tree_add_text(tcp_tree, tvb, deseg_offset, -1, - "TCP segment data (%u byte%s)", nbytes, - plurality(nbytes, "", "s")); + proto_tree_add_bytes_format(tcp_tree, hf_tcp_data, tvb, deseg_offset, + -1, NULL, "TCP segment data (%u byte%s)", nbytes, + plurality(nbytes, "", "s")); } pinfo->can_desegment = 0; pinfo->desegment_offset = 0; @@ -4912,7 +4913,11 @@ proto_register_tcp(void) { &hf_tcp_proc_dst_cmd, { "Destination process name", "tcp.proc.dstcmd", FT_STRING, BASE_NONE, NULL, 0x0, - "Destination process command name", HFILL}} + "Destination process command name", HFILL}}, + + { &hf_tcp_data, + { "TCP segment data", "tcp.data", FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL}} }; static gint *ett[] = { |