aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2008-12-30 16:04:29 (GMT)
committerJouni Malinen <j@w1.fi>2008-12-30 16:04:29 (GMT)
commit88b4b4246d5d2a21f197359d7b5907a895bb3b14 (patch)
tree6ca42f8b76485ee009b160e01b9fc482d8add50b /hostapd/hostapd_cli.c
parent3f732d1fc3beadb6f85750804ce821bc99e92af1 (diff)
downloadhostap-88b4b4246d5d2a21f197359d7b5907a895bb3b14.zip
hostap-88b4b4246d5d2a21f197359d7b5907a895bb3b14.tar.gz
hostap-88b4b4246d5d2a21f197359d7b5907a895bb3b14.tar.bz2
Added ctrl_interface command for sending a SA Query request
This can be useful for testing IEEE 802.11w functionality, so provide means for manual request to send a SA Query request.
Diffstat (limited to 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index e5285ae..68ff091 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -83,6 +83,9 @@ static const char *commands_help =
" sta <addr> get MIB variables for one station\n"
" all_sta get MIB variables for all stations\n"
" new_sta <addr> add a new station\n"
+#ifdef CONFIG_IEEE80211W
+" sa_query <addr> send SA Query to a station\n"
+#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_WPS
" wps_pin <uuid> <pin> add WPS Enrollee PIN (Device Password)\n"
" wps_pbc indicate button pushed to initiate PBC\n"
@@ -234,6 +237,22 @@ static int hostapd_cli_cmd_new_sta(struct wpa_ctrl *ctrl, int argc,
}
+#ifdef CONFIG_IEEE80211W
+static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
+ char *argv[])
+{
+ char buf[64];
+ if (argc != 1) {
+ printf("Invalid 'sa_query' command - exactly one argument, "
+ "STA address, is required.\n");
+ return -1;
+ }
+ snprintf(buf, sizeof(buf), "SA_QUERY %s", argv[0]);
+ return wpa_ctrl_command(ctrl, buf);
+}
+#endif /* CONFIG_IEEE80211W */
+
+
#ifdef CONFIG_WPS
static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
char *argv[])
@@ -405,6 +424,9 @@ static struct hostapd_cli_cmd hostapd_cli_commands[] = {
{ "sta", hostapd_cli_cmd_sta },
{ "all_sta", hostapd_cli_cmd_all_sta },
{ "new_sta", hostapd_cli_cmd_new_sta },
+#ifdef CONFIG_IEEE80211W
+ { "sa_query", hostapd_cli_cmd_sa_query },
+#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_WPS
{ "wps_pin", hostapd_cli_cmd_wps_pin },
{ "wps_pbc", hostapd_cli_cmd_wps_pbc },