diff options
author | Preston Hunt <me@prestonhunt.com> | 2021-04-27 09:08:02 -0700 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-04-27 19:47:12 +0000 |
commit | ec14bbd89267adfae4a31d96545d8946c88e9d90 (patch) | |
tree | 8a6258dca7f9b256ad918911d18e9ec67ac2da37 | |
parent | bdc878e2f74455ce09e39fbb0579c9fec806aba3 (diff) |
IEEE 802.11: decode RSTA availability duration
RSTA Availability Duration has units of 100 microseconds. Display it as
ms for readability.
-rw-r--r-- | epan/dissectors/packet-ieee80211.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index d84bb951b1..ef919fdb3f 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -8014,6 +8014,13 @@ rep_custom(gchar *result, guint32 value) g_snprintf(result, ITEM_LABEL_LENGTH, "%u repetition%s (%u)", value + 1, plurality(value + 1, "", "s"), value); } +static void +hundred_us_base_custom(gchar *result, guint32 value) +{ + g_snprintf(result, ITEM_LABEL_LENGTH, "%0.1f ms (%u)", ((double)value * 100 / 1000), value); +} + + /* * We use this is displaying the ru allocation region. */ @@ -38632,7 +38639,7 @@ proto_register_ieee80211(void) {&hf_ieee80211_ftm_rsta_duration1, {"Duration", "wlan.ranging.rsta.duration", - FT_UINT32, BASE_HEX, NULL, 0x7f0000, NULL, HFILL }}, + FT_UINT32, BASE_CUSTOM, CF_FUNC(hundred_us_base_custom), 0x7f0000, NULL, HFILL }}, {&hf_ieee80211_ftm_rsta_passive_tb_ranging_avail_win1, {"Passive TB Ranging Availability Window", @@ -38649,7 +38656,7 @@ proto_register_ieee80211(void) {&hf_ieee80211_ftm_rsta_duration, {"Duration", "wlan.ranging.rsta.duration", - FT_UINT40, BASE_HEX, NULL, 0x7f0000, NULL, HFILL }}, + FT_UINT40, BASE_CUSTOM, CF_FUNC(hundred_us_base_custom), 0x7f0000, NULL, HFILL }}, {&hf_ieee80211_ftm_rsta_passive_tb_ranging_avail_win, {"Passive TB Ranging Availability Window", |