aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
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 /hostapd/hostapd_cli.c
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 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 4548924..6fab4ad 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -246,12 +246,16 @@ static int hostapd_cli_cmd_deauthenticate(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char buf[64];
- if (argc != 1) {
+ if (argc < 1) {
printf("Invalid 'deauthenticate' command - exactly one "
"argument, STA address, is required.\n");
return -1;
}
- snprintf(buf, sizeof(buf), "DEAUTHENTICATE %s", argv[0]);
+ if (argc > 1)
+ os_snprintf(buf, sizeof(buf), "DEAUTHENTICATE %s %s",
+ argv[0], argv[1]);
+ else
+ os_snprintf(buf, sizeof(buf), "DEAUTHENTICATE %s", argv[0]);
return wpa_ctrl_command(ctrl, buf);
}
@@ -260,12 +264,16 @@ static int hostapd_cli_cmd_disassociate(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char buf[64];
- if (argc != 1) {
+ if (argc < 1) {
printf("Invalid 'disassociate' command - exactly one "
"argument, STA address, is required.\n");
return -1;
}
- snprintf(buf, sizeof(buf), "DISASSOCIATE %s", argv[0]);
+ if (argc > 1)
+ os_snprintf(buf, sizeof(buf), "DISASSOCIATE %s %s",
+ argv[0], argv[1]);
+ else
+ os_snprintf(buf, sizeof(buf), "DISASSOCIATE %s", argv[0]);
return wpa_ctrl_command(ctrl, buf);
}