From 0cb180aae4b63e4ef5f05a7c67670e7cef4abb78 Mon Sep 17 00:00:00 2001 From: Joerg Mayer Date: Thu, 22 May 2014 01:01:14 +0200 Subject: [PATCH] Print the values in the BSS Load Element in human readable format as well. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie20c340e06b970602a94c601be4c629ccae56e7c Reviewed-on: https://code.wireshark.org/review/1719 Reviewed-by: Jörg Mayer --- epan/dissectors/packet-ieee80211.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 39a681c77c..d35d63d7fc 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -13343,6 +13343,7 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset break; case TAG_QBSS_LOAD: /* 7.3.2.28 BSS Load element (11) */ + /* 8.4.2.30 in 802.11-2012 */ if ((tag_len < 4) || (tag_len > 5)) { expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4 or 5", tag_len); @@ -13361,15 +13362,20 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 1, ENC_BIG_ENDIAN); } else if (tag_len == 5) - { - /* QBSS Version 2 */ - proto_item_append_text(ti, " 802.11e CCA Version"); - /* Extract Values */ - proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 2); - proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 2, ENC_LITTLE_ENDIAN); + { + proto_item *base_item; + + /* QBSS Version 2 */ + proto_item_append_text(ti, " 802.11e CCA Version"); + + /* Extract Values */ + proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 2); + proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN); + base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_BIG_ENDIAN); + proto_item_append_text(base_item, " (%d%%)", 100*tvb_get_guint8(tvb, offset + 4)/255); + base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 2, ENC_LITTLE_ENDIAN); + proto_item_append_text(base_item, " (%d us/s)", tvb_get_letohs(tvb, offset + 5)*32); } break;