aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee80211-radio.c
diff options
context:
space:
mode:
authorSimon Barber <simon.barber@meraki.net>2016-07-25 17:00:55 +0100
committerMichael Mann <mmann78@netscape.net>2016-11-06 13:54:40 +0000
commitd3389fab94c23c2b4e1c9b9dbf77851379b50eec (patch)
tree0ec2f5a86b1c9cbf62b8504ac5d6ce50b80f43d1 /epan/dissectors/packet-ieee80211-radio.c
parentc665926bab23034e7b231cec4ca7b95c40e2a928 (diff)
Add wlan_radio preference to assume 802.11 preamble is short for duration
calculations. Change-Id: Ie314f7caee067b16da8dcb2a45cb1395ce0cb266 Reviewed-on: https://code.wireshark.org/review/17719 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ieee80211-radio.c')
-rw-r--r--epan/dissectors/packet-ieee80211-radio.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ieee80211-radio.c b/epan/dissectors/packet-ieee80211-radio.c
index 25a2b33067..b6dd93783d 100644
--- a/epan/dissectors/packet-ieee80211-radio.c
+++ b/epan/dissectors/packet-ieee80211-radio.c
@@ -27,6 +27,7 @@
#include <epan/packet.h>
#include <epan/expert.h>
#include <wiretap/wtap.h>
+#include <epan/prefs.h>
#include "packet-ieee80211.h"
#include "math.h"
@@ -94,6 +95,9 @@ static expert_field ei_wlan_radio_assumed_no_stbc = EI_INIT;
static expert_field ei_wlan_radio_assumed_no_extension_streams = EI_INIT;
static expert_field ei_wlan_radio_assumed_bcc_fec = EI_INIT;
+/* Settings */
+static gboolean wlan_radio_always_short_preamble = FALSE;
+
static const value_string phy_vals[] = {
{ PHDR_802_11_PHY_11_FHSS, "802.11 FHSS" },
{ PHDR_802_11_PHY_11_IR, "802.11 IR" },
@@ -751,8 +755,9 @@ dissect_wlan_radio_phdr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
break;
case PHDR_802_11_PHY_11B:
- if (!has_short_preamble) {
+ if (!has_short_preamble || wlan_radio_always_short_preamble) {
assumed_short_preamble = TRUE;
+ short_preamble = TRUE;
}
preamble = short_preamble ? 72 + 24 : 144 + 48;
@@ -1168,6 +1173,7 @@ static ei_register_info ei[] = {
"No fec type information was available, assuming bcc fec.", EXPFILL }},
};
+module_t *wlan_radio_module;
expert_module_t* expert_wlan_radio;
static gint *tree_array[] = {
@@ -1188,6 +1194,14 @@ void proto_register_ieee80211_radio(void)
wlan_radio_handle = register_dissector("wlan_radio", dissect_wlan_radio, proto_wlan_radio);
wlan_noqos_radio_handle = register_dissector("wlan_noqos_radio", dissect_wlan_noqos_radio, proto_wlan_radio);
+
+ wlan_radio_module = prefs_register_protocol(proto_wlan_radio, NULL);
+ prefs_register_bool_preference(wlan_radio_module, "always_short_preamble",
+ "802.11/11b preamble length is always short",
+ "Some generators incorrectly indicate long preamble when the preamble was actually"
+ "short. Always assume short preamble when calculating duration.",
+ &wlan_radio_always_short_preamble);
+
}
void proto_reg_handoff_ieee80211_radio(void)