aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--epan/dissectors/packet-aruba-erm.c2
-rw-r--r--epan/dissectors/packet-capwap.c2
-rw-r--r--epan/dissectors/packet-cisco-wids.c2
-rw-r--r--epan/dissectors/packet-ieee80211.c60
-rw-r--r--epan/dissectors/packet-lwapp.c4
-rw-r--r--epan/dissectors/packet-peekremote.c4
-rw-r--r--epan/dissectors/packet-sflow.c2
-rw-r--r--epan/dissectors/packet-wassp.c4
8 files changed, 56 insertions, 24 deletions
diff --git a/epan/dissectors/packet-aruba-erm.c b/epan/dissectors/packet-aruba-erm.c
index 6325b88d14..3cc9be1513 100644
--- a/epan/dissectors/packet-aruba-erm.c
+++ b/epan/dissectors/packet-aruba-erm.c
@@ -282,7 +282,7 @@ proto_reg_handoff_aruba_erm(void)
static gboolean initialized = FALSE;
if (!initialized) {
- ieee80211_handle = find_dissector("wlan");
+ ieee80211_handle = find_dissector("wlan_withoutfcs");
ppi_handle = find_dissector("ppi");
peek_handle = find_dissector("peekremote");
data_handle = find_dissector("data");
diff --git a/epan/dissectors/packet-capwap.c b/epan/dissectors/packet-capwap.c
index 38aea4db24..29e8bc5108 100644
--- a/epan/dissectors/packet-capwap.c
+++ b/epan/dissectors/packet-capwap.c
@@ -2607,7 +2607,7 @@ proto_reg_handoff_capwap(void)
capwap_data_handle = create_dissector_handle(dissect_capwap_data, proto_capwap);
dtls_handle = find_dissector("dtls");
ieee8023_handle = find_dissector("eth_withoutfcs");
- ieee80211_handle = find_dissector("wlan");
+ ieee80211_handle = find_dissector("wlan_withoutfcs");
ieee80211_bsfc_handle = find_dissector("wlan_bsfc");
data_handle = find_dissector("data");
diff --git a/epan/dissectors/packet-cisco-wids.c b/epan/dissectors/packet-cisco-wids.c
index 66f882b001..fe98b2b074 100644
--- a/epan/dissectors/packet-cisco-wids.c
+++ b/epan/dissectors/packet-cisco-wids.c
@@ -196,7 +196,7 @@ proto_reg_handoff_cwids(void)
if (!initialized) {
cwids_handle = create_dissector_handle(dissect_cwids, proto_cwids);
dissector_add_handle("udp.port", cwids_handle);
- ieee80211_handle = find_dissector("wlan");
+ ieee80211_handle = find_dissector("wlan_withoutfcs");
initialized = TRUE;
} else {
if (saved_udp_port != 0) {
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);
diff --git a/epan/dissectors/packet-lwapp.c b/epan/dissectors/packet-lwapp.c
index 50ca5e4a02..5ff54d1355 100644
--- a/epan/dissectors/packet-lwapp.c
+++ b/epan/dissectors/packet-lwapp.c
@@ -1,7 +1,7 @@
/* packet-lwapp.c
*
* Routines for LWAPP encapsulated packet disassembly
- * draft-ohara-capwap-lwapp-N (the current draft is 0)
+ * RFC 5412
*
* Copyright (c) 2003 by David Frascone <dave@frascone.com>
*
@@ -547,7 +547,7 @@ proto_reg_handoff_lwapp(void)
* Get handles for the Ethernet and wireless dissectors.
*/
eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
- wlan_handle = find_dissector("wlan");
+ wlan_handle = find_dissector("wlan_withoutfcs");
wlan_bsfc_handle = find_dissector("wlan_bsfc");
data_handle = find_dissector("data");
diff --git a/epan/dissectors/packet-peekremote.c b/epan/dissectors/packet-peekremote.c
index 42be430875..be4e32e913 100644
--- a/epan/dissectors/packet-peekremote.c
+++ b/epan/dissectors/packet-peekremote.c
@@ -450,7 +450,6 @@ dissect_peekremote_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
proto_item_set_end(ti, tvb, offset);
next_tvb = tvb_new_subset_remaining(tvb, offset);
- pinfo->pseudo_header->ieee_802_11.fcs_len = 4;
call_dissector(ieee80211_handle, next_tvb, pinfo, tree);
return TRUE;
}
@@ -492,7 +491,6 @@ dissect_peekremote_legacy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
}
proto_item_set_end(ti, tvb, 20);
next_tvb = tvb_new_subset_remaining(tvb, 20);
- pinfo->pseudo_header->ieee_802_11.fcs_len = 4;
return 20 + call_dissector(ieee80211_handle, next_tvb, pinfo, tree);
}
@@ -575,7 +573,7 @@ proto_reg_handoff_peekremote(void)
{
dissector_handle_t peekremote_handle;
- ieee80211_handle = find_dissector("wlan_datapad");
+ ieee80211_handle = find_dissector("wlan_datapad_withfcs");
peekremote_handle = new_create_dissector_handle(dissect_peekremote_legacy, proto_peekremote);
dissector_add_uint("udp.port", 5000, peekremote_handle);
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c
index 14a6824ba4..53686c0a96 100644
--- a/epan/dissectors/packet-sflow.c
+++ b/epan/dissectors/packet-sflow.c
@@ -3661,7 +3661,7 @@ proto_reg_handoff_sflow_245(void) {
/* wireshark does not have POS dissector yet */
pos_handle = data_handle;
#endif
- ieee80211_mac_handle = find_dissector("wlan");
+ ieee80211_mac_handle = find_dissector("wlan_withoutfcs");
#if 0
ieee80211_ampdu_handle = find_dissector("ampdu");
ieee80211_amsdu_subframe_handle = find_dissector("wlan_aggregate");
diff --git a/epan/dissectors/packet-wassp.c b/epan/dissectors/packet-wassp.c
index e6bb373e0f..a822c5320d 100644
--- a/epan/dissectors/packet-wassp.c
+++ b/epan/dissectors/packet-wassp.c
@@ -24,7 +24,7 @@
*/
/*
- http://ietfreport.isoc.org/all-ids/draft-singh-capwap-ctp-02.txt
+ https://tools.ietf.org/html/draft-singh-capwap-ctp-02
looks very similar (but not always identical).
AC: Access Controller
@@ -2113,6 +2113,6 @@ proto_reg_handoff_wassp(void)
#endif
snmp_handle = find_dissector("snmp");
- ieee80211_handle = find_dissector("wlan");
+ ieee80211_handle = find_dissector("wlan_withoutfcs");
}