summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2017-06-23 12:38:05 -0400
committerMartin Kaiser <wireshark@kaiser.cx>2017-06-23 19:35:16 +0000
commit69bac0d15c94891398e65fda05fb5d7320eb2989 (patch)
tree9ba0b4db0cb9f55e1bb3dafbd27265157b865eed /epan
parent0727123773d36a9dd6000d82a2967f7ddaa61aca (diff)
downloadwireshark-69bac0d15c94891398e65fda05fb5d7320eb2989.tar.gz
tcp: add tcp.payload field
Make the tcp segment data available on all tcp packets, regardless of reassembly of higher layer protocols. Change-Id: I1a5024e427e07b85bfc3a4aad5d0a401beb1049d Reviewed-on: https://code.wireshark.org/review/22374 Reviewed-by: Sake Blok <sake@euronet.nl> Petri-Dish: Sake Blok <sake@euronet.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-tcp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index bf6818f145..a34fa040e2 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -324,6 +324,7 @@ 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_segment_data = -1;
+static int hf_tcp_payload = -1;
static int hf_tcp_reset_cause = -1;
static int hf_tcp_fin_retransmission = -1;
static int hf_tcp_option_rvbd_probe_reserved = -1;
@@ -5573,8 +5574,14 @@ dissect_tcp_payload(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 seq,
proto_tree *tree, proto_tree *tcp_tree,
struct tcp_analysis *tcpd, struct tcpinfo *tcpinfo)
{
+ gint nbytes;
gboolean save_fragmented;
+ nbytes = tvb_reported_length_remaining(tvb, offset);
+ proto_tree_add_bytes_format(tcp_tree, hf_tcp_payload, tvb, offset,
+ -1, NULL, "TCP payload (%u byte%s)", nbytes,
+ plurality(nbytes, "", "s"));
+
/* Can we desegment this segment? */
if (pinfo->can_desegment) {
/* Yes. */
@@ -7161,6 +7168,10 @@ proto_register_tcp(void)
{ "TCP segment data", "tcp.segment_data", FT_BYTES, BASE_NONE, NULL, 0x0,
"A data segment used in reassembly of a lower-level protocol", HFILL}},
+ { &hf_tcp_payload,
+ { "TCP payload", "tcp.payload", FT_BYTES, BASE_NONE, NULL, 0x0,
+ "The TCP payload of this packet", HFILL}},
+
{ &hf_tcp_option_scps_binding_data,
{ "Binding Space Data", "tcp.options.scps.binding.data", FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},