aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
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
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')
-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
7 files changed, 447 insertions, 125 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",