summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-ixveriwave.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-06-25 12:14:39 -0700
committerGuy Harris <guy@alum.mit.edu>2015-06-25 19:15:56 +0000
commitf1bc598d87aeba56f2bd4a1151543664388bb8c7 (patch)
tree0ae46fdda5a2183986739bbed78f97c5bba59dbd /epan/dissectors/packet-ixveriwave.c
parent8a89ebbf40b5931fc2a8afd6ed6f5bf166354687 (diff)
downloadwireshark-f1bc598d87aeba56f2bd4a1151543664388bb8c7.tar.gz
Clean up 802.11 radio information handling.
Have a field that holds the PHY type but nothing else. Have a union with structures holding PHY-type-specific information, as a bunch of attributes are PHY-specific. If we have a channel and band, but don't have the frequency, attempt to calculate the frequency, and add that to the radio information if we succeed. If we have the frequency, but don't have the channel, attempt to calculate the channel, and add that to the radio information if we succeed. Handle FHSS information, 11a "half/quarter-clocked" and turbo information, 11g normal vs. Super G, additional 11n and 11ac information, and the "short preamble" flag for 11b and 11g. Add a PHY type for 11 legacy DSSS and detect it if possible. Clean up the AVS dissector - make all fields wlancap. fields (if you want generic fields, use the wlan_radio. fields). Set more fields when writing out Commview Wi-Fi files. Change-Id: I691ac59f5e9e1a23779b56a65124049914b72e69 Reviewed-on: https://code.wireshark.org/review/9146 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-ixveriwave.c')
-rw-r--r--epan/dissectors/packet-ixveriwave.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c
index 23a6604af0..71870a3af4 100644
--- a/epan/dissectors/packet-ixveriwave.c
+++ b/epan/dissectors/packet-ixveriwave.c
@@ -666,6 +666,7 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
phdr.fcs_len = 0; /* no FCS */
phdr.decrypted = FALSE;
phdr.datapad = FALSE;
+ phdr.phy = PHDR_802_11_PHY_UNKNOWN;
phdr.presence_flags = 0;
/* First add the IFG information, need to grab the info bit field here */
@@ -685,10 +686,6 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
offset += 2;
vw_rflags = tvb_get_letohs(tvb, offset);
- if ((vw_rflags & FLAGS_CHAN_HT) || (vw_rflags & FLAGS_CHAN_VHT) ) {
- phdr.presence_flags |= PHDR_802_11_HAS_SHORT_GI;
- phdr.short_gi = ((vw_rflags & FLAGS_CHAN_SHORTGI) != 0);
- }
if (tree) {
ft = proto_tree_add_uint(tap_tree, hf_radiotap_flags, tvb, offset, 2, vw_rflags);
flags_tree = proto_item_add_subtree(ft, ett_radiotap_flags);
@@ -727,11 +724,24 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
offset++;
offset++;
- if ((vw_rflags & FLAGS_CHAN_HT) || (vw_rflags & FLAGS_CHAN_VHT) ) {
- 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 ((vw_rflags & FLAGS_CHAN_HT) || (vw_rflags & FLAGS_CHAN_VHT)) {
+ if (vw_rflags & FLAGS_CHAN_VHT) {
+ phdr.phy = PHDR_802_11_PHY_11AC;
+ phdr.phy_info.info_11ac.presence_flags =
+ PHDR_802_11AC_HAS_MCS_INDEX |
+ PHDR_802_11AC_HAS_SHORT_GI;
+ phdr.phy_info.info_11ac.mcs_index = mcs_index;
+ phdr.phy_info.info_11ac.short_gi = ((vw_rflags & FLAGS_CHAN_SHORTGI) != 0);
+ } else {
+ phdr.phy = PHDR_802_11_PHY_11N;
+ phdr.phy_info.info_11ac.presence_flags =
+ PHDR_802_11N_HAS_MCS_INDEX |
+ PHDR_802_11N_HAS_SHORT_GI |
+ PHDR_802_11N_HAS_NESS;
+ phdr.phy_info.info_11n.mcs_index = mcs_index;
+ phdr.phy_info.info_11n.short_gi = ((vw_rflags & FLAGS_CHAN_SHORTGI) != 0);
+ phdr.phy_info.info_11n.ness = ness;
+ }
if (tree) {
proto_tree_add_item(tap_tree, hf_radiotap_mcsindex,
tvb, offset - 2, 1, ENC_BIG_ENDIAN);
@@ -744,11 +754,10 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
"%.1f (MCS %d)", phyRate, mcs_index);
}
} else {
+ /* XXX - CHAN_OFDM could be 11a or 11g */
if (vw_chanflags & CHAN_CCK) {
- phdr.presence_flags |= PHDR_802_11_HAS_PHY_BAND;
- phdr.phy_band = PHDR_802_11_PHY_BAND_11B;
+ phdr.phy = PHDR_802_11_PHY_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) {