aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee80211-netmon.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-06-22 15:04:28 -0700
committerGuy Harris <guy@alum.mit.edu>2015-06-22 22:05:17 +0000
commit8aa91b31b90e6ba2ab7391c0395548a3901df9d0 (patch)
treebd1c52fd465235c87fd944a88905bdc7191b3259 /epan/dissectors/packet-ieee80211-netmon.c
parent8abe108a3c942a10b58d58a1974cda49e10b2a43 (diff)
Provide PHY type and band information in the 802.11 pseudo-header.
Provide that information so that the "802.11 radio information" protocol can indicate whether a packet was 802.11 legacy/11b/11a/11g/11n/11ac, and possibly whether it's 2.4 GHz or 5 GHz 11n. (Sometimes the center frequency might not be supplied, so the band information can be useful.) Also, provide some 11ac information, now that we can distinguish between 11n and 11ac. Don't calculate the data rate from the MCS index unless it's 11n; we don't yet have code to calculate it for 11ac. For radiotap, only provide guard interval information for 11n and 11ac, not for earlier standards. Handle the 11ac flag in the Peek remote protocol. For Peek tagged files, the "extension flags" are 11n/11ac flags, so we don't have to check for the "MCS used" bit in order to decide that the packet is 11n or 11ac or to decide whether to provide the "bandwidth" or "short GI" information. Change-Id: Ia8a1a9b11a35243ed84eb4e72c384cc77512b098 Reviewed-on: https://code.wireshark.org/review/9032 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-ieee80211-netmon.c')
-rw-r--r--epan/dissectors/packet-ieee80211-netmon.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ieee80211-netmon.c b/epan/dissectors/packet-ieee80211-netmon.c
index bfc650e9f6..1b40c6ebd6 100644
--- a/epan/dissectors/packet-ieee80211-netmon.c
+++ b/epan/dissectors/packet-ieee80211-netmon.c
@@ -76,6 +76,7 @@ dissect_netmon_802_11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
int offset;
guint8 version;
guint16 length;
+ guint32 phy_type;
guint32 flags;
guint32 channel;
gint32 rssi;
@@ -123,6 +124,29 @@ dissect_netmon_802_11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
flags = tvb_get_letohl(tvb, offset);
offset += 4;
if (flags != 0xffffffff) {
+ phy_type = tvb_get_letohl(tvb, offset);
+ switch (phy_type) {
+
+ case PHY_TYPE_11B:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11B;
+ break;
+
+ case PHY_TYPE_11A:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11A;
+ break;
+
+ case PHY_TYPE_11G:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11G;
+ break;
+
+ case PHY_TYPE_11N:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11N;
+ break;
+ }
proto_tree_add_item(wlan_tree, hf_netmon_802_11_phy_type, tvb, offset, 4,
ENC_LITTLE_ENDIAN);
offset += 4;