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
This commit is contained in:
Jouni Malinen 2010-03-29 12:01:40 -07:00 committed by Jouni Malinen
parent 90a3206a14
commit b91ab76e8c
5 changed files with 88 additions and 5 deletions

View file

@ -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);
};

View file

@ -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 */
};

View file

@ -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,
};