aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-03-29 19:01:40 (GMT)
committerJouni Malinen <j@w1.fi>2010-03-29 19:01:40 (GMT)
commitb91ab76e8ca3dceb6b0d9262988bbff12e722220 (patch)
treee26ee04e081322f9a4f7c8397b2c057ac3498662 /src
parent90a3206a1449af0058704482b4703b1a9f7c3d95 (diff)
downloadhostap-b91ab76e8ca3dceb6b0d9262988bbff12e722220.zip
hostap-b91ab76e8ca3dceb6b0d9262988bbff12e722220.tar.gz
hostap-b91ab76e8ca3dceb6b0d9262988bbff12e722220.tar.bz2
Add test commands for sending deauth/disassoc without dropping state
This can be used to test 802.11w by sending a protected or unprotected deauth/disassoc frame. hostapd_cli deauth <dst addr> test=<0/1> hostapd_cli disassoc <dst addr> test=<0/1> test=0: unprotected test=1: protected
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver.h14
-rw-r--r--src/drivers/driver_ndis.c3
-rw-r--r--src/drivers/driver_nl80211.c10
3 files changed, 26 insertions, 1 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 1d51a49..39bbcd9 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1774,6 +1774,20 @@ struct wpa_driver_ops {
* least %hysteresis from the previously indicated signal change event.
*/
int (*signal_monitor)(void *priv, int threshold, int hysteresis);
+
+ /**
+ * send_frame - Send IEEE 802.11 frame (testing use only)
+ * @priv: Private driver interface data
+ * @data: IEEE 802.11 frame with IEEE 802.11 header
+ * @data_len: Size of the frame
+ * @encrypt: Whether to encrypt the frame (if keys are set)
+ * Returns: 0 on success, -1 on failure
+ *
+ * This function is only used for debugging purposes and is not
+ * required to be implemented for normal operations.
+ */
+ int (*send_frame)(void *priv, const u8 *data, size_t data_len,
+ int encrypt);
};
diff --git a/src/drivers/driver_ndis.c b/src/drivers/driver_ndis.c
index 662b1a1..6d7a1fc 100644
--- a/src/drivers/driver_ndis.c
+++ b/src/drivers/driver_ndis.c
@@ -3275,5 +3275,6 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = {
NULL /* deinit_ap */,
NULL /* suspend */,
NULL /* resume */,
- NULL /* signal_monitor */
+ NULL /* signal_monitor */,
+ NULL /* send_frame */
};
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index b1007fe..70a0d07 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5237,6 +5237,15 @@ nla_put_failure:
}
+static int nl80211_send_frame(void *priv, const u8 *data, size_t data_len,
+ int encrypt)
+{
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ return wpa_driver_nl80211_send_frame(drv, data, data_len, encrypt);
+}
+
+
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
@@ -5297,4 +5306,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.resume = wpa_driver_nl80211_resume,
.send_ft_action = nl80211_send_ft_action,
.signal_monitor = nl80211_signal_monitor,
+ .send_frame = nl80211_send_frame,
};