aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2011-07-01 19:40:35 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2011-07-01 19:40:35 +0000
commit5f2f261f52069d08c7e911409736ae876b622ae3 (patch)
treed029673626c784c6f521d46993bcf4e75e9df553
parentdd82c59ff950456972068ec6faa25f18cd9c68c8 (diff)
Since the TCP Flags tree encompasses 12 bits including the 3 reserved bits and
the nonce bit, we should display 3 nibbles on the Flags summary line in order to represent all flag bits. While arguably we need not worry about reserved bits, the nonce bit is not currently represented, so that bit alone pushes us into the next nibble. svn path=/trunk/; revision=37856
-rw-r--r--epan/dissectors/packet-tcp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 15a12fe6d4..0d920a3a0b 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -3819,6 +3819,12 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
first_flag = FALSE;
}
}
+ if (tcph->th_flags & 0x0E00) {
+ if (first_flag) {
+ ep_strbuf_truncate(flags_strbuf, 0);
+ }
+ ep_strbuf_append_printf(flags_strbuf, "%sReserved", first_flag ? "" : ", ");
+ }
}
col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] Seq=%u", flags_strbuf->str, tcph->th_seq);
@@ -3894,7 +3900,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint_format(tcp_tree, hf_tcp_hdr_len, tvb, offset + 12, 1, tcph->th_hlen,
"Header length: %u bytes", tcph->th_hlen);
tf = proto_tree_add_uint_format(tcp_tree, hf_tcp_flags, tvb, offset + 12, 2,
- tcph->th_flags, "Flags: 0x%02x (%s)", tcph->th_flags, flags_strbuf->str);
+ tcph->th_flags, "Flags: 0x%03x (%s)", tcph->th_flags, flags_strbuf->str);
field_tree = proto_item_add_subtree(tf, ett_tcp_flags);
proto_tree_add_boolean(field_tree, hf_tcp_flags_res, tvb, offset + 12, 1, tcph->th_flags);
proto_tree_add_boolean(field_tree, hf_tcp_flags_ns, tvb, offset + 12, 1, tcph->th_flags);