aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee80211.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-05-29 10:56:46 -0700
committerGuy Harris <guy@alum.mit.edu>2014-05-29 17:57:14 +0000
commit21a1208735315a3a67e8a66ae6b5cb2776be6d60 (patch)
tree807403b835dc9b64e636128ad39397e3c8b358f6 /epan/dissectors/packet-ieee80211.c
parent8b6c4e71ad5dec0318dc9fac9fcd710a25b5e449 (diff)
Introduce 802.11 dissectors with wired-in "FCS present" indications.
For a number of protocols that encapsulate 802.11 frames inside packets, whether the frame includes an FCS or not is specified by the protocol, not by whether the link-layer frame carrying the packets *itself* includes an FCS. As we've done with Ethernet, add "_withfcs" and "_withoutfcs" dissectors, which *don't* check the pseudo-header FCS length indication, and call those, rather than dissectors that check the pseudo-header length indication, from the dissectors for those protocols. Change-Id: Ib8c8ecdd872e1782fdfc66e7573415d91911a62e Reviewed-on: https://code.wireshark.org/review/1866 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-ieee80211.c')
-rw-r--r--epan/dissectors/packet-ieee80211.c60
1 files changed, 47 insertions, 13 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 3904880c27..7f78a5dbeb 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -17586,7 +17586,8 @@ dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo,
}
/*
- * Dissect 802.11 with a variable-length link-layer header.
+ * Dissect 802.11 with a variable-length link-layer header and with the FCS
+ * presence or absence indicated by the pseudo-header.
*/
static void
dissect_ieee80211 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -17596,6 +17597,26 @@ dissect_ieee80211 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/*
+ * Dissect 802.11 with a variable-length link-layer header and with an
+ * FCS.
+ */
+static void
+dissect_ieee80211_withfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ dissect_ieee80211_common (tvb, pinfo, tree, FALSE, 4, FALSE, FALSE, FALSE, FALSE);
+}
+
+/*
+ * Dissect 802.11 with a variable-length link-layer header and without an
+ * FCS.
+ */
+static void
+dissect_ieee80211_withoutfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ dissect_ieee80211_common (tvb, pinfo, tree, FALSE, 0, FALSE, FALSE, FALSE, FALSE);
+}
+
+/*
* Dissect 802.11 with a variable-length link-layer header.
*/
static void
@@ -17606,19 +17627,29 @@ dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/*
- * Dissect 802.11 with a variable-length link-layer header and data padding.
+ * Dissect 802.11 with a variable-length link-layer header and data padding
+ * and with an FCS.
*/
static void
-dissect_ieee80211_datapad (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+dissect_ieee80211_datapad_withfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
- pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, TRUE, FALSE, FALSE);
+ dissect_ieee80211_common (tvb, pinfo, tree, FALSE, 4, FALSE, TRUE, FALSE, FALSE);
+}
+
+/*
+ * Dissect 802.11 with a variable-length link-layer header and data padding
+ * and without an FCS.
+ */
+static void
+dissect_ieee80211_datapad_withoutfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ dissect_ieee80211_common (tvb, pinfo, tree, FALSE, 0, FALSE, TRUE, FALSE, FALSE);
}
/*
* Dissect 802.11 with a variable-length link-layer header and a byte-swapped
- * control field (some hardware sends out LWAPP-encapsulated 802.11
- * packets with the control field byte swapped).
+ * control field and with no FCS (some hardware sends out LWAPP-encapsulated
+ * 802.11 packets with the control field byte swapped).
*/
static void
dissect_ieee80211_bsfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -17628,7 +17659,7 @@ dissect_ieee80211_bsfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Dissect 802.11 with a fixed-length link-layer header (padded to the
- * maximum length).
+ * maximum length) and no FCS.
*/
static void
dissect_ieee80211_fixed (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -25873,11 +25904,14 @@ proto_register_ieee80211 (void)
expert_ieee80211 = expert_register_protocol(proto_wlan);
expert_register_field_array(expert_ieee80211, ei, array_length(ei));
- register_dissector("wlan", dissect_ieee80211, proto_wlan);
- register_dissector("wlan_fixed", dissect_ieee80211_fixed, proto_wlan);
- register_dissector("wlan_bsfc", dissect_ieee80211_bsfc, proto_wlan);
- register_dissector("wlan_datapad", dissect_ieee80211_datapad, proto_wlan);
- register_dissector("wlan_ht", dissect_ieee80211_ht, proto_wlan);
+ register_dissector("wlan", dissect_ieee80211, proto_wlan);
+ register_dissector("wlan_withfcs", dissect_ieee80211_withfcs, proto_wlan);
+ register_dissector("wlan_withoutfcs", dissect_ieee80211_withoutfcs, proto_wlan);
+ register_dissector("wlan_fixed", dissect_ieee80211_fixed, proto_wlan);
+ register_dissector("wlan_bsfc", dissect_ieee80211_bsfc, proto_wlan);
+ register_dissector("wlan_datapad_withfcs", dissect_ieee80211_datapad_withfcs, proto_wlan);
+ register_dissector("wlan_datapad_withoutfcs", dissect_ieee80211_datapad_withoutfcs, proto_wlan);
+ register_dissector("wlan_ht", dissect_ieee80211_ht, proto_wlan);
register_init_routine(wlan_defragment_init);
register_init_routine(wlan_retransmit_init);