aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--epan/dissectors/packet-ieee80211-netmon.c24
-rw-r--r--epan/dissectors/packet-ieee80211-radio.c117
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap-defs.h38
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap.c256
-rw-r--r--epan/dissectors/packet-ixveriwave.c14
-rw-r--r--epan/dissectors/packet-peekremote.c53
-rw-r--r--epan/dissectors/packet-ppi.c70
-rw-r--r--wiretap/commview.c48
-rw-r--r--wiretap/network_instruments.c1
-rw-r--r--wiretap/netxray.c5
-rw-r--r--wiretap/peektagged.c221
-rw-r--r--wiretap/wtap.h82
12 files changed, 664 insertions, 265 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;
diff --git a/epan/dissectors/packet-ieee80211-radio.c b/epan/dissectors/packet-ieee80211-radio.c
index 549cf4377b..5c54842525 100644
--- a/epan/dissectors/packet-ieee80211-radio.c
+++ b/epan/dissectors/packet-ieee80211-radio.c
@@ -40,6 +40,7 @@ static int proto_wlan_radio = -1;
/* ************************************************************************* */
/* Header field info values for radio information */
/* ************************************************************************* */
+static int hf_wlan_radio_phy_band = -1;
static int hf_wlan_radio_data_rate = -1;
static int hf_wlan_radio_mcs_index = -1;
static int hf_wlan_radio_bandwidth = -1;
@@ -52,11 +53,50 @@ static int hf_wlan_radio_noise_percent = -1;
static int hf_wlan_radio_noise_dbm = -1;
static int hf_wlan_radio_timestamp = -1;
+static const value_string phy_band_vals[] = {
+ { PHDR_802_11_PHY_BAND_11_FHSS, "802.11 FHSS" },
+ { PHDR_802_11_PHY_BAND_11B, "802.11b" },
+ { PHDR_802_11_PHY_BAND_11A, "802.11a" },
+ { PHDR_802_11_PHY_BAND_11G, "802.11g" },
+ { PHDR_802_11_PHY_BAND_11G_PURE, "802.11g (pure-g)" },
+ { PHDR_802_11_PHY_BAND_11G_MIXED, "802.11g (mixed g/b)" },
+ { PHDR_802_11_PHY_BAND_11A_108, "802.11a (turbo)" },
+ { PHDR_802_11_PHY_BAND_11G_PURE_108, "802.11g (pure-g, turbo)" },
+ { PHDR_802_11_PHY_BAND_11G_MIXED_108, "802.11g (mixed g/b, turbo)" },
+ { PHDR_802_11_PHY_BAND_11G_STURBO, "802.11g (static turbo)" },
+ { PHDR_802_11_PHY_BAND_11N, "802.11n" },
+ { PHDR_802_11_PHY_BAND_11N_5GHZ, "802.11n (5 GHz)" },
+ { PHDR_802_11_PHY_BAND_11N_2_4GHZ, "802.11n (2.4 GHz)" },
+ { PHDR_802_11_PHY_BAND_11AC, "802.11ac" },
+ { 0, NULL }
+};
static const value_string bandwidth_vals[] = {
- { PHDR_802_11_BANDWIDTH_20_MHZ, "20 MHz" },
- { PHDR_802_11_BANDWIDTH_40_MHZ, "40 MHz" },
- { PHDR_802_11_BANDWIDTH_20_20L, "20 MHz + 20 MHz lower" },
- { PHDR_802_11_BANDWIDTH_20_20U, "20 MHz + 20 MHz upper" },
+ { PHDR_802_11_BANDWIDTH_20_MHZ, "20 MHz" },
+ { PHDR_802_11_BANDWIDTH_40_MHZ, "40 MHz" },
+ { PHDR_802_11_BANDWIDTH_20_20L, "20 MHz + 20 MHz lower" },
+ { PHDR_802_11_BANDWIDTH_20_20U, "20 MHz + 20 MHz upper" },
+ { PHDR_802_11_BANDWIDTH_80_MHZ, "80 MHz" },
+ { PHDR_802_11_BANDWIDTH_40_40L, "40 MHz + 40 MHz lower" },
+ { PHDR_802_11_BANDWIDTH_40_40U, "40 MHz + 40 MHz upper" },
+ { PHDR_802_11_BANDWIDTH_20LL, "20LL" },
+ { PHDR_802_11_BANDWIDTH_20LU, "20LU" },
+ { PHDR_802_11_BANDWIDTH_20UL, "20UL" },
+ { PHDR_802_11_BANDWIDTH_20UU, "20UU" },
+ { PHDR_802_11_BANDWIDTH_160_MHZ, "160 MHz" },
+ { PHDR_802_11_BANDWIDTH_80_80L, "80 MHz + 80 MHz lower" },
+ { PHDR_802_11_BANDWIDTH_80_80U, "80 MHz + 80 MHz upper" },
+ { PHDR_802_11_BANDWIDTH_40LL, "40LL" },
+ { PHDR_802_11_BANDWIDTH_40LU, "40LU" },
+ { PHDR_802_11_BANDWIDTH_40UL, "40UL" },
+ { PHDR_802_11_BANDWIDTH_40UU, "40UU" },
+ { PHDR_802_11_BANDWIDTH_20LLL, "20LLL" },
+ { PHDR_802_11_BANDWIDTH_20LLU, "20LLU" },
+ { PHDR_802_11_BANDWIDTH_20LUL, "20LUL" },
+ { PHDR_802_11_BANDWIDTH_20LUU, "20LUU" },
+ { PHDR_802_11_BANDWIDTH_20ULL, "20ULL" },
+ { PHDR_802_11_BANDWIDTH_20ULU, "20ULU" },
+ { PHDR_802_11_BANDWIDTH_20UUL, "20UUL" },
+ { PHDR_802_11_BANDWIDTH_20UUU, "20UUU" },
{ 0, NULL }
};
@@ -483,21 +523,33 @@ dissect_wlan_radio (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void
data_rate = phdr->data_rate * 0.5f;
have_data_rate = TRUE;
} else {
- /* Do we have all the fields we need to look it up? */
+ /* This applies only to 802.11n and 802.11ac */
+ if (phdr->presence_flags & PHDR_802_11_HAS_PHY_BAND) {
+ switch (phdr->phy_band) {
+
+ case PHDR_802_11_PHY_BAND_11N:
+ case PHDR_802_11_PHY_BAND_11N_5GHZ:
+ case PHDR_802_11_PHY_BAND_11N_2_4GHZ:
+ /* Do we have all the fields we need to look it up? */
+ {
#define PHDR_802_11_ALL_MCS_FIELDS \
- (PHDR_802_11_HAS_MCS_INDEX | \
- PHDR_802_11_HAS_BANDWIDTH | \
- PHDR_802_11_HAS_SHORT_GI)
-
- guint bandwidth_40;
-
- if ((phdr->presence_flags & PHDR_802_11_ALL_MCS_FIELDS) == PHDR_802_11_ALL_MCS_FIELDS) {
- bandwidth_40 =
- (phdr->bandwidth == PHDR_802_11_BANDWIDTH_40_MHZ) ?
- 1 : 0;
- if (phdr->mcs_index < MAX_MCS_INDEX) {
- data_rate = ieee80211_float_htrates[phdr->mcs_index][bandwidth_40][phdr->short_gi];
- have_data_rate = TRUE;
+ (PHDR_802_11_HAS_MCS_INDEX | \
+ PHDR_802_11_HAS_BANDWIDTH | \
+ PHDR_802_11_HAS_SHORT_GI)
+
+ guint bandwidth_40;
+
+ if ((phdr->presence_flags & PHDR_802_11_ALL_MCS_FIELDS) == PHDR_802_11_ALL_MCS_FIELDS) {
+ bandwidth_40 =
+ (phdr->bandwidth == PHDR_802_11_BANDWIDTH_40_MHZ) ?
+ 1 : 0;
+ if (phdr->mcs_index < MAX_MCS_INDEX) {
+ data_rate = ieee80211_float_htrates[phdr->mcs_index][bandwidth_40][phdr->short_gi];
+ have_data_rate = TRUE;
+ }
+ }
+ }
+ break;
}
}
}
@@ -506,28 +558,21 @@ dissect_wlan_radio (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void
if (have_data_rate)
col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%.1f", data_rate);
- if (phdr->presence_flags & PHDR_802_11_HAS_SIGNAL_PERCENT) {
- /*
- * For tagged Peek files, this is presumably signal strength as a
- * percentage of the maximum, as it is for classic Peek files,
- * i.e. (RXVECTOR RSSI/RXVECTOR RSSI_Max)*100, or, at least, that's
- * what I infer it is, given what the WildPackets note "Converting
- * Signal Strength Percentage to dBm Values" says.
- *
- * It also says that the conversion the percentage to a dBm value is
- * an adapter-dependent process, so, as we don't know what type of
- * adapter was used to do the capture, we can't do the conversion.
- *
- * It's *probably* something similar for other capture file formats.
- */
- col_add_fstr(pinfo->cinfo, COL_RSSI, "%u%%",
- phdr->signal_percent);
+ if (phdr->presence_flags & PHDR_802_11_HAS_SIGNAL_DBM) {
+ col_add_fstr(pinfo->cinfo, COL_RSSI, "%u dBm", phdr->signal_dbm);
+ } else if (phdr->presence_flags & PHDR_802_11_HAS_SIGNAL_PERCENT) {
+ col_add_fstr(pinfo->cinfo, COL_RSSI, "%u%%", phdr->signal_percent);
}
if (tree) {
ti = proto_tree_add_item(tree, proto_wlan_radio, tvb, 0, 0, ENC_NA);
radio_tree = proto_item_add_subtree (ti, ett_wlan_radio);
+ if (phdr->presence_flags & PHDR_802_11_HAS_PHY_BAND) {
+ proto_tree_add_uint(radio_tree, hf_wlan_radio_phy_band, tvb, 0, 0,
+ phdr->phy_band);
+ }
+
if (phdr->presence_flags & PHDR_802_11_HAS_MCS_INDEX) {
proto_tree_add_uint(radio_tree, hf_wlan_radio_mcs_index, tvb, 0, 0,
phdr->mcs_index);
@@ -602,6 +647,10 @@ dissect_wlan_radio (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void
}
static hf_register_info hf_wlan_radio[] = {
+ {&hf_wlan_radio_phy_band,
+ {"PHY type and band", "wlan_radio.phy_band", FT_UINT32, BASE_DEC, VALS(phy_band_vals), 0,
+ NULL, HFILL }},
+
{&hf_wlan_radio_data_rate,
{"Data rate", "wlan_radio.data_rate", FT_FLOAT, BASE_NONE, NULL, 0,
"Data rate (bits/s)", HFILL }},
diff --git a/epan/dissectors/packet-ieee80211-radiotap-defs.h b/epan/dissectors/packet-ieee80211-radiotap-defs.h
index a917ed86f4..25dd231bd7 100644
--- a/epan/dissectors/packet-ieee80211-radiotap-defs.h
+++ b/epan/dissectors/packet-ieee80211-radiotap-defs.h
@@ -219,14 +219,35 @@ enum ieee80211_radiotap_type {
#define IEEE80211_RADIOTAP_NOTDEFINED 0x1FC00000
/* Channel flags. */
-#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */
-#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */
-#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */
-#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */
-#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */
-#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
-#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
-#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
+/* 0x00000001 through 0x00000008 undefined (reserved?) */
+#define IEEE80211_CHAN_TURBO 0x00000010 /* Turbo channel */
+#define IEEE80211_CHAN_CCK 0x00000020 /* CCK channel */
+#define IEEE80211_CHAN_OFDM 0x00000040 /* OFDM channel */
+#define IEEE80211_CHAN_2GHZ 0x00000080 /* 2 GHz spectrum channel. */
+#define IEEE80211_CHAN_5GHZ 0x00000100 /* 5 GHz spectrum channel */
+#define IEEE80211_CHAN_PASSIVE 0x00000200 /* Only passive scan allowed */
+#define IEEE80211_CHAN_DYN 0x00000400 /* Dynamic CCK-OFDM channel */
+#define IEEE80211_CHAN_GFSK 0x00000800 /* GFSK channel (FHSS PHY) */
+
+/* Additional XChannel flags. */
+#define IEEE80211_CHAN_GSM 0x00001000 /* 900 MHz spectrum channel */
+#define IEEE80211_CHAN_STURBO 0x00002000 /* 11a static turbo channel only */
+#define IEEE80211_CHAN_HALF 0x00004000 /* Half rate channel */
+#define IEEE80211_CHAN_QUARTER 0x00008000 /* Quarter rate channel */
+#define IEEE80211_CHAN_HT20 0x00010000 /* HT 20 channel */
+#define IEEE80211_CHAN_HT40U 0x00020000 /* HT 40 channel w/ ext above */
+#define IEEE80211_CHAN_HT40D 0x00040000 /* HT 40 channel w/ ext below */
+
+#define IEEE80211_CHAN_HT40 (IEEE80211_CHAN_HT40U | IEEE80211_CHAN_HT40D)
+#define IEEE80211_CHAN_HT (IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40)
+
+#define IEEE80211_CHAN_ALL \
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \
+ IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \
+ IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER | \
+ IEEE80211_CHAN_HT)
+#define IEEE80211_CHAN_ALLTURBO \
+ (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)
/* For IEEE80211_RADIOTAP_FLAGS */
#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
@@ -313,6 +334,7 @@ enum ieee80211_radiotap_type {
#define IEEE80211_RADIOTAP_VHT_MCS 0xf0
#define IEEE80211_RADIOTAP_VHT_CODING_LDPC 0x01
+#define IEEE80211_RADIOTAP_VHT_BW_MASK 0x1f
#define IEEE80211_RADIOTAP_VHT_BW_20 IEEE80211_RADIOTAP_MCS_BW_20
#define IEEE80211_RADIOTAP_VHT_BW_40 IEEE80211_RADIOTAP_MCS_BW_40
#define IEEE80211_RADIOTAP_VHT_BW_20L IEEE80211_RADIOTAP_MCS_BW_20L
diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c
index 78bb206a17..1c9f712220 100644
--- a/epan/dissectors/packet-ieee80211-radiotap.c
+++ b/epan/dissectors/packet-ieee80211-radiotap.c
@@ -235,9 +235,6 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree);
/* not officially defined (yet) */
#define IEEE80211_RADIOTAP_F_SHORTGI 0x80
#define IEEE80211_RADIOTAP_XCHANNEL 18
-#define IEEE80211_CHAN_HT20 0x10000 /* HT 20 channel */
-#define IEEE80211_CHAN_HT40U 0x20000 /* HT 40 channel w/ ext above */
-#define IEEE80211_CHAN_HT40D 0x40000 /* HT 40 channel w/ ext below */
/* Official specifcation:
*
@@ -261,12 +258,14 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree);
(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
#define IEEE80211_CHAN_G \
(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
-#define IEEE80211_CHAN_T \
- (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
+#define IEEE80211_CHAN_108A \
+ (IEEE80211_CHAN_A | IEEE80211_CHAN_TURBO)
#define IEEE80211_CHAN_108G \
(IEEE80211_CHAN_G | IEEE80211_CHAN_TURBO)
#define IEEE80211_CHAN_108PUREG \
(IEEE80211_CHAN_PUREG | IEEE80211_CHAN_TURBO)
+#define IEEE80211_CHAN_ST \
+ (IEEE80211_CHAN_108A | IEEE80211_CHAN_STURBO)
#define MAX_MCS_VHT_INDEX 9
@@ -408,10 +407,11 @@ static const value_string phy_type[] = {
{IEEE80211_CHAN_PUREG, "802.11g (pure-g)"}, /* 0x000c0 */
{IEEE80211_CHAN_108PUREG, "802.11g (pure-g, turbo)"}, /* 0x000d0 */
{IEEE80211_CHAN_A, "802.11a"}, /* 0x00140 */
- {IEEE80211_CHAN_T, "802.11a (turbo)"}, /* 0x00150 */
+ {IEEE80211_CHAN_108A, "802.11a (turbo)"}, /* 0x00150 */
{IEEE80211_CHAN_G, "802.11g"}, /* 0x00480 */
{IEEE80211_CHAN_108G, "802.11g (turbo)"}, /* 0x00490 */
{IEEE80211_CHAN_FHSS, "FHSS"}, /* 0x00880 */
+ {IEEE80211_CHAN_ST, "802.11a (static turbo)"}, /* 0x02140 */
{IEEE80211_CHAN_A | IEEE80211_CHAN_HT20, "802.11n (ht20, 5 GHz)"}, /* 0x10140 */
{IEEE80211_CHAN_G | IEEE80211_CHAN_HT20, "802.11n (ht20, 2.4 GHz)"}, /* 0x10480 */
{IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U, "802.11n (ht40+, 5 GHz)"}, /* 0x20140 */
@@ -574,9 +574,11 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
tvbuff_t *next_tvb;
guint8 version;
guint length;
+ guint32 flags;
guint32 freq;
proto_item *rate_ti;
gint8 dbm, db;
+ gboolean have_rflags = FALSE;
guint8 rflags = 0;
/* backward compat with bit 14 == fcs in header */
proto_item *hdr_fcs_ti = NULL;
@@ -838,22 +840,13 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
case IEEE80211_RADIOTAP_FLAGS: {
rflags = tvb_get_guint8(tvb, offset);
+ have_rflags = TRUE;
if (rflags & IEEE80211_RADIOTAP_F_DATAPAD)
phdr.datapad = TRUE;
if (rflags & IEEE80211_RADIOTAP_F_FCS)
phdr.fcs_len = 4;
else
phdr.fcs_len = 0;
- /*
- * This is "Currently unspecified but used",
- * according to the radiotap.org page for
- * the Flags field.
- */
- phdr.presence_flags |= PHDR_802_11_HAS_SHORT_GI;
- if (rflags & 0x80)
- phdr.short_gi = 1;
- else
- phdr.short_gi = 0;
if (tree) {
proto_tree *flags_tree;
@@ -960,6 +953,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
case IEEE80211_RADIOTAP_CHANNEL: {
freq = tvb_get_letohs(tvb, offset);
+ flags = tvb_get_letohs(tvb, offset + 2);
if (freq != 0) {
/*
* XXX - some captures have 0, which is
@@ -968,8 +962,44 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
phdr.presence_flags |= PHDR_802_11_HAS_FREQUENCY;
phdr.frequency = freq;
}
+ switch (flags & IEEE80211_CHAN_ALLTURBO) {
+
+ case IEEE80211_CHAN_FHSS:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11_FHSS;
+ break;
+
+ case IEEE80211_CHAN_A:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11A;
+ break;
+
+ case IEEE80211_CHAN_B:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11B;
+ break;
+
+ case IEEE80211_CHAN_PUREG:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11G_PURE;
+ break;
+
+ case IEEE80211_CHAN_G:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11G_MIXED;
+ break;
+
+ case IEEE80211_CHAN_108A:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11A_108;
+ break;
+
+ case IEEE80211_CHAN_108PUREG:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11G_PURE_108;
+ break;
+ }
if (tree) {
- guint16 flags;
gchar *chan_str;
static const int * channel_flags[] = {
&hf_radiotap_channel_flags_turbo,
@@ -987,7 +1017,6 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
NULL
};
- flags = tvb_get_letohs(tvb, offset + 2);
chan_str = ieee80211_mhz_to_str(freq);
col_add_fstr(pinfo->cinfo,
COL_FREQ_CHAN, "%s", chan_str);
@@ -1123,41 +1152,125 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
}
case IEEE80211_RADIOTAP_XCHANNEL: {
- static const int * xchannel_flags[] = {
- &hf_radiotap_xchannel_flags_turbo,
- &hf_radiotap_xchannel_flags_cck,
- &hf_radiotap_xchannel_flags_ofdm,
- &hf_radiotap_xchannel_flags_2ghz,
- &hf_radiotap_xchannel_flags_5ghz,
- &hf_radiotap_xchannel_flags_passive,
- &hf_radiotap_xchannel_flags_dynamic,
- &hf_radiotap_xchannel_flags_gfsk,
- &hf_radiotap_xchannel_flags_gsm,
- &hf_radiotap_xchannel_flags_sturbo,
- &hf_radiotap_xchannel_flags_half,
- &hf_radiotap_xchannel_flags_quarter,
- &hf_radiotap_xchannel_flags_ht20,
- &hf_radiotap_xchannel_flags_ht40u,
- &hf_radiotap_xchannel_flags_ht40d,
- NULL
- };
+ switch (flags & IEEE80211_CHAN_ALLTURBO) {
+
+ case IEEE80211_CHAN_FHSS:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11_FHSS;
+ break;
+
+ case IEEE80211_CHAN_A:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11A;
+ break;
+
+ case IEEE80211_CHAN_B:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11B;
+ break;
+
+ case IEEE80211_CHAN_PUREG:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11G_PURE;
+ break;
+
+ case IEEE80211_CHAN_G:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11G_MIXED;
+ break;
+
+ case IEEE80211_CHAN_108A:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11A_108;
+ break;
+
+ case IEEE80211_CHAN_108PUREG:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11G_PURE_108;
+ break;
+
+ case IEEE80211_CHAN_ST:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11G_STURBO;
+ break;
+
+ case IEEE80211_CHAN_A|IEEE80211_CHAN_HT20:
+ case IEEE80211_CHAN_A|IEEE80211_CHAN_HT40D:
+ case IEEE80211_CHAN_A|IEEE80211_CHAN_HT40U:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11N_5GHZ;
- proto_tree_add_item(radiotap_tree,
- hf_radiotap_xchannel,
- tvb, offset + 6, 1,
- ENC_LITTLE_ENDIAN);
- proto_tree_add_item(radiotap_tree,
- hf_radiotap_xchannel_frequency,
- tvb, offset + 4, 2, ENC_LITTLE_ENDIAN);
+ /*
+ * This doesn't supply "short GI" information,
+ * so use the 0x80 bit in the Flags field,
+ * if we have it; it's "Currently unspecified
+ * but used" for that purpose, according to
+ * the radiotap.org page for that field.
+ */
+ phdr.presence_flags |= PHDR_802_11_HAS_SHORT_GI;
+ if (rflags & 0x80)
+ phdr.short_gi = 1;
+ else
+ phdr.short_gi = 0;
+ break;
- proto_tree_add_bitmask(radiotap_tree, tvb, offset, hf_radiotap_xchannel_flags, ett_radiotap_xchannel_flags, xchannel_flags, ENC_LITTLE_ENDIAN);
+ case IEEE80211_CHAN_G|IEEE80211_CHAN_HT20:
+ case IEEE80211_CHAN_G|IEEE80211_CHAN_HT40U:
+ case IEEE80211_CHAN_G|IEEE80211_CHAN_HT40D:
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11N_2_4GHZ;
+
+ /*
+ * This doesn't supply "short GI" information,
+ * so use the 0x80 bit in the Flags field,
+ * if we have it; it's "Currently unspecified
+ * but used" for that purpose, according to
+ * the radiotap.org page for that field.
+ */
+ phdr.presence_flags |= PHDR_802_11_HAS_SHORT_GI;
+ if (rflags & 0x80)
+ phdr.short_gi = 1;
+ else
+ phdr.short_gi = 0;
+ break;
+ }
+ if (tree) {
+ static const int * xchannel_flags[] = {
+ &hf_radiotap_xchannel_flags_turbo,
+ &hf_radiotap_xchannel_flags_cck,
+ &hf_radiotap_xchannel_flags_ofdm,
+ &hf_radiotap_xchannel_flags_2ghz,
+ &hf_radiotap_xchannel_flags_5ghz,
+ &hf_radiotap_xchannel_flags_passive,
+ &hf_radiotap_xchannel_flags_dynamic,
+ &hf_radiotap_xchannel_flags_gfsk,
+ &hf_radiotap_xchannel_flags_gsm,
+ &hf_radiotap_xchannel_flags_sturbo,
+ &hf_radiotap_xchannel_flags_half,
+ &hf_radiotap_xchannel_flags_quarter,
+ &hf_radiotap_xchannel_flags_ht20,
+ &hf_radiotap_xchannel_flags_ht40u,
+ &hf_radiotap_xchannel_flags_ht40d,
+ NULL
+ };
+
+ proto_tree_add_item(radiotap_tree,
+ hf_radiotap_xchannel,
+ tvb, offset + 6, 1,
+ ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(radiotap_tree,
+ hf_radiotap_xchannel_frequency,
+ tvb, offset + 4, 2, ENC_LITTLE_ENDIAN);
+
+ proto_tree_add_bitmask(radiotap_tree, tvb, offset, hf_radiotap_xchannel_flags, ett_radiotap_xchannel_flags, xchannel_flags, ENC_LITTLE_ENDIAN);
#if 0
- proto_tree_add_uint(radiotap_tree,
- hf_radiotap_xchannel_maxpower,
- tvb, offset + 7, 1, maxpower);
+ proto_tree_add_uint(radiotap_tree,
+ hf_radiotap_xchannel_maxpower,
+ tvb, offset + 7, 1, maxpower);
#endif
+ }
break;
}
case IEEE80211_RADIOTAP_MCS: {
@@ -1168,6 +1281,27 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
guint gi_length;
gboolean can_calculate_rate;
+ /* This is for 802.11n */
+ if (phdr.presence_flags & PHDR_802_11_HAS_PHY_BAND) {
+ /*
+ * If we have A or G, this means it's really
+ * N in the 5 GHz band or N in the 2.4 GHz
+ * band, respectively.
+ */
+ switch (phdr.phy_band) {
+
+ case PHDR_802_11_PHY_BAND_11A:
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11N_5GHZ;
+ break;
+
+ case PHDR_802_11_PHY_BAND_11G:
+ case PHDR_802_11_PHY_BAND_11G_PURE:
+ case PHDR_802_11_PHY_BAND_11G_MIXED:
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11N_2_4GHZ;
+ break;
+ }
+ }
+
/*
* Start out assuming that we can calculate the rate;
* if we are missing any of the MCS index, channel
@@ -1312,9 +1446,9 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
case IEEE80211_RADIOTAP_AMPDU_STATUS: {
proto_item *it;
proto_tree *ampdu_tree = NULL, *ampdu_flags_tree;
- guint16 flags;
+ guint16 ampdu_flags;
- flags = tvb_get_letohs(tvb, offset + 4);
+ ampdu_flags = tvb_get_letohs(tvb, offset + 4);
if (tree) {
it = proto_tree_add_item(radiotap_tree, hf_radiotap_ampdu,
@@ -1338,7 +1472,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree_add_item(ampdu_flags_tree, hf_radiotap_ampdu_flags_delim_crc_error,
tvb, offset + 4, 2, ENC_LITTLE_ENDIAN);
}
- if (flags & IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN) {
+ if (ampdu_flags & IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN) {
if (ampdu_tree)
proto_tree_add_item(ampdu_tree, hf_radiotap_ampdu_delim_crc,
tvb, offset + 6, 1, ENC_NA);
@@ -1349,7 +1483,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_item *it, *it_root = NULL;
proto_tree *vht_tree = NULL, *vht_known_tree = NULL, *user_tree = NULL;
guint16 known, nsts;
- guint8 flags, bw, mcs_nss;
+ guint8 vht_flags, bw, mcs_nss;
guint bandwidth = 0;
guint gi_length = 0;
guint nss = 0;
@@ -1357,6 +1491,10 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
gboolean can_calculate_rate;
guint i;
+ /* This is for 802.11ac */
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11AC;
+
/*
* Start out assuming that we can calculate the rate;
* if we are missing any of the MCS index, channel
@@ -1365,8 +1503,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
can_calculate_rate = TRUE;
known = tvb_get_letohs(tvb, offset);
- flags = tvb_get_guint8(tvb, offset + 2);
- bw = tvb_get_guint8(tvb, offset + 3);
+ vht_flags = tvb_get_guint8(tvb, offset + 2);
if (tree) {
it_root = proto_tree_add_item(radiotap_tree, hf_radiotap_vht,
@@ -1409,7 +1546,9 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
}
if (known & IEEE80211_RADIOTAP_VHT_HAVE_GI) {
- gi_length = (flags & IEEE80211_RADIOTAP_VHT_SGI) ? 1 : 0;
+ gi_length = (vht_flags & IEEE80211_RADIOTAP_VHT_SGI) ? 1 : 0;
+ phdr.presence_flags |= PHDR_802_11_HAS_SHORT_GI;
+ phdr.short_gi = (gi_length == 0);
if (vht_tree) {
proto_tree_add_item(vht_tree, hf_radiotap_vht_gi,
tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
@@ -1422,9 +1561,9 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (vht_tree) {
it = proto_tree_add_item(vht_tree, hf_radiotap_vht_sgi_nsym_da,
tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
- if ((flags & IEEE80211_RADIOTAP_VHT_SGI_NSYM_DA) &&
+ if ((vht_flags & IEEE80211_RADIOTAP_VHT_SGI_NSYM_DA) &&
(known & IEEE80211_RADIOTAP_VHT_HAVE_GI) &&
- !(flags & IEEE80211_RADIOTAP_VHT_SGI))
+ !(vht_flags & IEEE80211_RADIOTAP_VHT_SGI))
proto_item_append_text(it, " (invalid)");
}
}
@@ -1443,6 +1582,9 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
}
if (known & IEEE80211_RADIOTAP_VHT_HAVE_BW) {
+ bw = tvb_get_guint8(tvb, offset + 3) & IEEE80211_RADIOTAP_VHT_BW_MASK;
+ phdr.presence_flags |= PHDR_802_11_HAS_BANDWIDTH;
+ phdr.bandwidth = bw;
if (bw < sizeof(ieee80211_vht_bw2rate_index)/sizeof(ieee80211_vht_bw2rate_index[0]))
bandwidth = ieee80211_vht_bw2rate_index[bw];
else
@@ -1460,7 +1602,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
nss = (mcs_nss & IEEE80211_RADIOTAP_VHT_NSS);
mcs = (mcs_nss & IEEE80211_RADIOTAP_VHT_MCS) >> 4;
- if ((known & IEEE80211_RADIOTAP_VHT_HAVE_STBC) && (flags & IEEE80211_RADIOTAP_VHT_STBC))
+ if ((known & IEEE80211_RADIOTAP_VHT_HAVE_STBC) && (vht_flags & IEEE80211_RADIOTAP_VHT_STBC))
nsts = 2 * nss;
else
nsts = nss;
diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c
index c0fd5331d3..23a6604af0 100644
--- a/epan/dissectors/packet-ixveriwave.c
+++ b/epan/dissectors/packet-ixveriwave.c
@@ -71,8 +71,6 @@ static frame_end_data previous_frame_data = {0,0};
#define CHAN_CCK 0x00020 /* CCK channel */
#define CHAN_OFDM 0x00040 /* OFDM channel */
-#define CHAN_2GHZ 0x00080 /* 2 GHz spectrum channel. */
-#define CHAN_5GHZ 0x00100 /* 5 GHz spectrum channel */
#define FLAGS_SHORTPRE 0x0002 /* sent/received
* with short
@@ -657,7 +655,7 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
float phyRate;
proto_tree *vweft, *vw_errorFlags_tree = NULL, *vwift,*vw_infoFlags_tree = NULL;
- guint16 vw_flags, vw_info, vw_ht_length, vw_rflags;
+ guint16 vw_flags, vw_chanflags, vw_info, vw_ht_length, vw_rflags;
guint32 vw_errors;
ifg_info *p_ifg_info;
@@ -719,7 +717,7 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
}
offset +=2;
- /* Need to add in 2 more bytes to the offset to account for the channel flags */
+ vw_chanflags = tvb_get_letohs(tvb, offset);
offset +=2;
phyRate = (float)tvb_get_letohs(tvb, offset) / 10;
offset +=2;
@@ -730,7 +728,8 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
offset++;
if ((vw_rflags & FLAGS_CHAN_HT) || (vw_rflags & FLAGS_CHAN_VHT) ) {
- phdr.presence_flags |= (PHDR_802_11_HAS_MCS_INDEX|PHDR_802_11_HAS_NESS);
+ phdr.presence_flags |= (PHDR_802_11_HAS_PHY_BAND|PHDR_802_11_HAS_MCS_INDEX|PHDR_802_11_HAS_NESS);
+ phdr.phy_band = (vw_rflags & FLAGS_CHAN_VHT) ? PHDR_802_11_PHY_BAND_11AC : PHDR_802_11_PHY_BAND_11N;
phdr.mcs_index = mcs_index;
phdr.ness = ness;
if (tree) {
@@ -745,6 +744,11 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
"%.1f (MCS %d)", phyRate, mcs_index);
}
} else {
+ if (vw_chanflags & CHAN_CCK) {
+ phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11B;
+ }
+ /* XXX - 11A vs. 11G */
phdr.presence_flags |= PHDR_802_11_HAS_DATA_RATE;
phdr.data_rate = tvb_get_letohs(tvb, offset-5) / 5;
if (tree) {
diff --git a/epan/dissectors/packet-peekremote.c b/epan/dissectors/packet-peekremote.c
index 864c382c13..23e2bde86e 100644
--- a/epan/dissectors/packet-peekremote.c
+++ b/epan/dissectors/packet-peekremote.c
@@ -118,6 +118,28 @@ static const value_string peekremote_type_vals[] = {
{ 0, NULL }
};
+/*
+ * Extended flags.
+ *
+ * Some determined from bug 10637, some determined from bug 9586,
+ * and the ones present in both agree, so we're assuming that
+ * the "remote Peek" protocol and the "Peek tagged" file format
+ * use the same bits (which wouldn't be too surprising, as they
+ * both come from Wildpackets).
+ */
+#define EXT_FLAG_20_MHZ_LOWER 0x00000001
+#define EXT_FLAG_20_MHZ_UPPER 0x00000002
+#define EXT_FLAG_40_MHZ 0x00000004
+#define EXT_FLAGS_BANDWIDTH 0x00000007
+#define EXT_FLAG_HALF_GI 0x00000008
+#define EXT_FLAG_FULL_GI 0x00000010
+#define EXT_FLAGS_GI 0x00000018
+#define EXT_FLAG_AMPDU 0x00000020
+#define EXT_FLAG_AMSDU 0x00000040
+#define EXT_FLAG_802_11ac 0x00000080
+#define EXT_FLAG_MCS_INDEX_USED 0x00000100
+#define EXT_FLAGS_RESERVED 0xFFFFFE00
+
/* hfi elements */
#define THIS_HF_INIT HFI_INIT(proto_peekremote)
static header_field_info *hfi_peekremote = NULL;
@@ -235,43 +257,43 @@ static header_field_info hfi_peekremote_extflags THIS_HF_INIT =
static header_field_info hfi_peekremote_extflags_20mhz_lower THIS_HF_INIT =
{ "20 MHz Lower", "peekremote.extflags.20mhz_lower", FT_BOOLEAN, 32, TFS(&tfs_yes_no),
- 0x00000001, NULL, HFILL };
+ EXT_FLAG_20_MHZ_LOWER, NULL, HFILL };
static header_field_info hfi_peekremote_extflags_20mhz_upper THIS_HF_INIT =
{ "20 MHz Upper", "peekremote.extflags.20mhz_upper", FT_BOOLEAN, 32, TFS(&tfs_yes_no),
- 0x00000002, NULL, HFILL };
+ EXT_FLAG_20_MHZ_UPPER, NULL, HFILL };
static header_field_info hfi_peekremote_extflags_40mhz THIS_HF_INIT =
{ "40 MHz", "peekremote.extflags.40mhz", FT_BOOLEAN, 32, TFS(&tfs_yes_no),
- 0x00000004, NULL, HFILL };
+ EXT_FLAG_40_MHZ, NULL, HFILL };
static header_field_info hfi_peekremote_extflags_half_gi THIS_HF_INIT =
{ "Half Guard Interval", "peekremote.extflags.half_gi", FT_BOOLEAN, 32, TFS(&tfs_yes_no),
- 0x00000008, NULL, HFILL };
+ EXT_FLAG_HALF_GI, NULL, HFILL };
static header_field_info hfi_peekremote_extflags_full_gi THIS_HF_INIT =
{ "Full Guard Interval", "peekremote.extflags.full_gi", FT_BOOLEAN, 32, TFS(&tfs_yes_no),
- 0x00000010, NULL, HFILL };
+ EXT_FLAG_FULL_GI, NULL, HFILL };
static header_field_info hfi_peekremote_extflags_ampdu THIS_HF_INIT =
{ "AMPDU", "peekremote.extflags.ampdu", FT_BOOLEAN, 32, TFS(&tfs_yes_no),
- 0x00000020, NULL, HFILL };
+ EXT_FLAG_AMPDU, NULL, HFILL };
static header_field_info hfi_peekremote_extflags_amsdu THIS_HF_INIT =
{ "AMSDU", "peekremote.extflags.amsdu", FT_BOOLEAN, 32, TFS(&tfs_yes_no),
- 0x00000040, NULL, HFILL };
+ EXT_FLAG_AMSDU, NULL, HFILL };
static header_field_info hfi_peekremote_extflags_11ac THIS_HF_INIT =
{ "802.11ac", "peekremote.extflags.11ac", FT_BOOLEAN, 32, TFS(&tfs_yes_no),
- 0x00000080, NULL, HFILL };
+ EXT_FLAG_802_11ac, NULL, HFILL };
static header_field_info hfi_peekremote_extflags_future_use THIS_HF_INIT =
{ "MCS index used", "peekremote.extflags.future_use", FT_BOOLEAN, 32, TFS(&tfs_yes_no),
- 0x00000100, NULL, HFILL };
+ EXT_FLAG_MCS_INDEX_USED, NULL, HFILL };
static header_field_info hfi_peekremote_extflags_reserved THIS_HF_INIT =
{ "Reserved", "peekremote.extflags.reserved", FT_UINT32, BASE_HEX, NULL,
- 0xFFFFFE80, "Must be zero", HFILL };
+ EXT_FLAGS_RESERVED, "Must be zero", HFILL };
/* XXX - are the numbers antenna numbers? */
static header_field_info hfi_peekremote_signal_1_dbm THIS_HF_INIT =
@@ -382,6 +404,7 @@ dissect_peekremote_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
guint8 header_version;
guint header_size;
struct ieee_802_11_phdr phdr;
+ guint32 extflags;
guint16 frequency;
tvbuff_t *next_tvb;
@@ -422,6 +445,7 @@ dissect_peekremote_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
offset += (header_size - 9);
} else {
phdr.presence_flags |=
+ PHDR_802_11_HAS_PHY_BAND|
PHDR_802_11_HAS_MCS_INDEX|
PHDR_802_11_HAS_CHANNEL|
PHDR_802_11_HAS_SIGNAL_PERCENT|
@@ -446,6 +470,15 @@ dissect_peekremote_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
offset += 4;
proto_tree_add_item(peekremote_tree, &hfi_peekremote_band, tvb, offset, 4, ENC_BIG_ENDIAN);
offset +=4;
+ /*
+ * XXX - can the band field be used to distinguish between 2.4 GHz
+ * and 5 GHz 11n?
+ */
+ extflags = tvb_get_ntohl(tvb, offset);
+ if (extflags & EXT_FLAG_802_11ac)
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11AC;
+ else
+ phdr.phy_band = PHDR_802_11_PHY_BAND_11N;
offset += dissect_peekremote_extflags(tvb, pinfo, peekremote_tree, offset);
phdr.signal_percent = tvb_get_guint8(tvb, offset);
proto_tree_add_item(peekremote_tree, &hfi_peekremote_signal_percent, tvb, offset, 1, ENC_NA);
diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c
index 15c2dee156..44be9e828a 100644
--- a/epan/dissectors/packet-ppi.c
+++ b/epan/dissectors/packet-ppi.c
@@ -146,6 +146,12 @@
#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
+#define IEEE80211_CHAN_ALL \
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \
+ IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN)
+#define IEEE80211_CHAN_ALLTURBO \
+ (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO)
+
/*
* Useful combinations of channel characteristics.
*/
@@ -159,8 +165,8 @@
(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
#define IEEE80211_CHAN_G \
(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
-#define IEEE80211_CHAN_T \
- (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
+#define IEEE80211_CHAN_108A \
+ (IEEE80211_CHAN_A | IEEE80211_CHAN_TURBO)
#define IEEE80211_CHAN_108G \
(IEEE80211_CHAN_G | IEEE80211_CHAN_TURBO)
#define IEEE80211_CHAN_108PUREG \
@@ -378,7 +384,7 @@ static const value_string vs_80211_common_phy_type[] = {
{ IEEE80211_CHAN_B, "802.11b" },
{ IEEE80211_CHAN_PUREG, "802.11g (pure-g)" },
{ IEEE80211_CHAN_G, "802.11g" },
- { IEEE80211_CHAN_T, "802.11a (turbo)" },
+ { IEEE80211_CHAN_108A, "802.11a (turbo)" },
{ IEEE80211_CHAN_108PUREG, "802.11g (pure-g, turbo)" },
{ IEEE80211_CHAN_108G, "802.11g (turbo)" },
{ IEEE80211_CHAN_FHSS, "FHSS" },
@@ -494,6 +500,7 @@ dissect_80211_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
guint rate_kbps;
guint32 common_flags;
guint16 common_frequency;
+ guint16 chan_flags;
gint8 dbm_value;
gchar *chan_str;
@@ -559,6 +566,44 @@ dissect_80211_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
g_free(chan_str);
ptvcursor_advance(csr, 2);
+ chan_flags = tvb_get_letohs(ptvcursor_tvbuff(csr), ptvcursor_current_offset(csr));
+ switch (chan_flags & IEEE80211_CHAN_ALLTURBO) {
+
+ case IEEE80211_CHAN_FHSS:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11_FHSS;
+ break;
+
+ case IEEE80211_CHAN_A:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11A;
+ break;
+
+ case IEEE80211_CHAN_B:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11B;
+ break;
+
+ case IEEE80211_CHAN_PUREG:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11G_PURE;
+ break;
+
+ case IEEE80211_CHAN_G:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11G_MIXED;
+ break;
+
+ case IEEE80211_CHAN_108A:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11A_108;
+ break;
+
+ case IEEE80211_CHAN_108PUREG:
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11G_PURE_108;
+ break;
+ }
ptvcursor_add_with_subtree(csr, hf_80211_common_chan_flags, 2, ENC_LITTLE_ENDIAN,
ett_dot11_common_channel_flags);
ptvcursor_add_no_advance(csr, hf_80211_common_chan_flags_turbo, 2, ENC_LITTLE_ENDIAN);
@@ -613,6 +658,9 @@ dissect_80211n_mac(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int
int subtree_off = add_subtree ? 4 : 0;
guint32 flags;
+ phdr->presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->phy_band = PHDR_802_11_PHY_BAND_11N;
+
*n_mac_flags = tvb_get_letohl(tvb, offset + subtree_off);
*ampdu_id = tvb_get_letohl(tvb, offset + 4 + subtree_off);
@@ -1178,28 +1226,28 @@ proto_register_ppi(void)
{ &hf_80211_common_chan_flags_turbo,
{ "Turbo", "ppi.80211-common.chan.type.turbo",
- FT_BOOLEAN, 16, NULL, 0x0010, "PPI 802.11-Common Channel Type Turbo", HFILL } },
+ FT_BOOLEAN, 16, NULL, IEEE80211_CHAN_TURBO, "PPI 802.11-Common Channel Type Turbo", HFILL } },
{ &hf_80211_common_chan_flags_cck,
{ "Complementary Code Keying (CCK)", "ppi.80211-common.chan.type.cck",
- FT_BOOLEAN, 16, NULL, 0x0020, "PPI 802.11-Common Channel Type Complementary Code Keying (CCK) Modulation", HFILL } },
+ FT_BOOLEAN, 16, NULL, IEEE80211_CHAN_CCK, "PPI 802.11-Common Channel Type Complementary Code Keying (CCK) Modulation", HFILL } },
{ &hf_80211_common_chan_flags_ofdm,
{ "Orthogonal Frequency-Division Multiplexing (OFDM)", "ppi.80211-common.chan.type.ofdm",
- FT_BOOLEAN, 16, NULL, 0x0040, "PPI 802.11-Common Channel Type Orthogonal Frequency-Division Multiplexing (OFDM)", HFILL } },
+ FT_BOOLEAN, 16, NULL, IEEE80211_CHAN_OFDM, "PPI 802.11-Common Channel Type Orthogonal Frequency-Division Multiplexing (OFDM)", HFILL } },
{ &hf_80211_common_chan_flags_2ghz,
{ "2 GHz spectrum", "ppi.80211-common.chan.type.2ghz",
- FT_BOOLEAN, 16, NULL, 0x0080, "PPI 802.11-Common Channel Type 2 GHz spectrum", HFILL } },
+ FT_BOOLEAN, 16, NULL, IEEE80211_CHAN_2GHZ, "PPI 802.11-Common Channel Type 2 GHz spectrum", HFILL } },
{ &hf_80211_common_chan_flags_5ghz,
{ "5 GHz spectrum", "ppi.80211-common.chan.type.5ghz",
- FT_BOOLEAN, 16, NULL, 0x0100, "PPI 802.11-Common Channel Type 5 GHz spectrum", HFILL } },
+ FT_BOOLEAN, 16, NULL, IEEE80211_CHAN_5GHZ, "PPI 802.11-Common Channel Type 5 GHz spectrum", HFILL } },
{ &hf_80211_common_chan_flags_passive,
{ "Passive", "ppi.80211-common.chan.type.passive",
- FT_BOOLEAN, 16, NULL, 0x0200, "PPI 802.11-Common Channel Type Passive", HFILL } },
+ FT_BOOLEAN, 16, NULL, IEEE80211_CHAN_PASSIVE, "PPI 802.11-Common Channel Type Passive", HFILL } },
{ &hf_80211_common_chan_flags_dynamic,
{ "Dynamic CCK-OFDM", "ppi.80211-common.chan.type.dynamic",
- FT_BOOLEAN, 16, NULL, 0x0400, "PPI 802.11-Common Channel Type Dynamic CCK-OFDM Channel", HFILL } },
+ FT_BOOLEAN, 16, NULL, IEEE80211_CHAN_DYN, "PPI 802.11-Common Channel Type Dynamic CCK-OFDM Channel", HFILL } },
{ &hf_80211_common_chan_flags_gfsk,
{ "Gaussian Frequency Shift Keying (GFSK)", "ppi.80211-common.chan.type.gfsk",
- FT_BOOLEAN, 16, NULL, 0x0800, "PPI 802.11-Common Channel Type Gaussian Frequency Shift Keying (GFSK) Modulation", HFILL } },
+ FT_BOOLEAN, 16, NULL, IEEE80211_CHAN_GFSK, "PPI 802.11-Common Channel Type Gaussian Frequency Shift Keying (GFSK) Modulation", HFILL } },
{ &hf_80211_common_fhss_hopset,
{ "FHSS hopset", "ppi.80211-common.fhss.hopset",
diff --git a/wiretap/commview.c b/wiretap/commview.c
index 57de7605cf..d995e034a0 100644
--- a/wiretap/commview.c
+++ b/wiretap/commview.c
@@ -69,6 +69,16 @@ typedef struct commview_header {
#define FLAGS_COMPRESSED 0x40
#define FLAGS_RESERVED 0x80
+/* Values for the band variable of the header */
+#define BAND_11A 0x01
+#define BAND_11B 0x02
+#define BAND_11G 0x04
+#define BAND_11A_TURBO 0x08
+#define BAND_SUPERG 0x10
+#define BAND_PUBLIC_SAFETY 0x20 /* 499 GHz public safety */
+#define BAND_11N_5GHZ 0x40
+#define BAND_11N_2_4GHZ 0x80
+
/* Capture mediums as defined by the commview file format */
#define MEDIUM_ETHERNET 0
#define MEDIUM_WIFI 1
@@ -150,6 +160,44 @@ commview_read_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf,
PHDR_802_11_HAS_CHANNEL |
PHDR_802_11_HAS_DATA_RATE |
PHDR_802_11_HAS_SIGNAL_PERCENT;
+ switch (cv_hdr.band) {
+
+ case BAND_11A:
+ phdr->pseudo_header.ieee_802_11.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->pseudo_header.ieee_802_11.phy_band = PHDR_802_11_PHY_BAND_11A;
+ break;
+
+ case BAND_11B:
+ phdr->pseudo_header.ieee_802_11.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->pseudo_header.ieee_802_11.phy_band = PHDR_802_11_PHY_BAND_11B;
+ break;
+
+ case BAND_11G:
+ phdr->pseudo_header.ieee_802_11.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->pseudo_header.ieee_802_11.phy_band = PHDR_802_11_PHY_BAND_11G;
+ break;
+
+ case BAND_11A_TURBO:
+ phdr->pseudo_header.ieee_802_11.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->pseudo_header.ieee_802_11.phy_band = PHDR_802_11_PHY_BAND_11A_108;
+ break;
+
+ case BAND_SUPERG:
+ phdr->pseudo_header.ieee_802_11.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ /* So what is "SuperG" here? */
+ phdr->pseudo_header.ieee_802_11.phy_band = PHDR_802_11_PHY_BAND_11G_STURBO;
+ break;
+
+ case BAND_11N_5GHZ:
+ phdr->pseudo_header.ieee_802_11.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->pseudo_header.ieee_802_11.phy_band = PHDR_802_11_PHY_BAND_11N_5GHZ;
+ break;
+
+ case BAND_11N_2_4GHZ:
+ phdr->pseudo_header.ieee_802_11.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ phdr->pseudo_header.ieee_802_11.phy_band = PHDR_802_11_PHY_BAND_11N_2_4GHZ;
+ break;
+ }
phdr->pseudo_header.ieee_802_11.channel = cv_hdr.channel;
phdr->pseudo_header.ieee_802_11.data_rate =
cv_hdr.rate | (cv_hdr.direction << 8);
diff --git a/wiretap/network_instruments.c b/wiretap/network_instruments.c
index cbfbeb49a6..a4e3b67bd7 100644
--- a/wiretap/network_instruments.c
+++ b/wiretap/network_instruments.c
@@ -409,6 +409,7 @@ read_packet_header(wtap *wth, FILE_T fh, union wtap_pseudo_header *pseudo_header
PHDR_802_11_HAS_DATA_RATE |
PHDR_802_11_HAS_SIGNAL_PERCENT;
/* set decryption status */
+ /* XXX - what other bits are there in conditions? */
pseudo_header->ieee_802_11.decrypted = (wireless_header.conditions & WIRELESS_WEP_SUCCESS) != 0;
pseudo_header->ieee_802_11.channel = wireless_header.frequency;
pseudo_header->ieee_802_11.data_rate = wireless_header.rate;
diff --git a/wiretap/netxray.c b/wiretap/netxray.c
index 483ec9b77b..4c55904195 100644
--- a/wiretap/netxray.c
+++ b/wiretap/netxray.c
@@ -1253,6 +1253,11 @@ netxray_process_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
phdr->pseudo_header.ieee_802_11.decrypted = FALSE;
phdr->pseudo_header.ieee_802_11.datapad = FALSE;
+ /*
+ * XXX - any other information, such as PHY
+ * type, frequency, 11n/11ac information,
+ * etc.?
+ */
phdr->pseudo_header.ieee_802_11.channel =
hdr.hdr_2_x.xxx[12];
phdr->pseudo_header.ieee_802_11.data_rate =
diff --git a/wiretap/peektagged.c b/wiretap/peektagged.c
index 153255ed39..b475d8ced5 100644
--- a/wiretap/peektagged.c
+++ b/wiretap/peektagged.c
@@ -101,13 +101,13 @@ typedef struct peektagged_section_header {
#define TAG_PEEKTAGGED_NOISE_DBM 0x0009
#define TAG_PEEKTAGGED_UNKNOWN_0x000A 0x000A
#define TAG_PEEKTAGGED_CENTER_FREQUENCY 0x000D /* Frequency */
-#define TAG_PEEKTAGGED_UNKNOWN_0x000E 0x000E
-#define TAG_PEEKTAGGED_UNKNOWN_0x000F 0x000F /* 000F-0013 - dBm values? */
-#define TAG_PEEKTAGGED_UNKNOWN_0x0010 0x0010
-#define TAG_PEEKTAGGED_UNKNOWN_0x0011 0x0011
-#define TAG_PEEKTAGGED_UNKNOWN_0x0012 0x0012
-#define TAG_PEEKTAGGED_UNKNOWN_0x0013 0x0013
-#define TAG_PEEKTAGGED_UNKNOWN_0x0014 0x0014
+#define TAG_PEEKTAGGED_UNKNOWN_0x000E 0x000E /* "Band"? */
+#define TAG_PEEKTAGGED_UNKNOWN_0x000F 0x000F /* antenna 2 signal dBm? */
+#define TAG_PEEKTAGGED_UNKNOWN_0x0010 0x0010 /* antenna 3 signal dBm? */
+#define TAG_PEEKTAGGED_UNKNOWN_0x0011 0x0011 /* antenna 4 signal dBm? */
+#define TAG_PEEKTAGGED_UNKNOWN_0x0012 0x0012 /* antenna 2 noise dBm? */
+#define TAG_PEEKTAGGED_UNKNOWN_0x0013 0x0013 /* antenna 3 noise dBm? */
+#define TAG_PEEKTAGGED_UNKNOWN_0x0014 0x0014 /* antenna 4 noise dBm? */
#define TAG_PEEKTAGGED_EXT_FLAGS 0x0015 /* Extended flags for 802.11n and beyond */
#define TAG_PEEKTAGGED_SLICE_LENGTH 0xffff
@@ -152,62 +152,6 @@ typedef struct peektagged_section_header {
#define EXT_FLAG_802_11ac 0x00000080
#define EXT_FLAG_MCS_INDEX_USED 0x00000100
-/*
- * XXX - mapping to radiotap, for fields that don't just map to wiretap
- * fields:
- *
- * FLAGS_CONTROL_FRAME: no equivalent - is it useful? Can just look at FC?
- *
- * FLAGS_HAS_CRC_ERROR: flags.{frame failed FCS check}
- *
- * FLAGS_HAS_FRAME_ERROR: no equivalent
- *
- * STATUS_PROTECTED: flags.{sent/received with WEP encryption}?
- *
- * STATUS_DECRYPT_ERROR: no equivalent
- *
- * STATUS_SHORT_PREAMBLE: flags.{sent/received with short preamble}
- *
- * TAG_PEEKTAGGED_CHANNEL: no equivalent, but could be mapped to Channel
- *
- * TAG_PEEKTAGGED_DATA_RATE_OR_MCS_INDEX: Rate if it's a data rate,
- * MCS.mcs if it's an MCS index
- * Does EXT_FLAG_MCS_INDEX_USED map to the "MCS known" bit ?
- *
- * TAG_PEEKTAGGED_SIGNAL_PERC: no equivalent
- *
- * TAG_PEEKTAGGED_SIGNAL_DBM: Antenna signal
- *
- * TAG_PEEKTAGGED_NOISE_PERC: no equivalent
- *
- * TAG_PEEKTAGGED_NOISE_DBM: Antenna noise
- *
- * TAG_PEEKTAGGED_CENTER_FREQUENCY: XChannel.freq
- *
- * TAG_PEEKTAGGED_UNKNOWN_0x000F - TAG_PEEKTAGGED_UNKNOWN_0x0013: no equivalent
- *
- * EXT_FLAG_20_MHZ_LOWER
- * EXT_FLAG_20_MHZ_UPPER
- * EXT_FLAG_40_MHZ:
- * mcs.bandwidth = 0: none of them set
- * mcs.bandwidth = 1: EXT_FLAG_40_MHZ set
- * mcs.bandwidth = 2: EXT_FLAG_20_MHZ_LOWER set
- * mcs.bandwidth = 3: EXT_FLAG_20_MHZ_UPPER set
- * anything else: ???
- *
- * EXT_FLAG_HALF_GI: mcs.{guard interval} = 1 (short GI)
- *
- * EXT_FLAG_FULL_GI: mcs.{guard interval} = 0 (long GI)
- *
- * EXT_FLAG_AMPDU: A-MPDU status present? What about its value?
- *
- * EXT_FLAG_AMSDU: ???
- *
- * EXT_FLAG_802_11ac: nothing currently
- *
- * EXT_FLAG_MCS_INDEX_USED: see above?
- */
-
/* 64-bit time in nanoseconds from the (Windows FILETIME) epoch */
typedef struct peektagged_utime {
guint32 upper;
@@ -579,7 +523,10 @@ peektagged_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
break;
case TAG_PEEKTAGGED_UNKNOWN_0x000A:
- /* XXX - seen in an OmniPeek 802.11n capture; value unknown */
+ /*
+ * XXX - seen in some 802.11 captures.
+ * Always seems to have the value 0 or 5.
+ */
break;
case TAG_PEEKTAGGED_CENTER_FREQUENCY:
@@ -589,35 +536,118 @@ peektagged_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
break;
case TAG_PEEKTAGGED_UNKNOWN_0x000E:
- /* XXX - seen in an AiroPeek/OmniPeek capture; value unknown */
+ /*
+ * XXX - seen in some 802.11 captures.
+ * Usually has the value 4, but, in some packets, has the
+ * values 6 or 302.
+ *
+ * Is this the mysterious "band" field that shows up in
+ * some "Peek remote" protocol captures, with values in
+ * the 30x or 40x ranges? It's not always associated
+ * with the "extended flags" tag for HT/VHT information,
+ * so it's probably not 11n/11ac-specific. Values other
+ * than 4 appear, in my captures, only in packets with
+ * the "extended flags" tag. 302 appeared in a packet
+ * with EXT_FLAG_MCS_INDEX_USED; 6 appeared in packets
+ * without EXT_FLAG_MCS_INDEX_USED.
+ */
break;
case TAG_PEEKTAGGED_UNKNOWN_0x000F:
- /* XXX - seen in an AiroPeek/OmniPeek capture; dBm value? */
+ /*
+ * XXX - seen in some 802.11 captures; dB or dBm value?
+ * Multiple antennas?
+ */
break;
case TAG_PEEKTAGGED_UNKNOWN_0x0010:
- /* XXX - seen in an AiroPeek/OmniPeek capture; dBm value? */
+ /*
+ * XXX - seen in some 802.11 captures; dB or dBm value?
+ * Multiple antennas?
+ */
break;
case TAG_PEEKTAGGED_UNKNOWN_0x0011:
- /* XXX - seen in an AiroPeek/OmniPeek capture; dBm value? */
+ /*
+ * XXX - seen in some 802.11 captures; dB or dBm value?
+ * Multiple antennas?
+ */
break;
case TAG_PEEKTAGGED_UNKNOWN_0x0012:
- /* XXX - seen in an AiroPeek/OmniPeek capture; dBm value? */
+ /*
+ * XXX - seen in some 802.11 captures; dB or dBm value?
+ * Multiple antennas?
+ */
break;
case TAG_PEEKTAGGED_UNKNOWN_0x0013:
- /* XXX - seen in an AiroPeek/OmniPeek capture; dBm value? */
+ /*
+ * XXX - seen in some 802.11 captures; dB or dBm value?
+ * Multiple antennas?
+ */
break;
case TAG_PEEKTAGGED_UNKNOWN_0x0014:
- /* XXX - seen in an AiroPeek/OmniPeek capture; value unknown */
+ /*
+ * XXX - seen in some 802.11 captures; dB or dBm value?
+ * Multiple antennas?
+ */
break;
case TAG_PEEKTAGGED_EXT_FLAGS:
+ /*
+ * We assume this is present for HT and VHT frames and absent
+ * for other frames.
+ */
ext_flags = pletoh32(&tag_value[2]);
+ ieee_802_11.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
+ /* XXX - any way to determine the band? */
+ ieee_802_11.phy_band = (ext_flags & EXT_FLAG_802_11ac) ? PHDR_802_11_PHY_BAND_11AC : PHDR_802_11_PHY_BAND_11N;
+
+ switch (ext_flags & EXT_FLAGS_BANDWIDTH) {
+
+ case 0:
+ ieee_802_11.presence_flags |= PHDR_802_11_HAS_BANDWIDTH;
+ ieee_802_11.bandwidth = PHDR_802_11_BANDWIDTH_20_MHZ;
+ break;
+
+ case EXT_FLAG_20_MHZ_LOWER:
+ ieee_802_11.presence_flags |= PHDR_802_11_HAS_BANDWIDTH;
+ ieee_802_11.bandwidth = PHDR_802_11_BANDWIDTH_20_20L;
+ break;
+
+ case EXT_FLAG_20_MHZ_UPPER:
+ ieee_802_11.presence_flags |= PHDR_802_11_HAS_BANDWIDTH;
+ ieee_802_11.bandwidth = PHDR_802_11_BANDWIDTH_20_20U;
+ break;
+
+ case EXT_FLAG_40_MHZ:
+ ieee_802_11.presence_flags |= PHDR_802_11_HAS_BANDWIDTH;
+ ieee_802_11.bandwidth = PHDR_802_11_BANDWIDTH_40_MHZ;
+ break;
+
+ default:
+ /* Mutually exclusive flags set */
+ break;
+ }
+
+ switch (ext_flags & EXT_FLAGS_GI) {
+
+ case EXT_FLAG_HALF_GI:
+ ieee_802_11.presence_flags |= PHDR_802_11_HAS_SHORT_GI;
+ ieee_802_11.short_gi = 1;
+ break;
+
+ case EXT_FLAG_FULL_GI:
+ ieee_802_11.presence_flags |= PHDR_802_11_HAS_SHORT_GI;
+ ieee_802_11.short_gi = 0;
+ break;
+
+ default:
+ /* Mutually exclusive flags set or nothing set */
+ break;
+ }
break;
case TAG_PEEKTAGGED_SLICE_LENGTH:
@@ -683,55 +713,8 @@ peektagged_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
/* It's an MCS index. */
ieee_802_11.presence_flags |= PHDR_802_11_HAS_MCS_INDEX;
ieee_802_11.mcs_index = data_rate_or_mcs_index;
-
- /*
- * Fill in other 802.11n information.
- */
- switch (ext_flags & EXT_FLAGS_BANDWIDTH) {
-
- case 0:
- ieee_802_11.presence_flags |= PHDR_802_11_HAS_BANDWIDTH;
- ieee_802_11.bandwidth = PHDR_802_11_BANDWIDTH_20_MHZ;
- break;
-
- case EXT_FLAG_20_MHZ_LOWER:
- ieee_802_11.presence_flags |= PHDR_802_11_HAS_BANDWIDTH;
- ieee_802_11.bandwidth = PHDR_802_11_BANDWIDTH_20_20L;
- break;
-
- case EXT_FLAG_20_MHZ_UPPER:
- ieee_802_11.presence_flags |= PHDR_802_11_HAS_BANDWIDTH;
- ieee_802_11.bandwidth = PHDR_802_11_BANDWIDTH_20_20U;
- break;
-
- case EXT_FLAG_40_MHZ:
- ieee_802_11.presence_flags |= PHDR_802_11_HAS_BANDWIDTH;
- ieee_802_11.bandwidth = PHDR_802_11_BANDWIDTH_40_MHZ;
- break;
-
- default:
- /* Mutually exclusive flags set */
- break;
- }
-
- switch (ext_flags & EXT_FLAGS_GI) {
-
- case EXT_FLAG_HALF_GI:
- ieee_802_11.presence_flags |= PHDR_802_11_HAS_SHORT_GI;
- ieee_802_11.short_gi = 1;
- break;
-
- case EXT_FLAG_FULL_GI:
- ieee_802_11.presence_flags |= PHDR_802_11_HAS_SHORT_GI;
- ieee_802_11.short_gi = 0;
- break;
-
- default:
- /* Mutually exclusive flags set */
- break;
- }
} else {
- /* It's a data rate */
+ /* It's a data rate. */
ieee_802_11.presence_flags |= PHDR_802_11_HAS_DATA_RATE;
ieee_802_11.data_rate = data_rate_or_mcs_index;
}
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index fbdd39933d..5da0261956 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -559,10 +559,11 @@ struct ieee_802_11_phdr {
gboolean decrypted; /* TRUE if frame is decrypted even if "protected" bit is set */
gboolean datapad; /* TRUE if frame has padding between 802.11 header and payload */
guint32 presence_flags; /* Flags indicating presence of fields */
+ guint16 phy_band; /* Type of PHY and band */
guint16 channel; /* Channel number */
guint16 data_rate; /* Data rate, in .5 Mb/s units */
guint16 mcs_index; /* MCS index */
- guint bandwidth:2; /* Bandwidth = 20 MHz, 40 MHz, 20+20L, 20+20U */
+ guint bandwidth; /* Bandwidth = 20 MHz, 40 MHz, etc. */
guint short_gi:1; /* True for short guard interval */
guint greenfield:1; /* True for greenfield, short for mixed */
guint ldpc:1; /* True for LDPC FEC */
@@ -576,26 +577,65 @@ struct ieee_802_11_phdr {
guint64 tsf_timestamp;
};
-#define PHDR_802_11_HAS_CHANNEL 0x00000001 /* channel */
-#define PHDR_802_11_HAS_DATA_RATE 0x00000002 /* data_rate */
-#define PHDR_802_11_HAS_MCS_INDEX 0x00000004 /* mcs */
-#define PHDR_802_11_HAS_BANDWIDTH 0x00000008 /* bandwidth */
-#define PHDR_802_11_HAS_SHORT_GI 0x00000010 /* short_gi */
-#define PHDR_802_11_HAS_GREENFIELD 0x00000020 /* greenfield */
-#define PHDR_802_11_HAS_LDPC 0x00000040 /* ldpc */
-#define PHDR_802_11_HAS_STBC_STREAMS 0x00000080 /* stbc_streams */
-#define PHDR_802_11_HAS_NESS 0x00000100 /* ness */
-#define PHDR_802_11_HAS_FREQUENCY 0x00000200 /* frequency */
-#define PHDR_802_11_HAS_SIGNAL_PERCENT 0x00000400 /* signal_percent */
-#define PHDR_802_11_HAS_NOISE_PERCENT 0x00000800 /* noise_percent */
-#define PHDR_802_11_HAS_SIGNAL_DBM 0x00001000 /* signal_dbm */
-#define PHDR_802_11_HAS_NOISE_DBM 0x00002000 /* noise_dbm */
-#define PHDR_802_11_HAS_TSF_TIMESTAMP 0x00004000 /* tsf_timestamp */
-
-#define PHDR_802_11_BANDWIDTH_20_MHZ 0 /* 20 MHz */
-#define PHDR_802_11_BANDWIDTH_40_MHZ 1 /* 40 MHz */
-#define PHDR_802_11_BANDWIDTH_20_20L 2 /* 20 + 20L */
-#define PHDR_802_11_BANDWIDTH_20_20U 3 /* 20 + 20U */
+#define PHDR_802_11_HAS_PHY_BAND 0x00000001 /* phy_band */
+#define PHDR_802_11_HAS_CHANNEL 0x00000002 /* channel */
+#define PHDR_802_11_HAS_DATA_RATE 0x00000004 /* data_rate */
+#define PHDR_802_11_HAS_MCS_INDEX 0x00000008 /* mcs */
+#define PHDR_802_11_HAS_BANDWIDTH 0x00000010 /* bandwidth */
+#define PHDR_802_11_HAS_SHORT_GI 0x00000020 /* short_gi */
+#define PHDR_802_11_HAS_GREENFIELD 0x00000040 /* greenfield */
+#define PHDR_802_11_HAS_LDPC 0x00000080 /* ldpc */
+#define PHDR_802_11_HAS_STBC_STREAMS 0x00000100 /* stbc_streams */
+#define PHDR_802_11_HAS_NESS 0x00000200 /* ness */
+#define PHDR_802_11_HAS_FREQUENCY 0x00000400 /* frequency */
+#define PHDR_802_11_HAS_SIGNAL_PERCENT 0x00000800 /* signal_percent */
+#define PHDR_802_11_HAS_NOISE_PERCENT 0x00001000 /* noise_percent */
+#define PHDR_802_11_HAS_SIGNAL_DBM 0x00002000 /* signal_dbm */
+#define PHDR_802_11_HAS_NOISE_DBM 0x00004000 /* noise_dbm */
+#define PHDR_802_11_HAS_TSF_TIMESTAMP 0x00008000 /* tsf_timestamp */
+
+#define PHDR_802_11_PHY_BAND_11_FHSS 0 /* 802.11 FHSS (2.4 GHz GFSK) */
+#define PHDR_802_11_PHY_BAND_11_DSSS 1 /* 802.11 DSSS (2.4 GHz not GFSK) */
+#define PHDR_802_11_PHY_BAND_11B 2 /* 802.11b (2.4 GHz CCK) */
+#define PHDR_802_11_PHY_BAND_11A 3 /* 802.11a (5 GHz OFDM) */
+#define PHDR_802_11_PHY_BAND_11G 4 /* 802.11g (2.4 GHz, unknown modulation) */
+#define PHDR_802_11_PHY_BAND_11G_PURE 5 /* pure 802.11g (2.4 GHz OFDM) */
+#define PHDR_802_11_PHY_BAND_11G_MIXED 6 /* 802.11g (2.4 GHz dynamic CCK-OFDM) */
+#define PHDR_802_11_PHY_BAND_11A_108 7 /* turbo 802.11a */
+#define PHDR_802_11_PHY_BAND_11G_PURE_108 8 /* turbo pure 802.11g */
+#define PHDR_802_11_PHY_BAND_11G_MIXED_108 9 /* turbo 802.11g (dynamic CCK-OFDM) */
+#define PHDR_802_11_PHY_BAND_11G_STURBO 10 /* static turbo 802.11g */
+#define PHDR_802_11_PHY_BAND_11N 11 /* 802.11n (HT, unknown band) */
+#define PHDR_802_11_PHY_BAND_11N_5GHZ 12 /* 802.11n (5 GHz HT) */
+#define PHDR_802_11_PHY_BAND_11N_2_4GHZ 13 /* 802.11n (2.4 GHz HT) */
+#define PHDR_802_11_PHY_BAND_11AC 14 /* 802.11ac (VHT) */
+
+#define PHDR_802_11_BANDWIDTH_20_MHZ 0 /* 20 MHz */
+#define PHDR_802_11_BANDWIDTH_40_MHZ 1 /* 40 MHz */
+#define PHDR_802_11_BANDWIDTH_20_20L 2 /* 20 + 20L, 40 MHz */
+#define PHDR_802_11_BANDWIDTH_20_20U 3 /* 20 + 20U, 40 MHz */
+#define PHDR_802_11_BANDWIDTH_80_MHZ 4 /* 80 MHz */
+#define PHDR_802_11_BANDWIDTH_40_40L 5 /* 40 + 40L MHz, 80 MHz */
+#define PHDR_802_11_BANDWIDTH_40_40U 6 /* 40 + 40U MHz, 80 MHz */
+#define PHDR_802_11_BANDWIDTH_20LL 7 /* ???, 80 MHz */
+#define PHDR_802_11_BANDWIDTH_20LU 8 /* ???, 80 MHz */
+#define PHDR_802_11_BANDWIDTH_20UL 9 /* ???, 80 MHz */
+#define PHDR_802_11_BANDWIDTH_20UU 10 /* ???, 80 MHz */
+#define PHDR_802_11_BANDWIDTH_160_MHZ 11 /* 160 MHz */
+#define PHDR_802_11_BANDWIDTH_80_80L 12 /* 80 + 80L, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_80_80U 13 /* 80 + 80U, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_40LL 14 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_40LU 15 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_40UL 16 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_40UU 17 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_20LLL 18 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_20LLU 19 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_20LUL 20 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_20LUU 21 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_20ULL 22 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_20ULU 23 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_20UUL 24 /* ???, 160 MHz */
+#define PHDR_802_11_BANDWIDTH_20UUU 25 /* ???, 160 MHz */
/* Packet "pseudo-header" for the output from CoSine L2 debug output. */