diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2010-06-20 16:17:10 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2010-06-20 16:17:10 +0000 |
commit | d051e79a814aa2386aeb9924824e34650d3abbf8 (patch) | |
tree | dfbee0cd0268b30e0bc0e6a008df4e75b1a14da4 /epan | |
parent | f806bc8743b6a31859b83fc8f552cc3c8739be0b (diff) |
Revert back to the old Flags entry.
Add number of bits used for Flags in the description.
svn path=/trunk/; revision=33264
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ip.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 5e6caf41cf..2bd1af106b 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -1313,6 +1313,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) guint32 addr; int offset = 0; guint hlen, optlen; + guint16 flags; guint8 nxt; guint16 ipsum; fragment_data *ipfd_head=NULL; @@ -1447,7 +1448,8 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) iph->ip_off = tvb_get_ntohs(tvb, offset + 6); if (tree) { int bit_offset = (offset + 6) * 8; - tf = proto_tree_add_bits_item(field_tree, hf_ip_flags, tvb, bit_offset + 0, 3, FALSE); + flags = (iph->ip_off & (IP_RF | IP_DF | IP_MF)) >> IP_OFFSET_WIDTH; + tf = proto_tree_add_uint(ip_tree, hf_ip_flags, tvb, offset + 6, 1, flags); field_tree = proto_item_add_subtree(tf, ett_ip_off); if (ip_security_flag) { proto_item *sf; @@ -1716,6 +1718,8 @@ void proto_register_ip(void) { #define ARG_TO_STR(ARG) #ARG +#define FLAGS_OFFSET_WIDTH_MSG(WIDTH) \ + "Flags (" ARG_TO_STR(WIDTH) " bits)" #define FRAG_OFFSET_WIDTH_MSG(WIDTH) \ "Fragment offset (" ARG_TO_STR(WIDTH) " bits)" @@ -1875,7 +1879,7 @@ proto_register_ip(void) #endif /* HAVE_GEOIP */ { &hf_ip_flags, { "Flags", "ip.flags", FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, + FLAGS_OFFSET_WIDTH_MSG(IP_FLAGS_WIDTH), HFILL }}, { &hf_ip_flags_sf, { "Security flag", "ip.flags.sf", FT_BOOLEAN, IP_FLAGS_WIDTH, TFS(&flags_sf_set_evil), 0x0, |