summaryrefslogtreecommitdiff
path: root/wiretap/commview.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-06-22 15:04:28 -0700
committerGuy Harris <guy@alum.mit.edu>2015-06-22 22:05:17 +0000
commit8aa91b31b90e6ba2ab7391c0395548a3901df9d0 (patch)
treebd1c52fd465235c87fd944a88905bdc7191b3259 /wiretap/commview.c
parent8abe108a3c942a10b58d58a1974cda49e10b2a43 (diff)
downloadwireshark-8aa91b31b90e6ba2ab7391c0395548a3901df9d0.tar.gz
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 'wiretap/commview.c')
-rw-r--r--wiretap/commview.c48
1 files changed, 48 insertions, 0 deletions
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);