aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@sonymobile.com>2016-10-12 12:18:55 (GMT)
committerJouni Malinen <j@w1.fi>2016-10-16 08:55:02 (GMT)
commit839e4a8a98a9e91a713957eec392ffef19ac6e74 (patch)
tree95be5b70c05c141b49556d205b78bc17d6b58136 /hostapd/hostapd_cli.c
parentbc4b680c22d4d400c490336e2c13319291d2cd1a (diff)
downloadhostap-839e4a8a98a9e91a713957eec392ffef19ac6e74.zip
hostap-839e4a8a98a9e91a713957eec392ffef19ac6e74.tar.gz
hostap-839e4a8a98a9e91a713957eec392ffef19ac6e74.tar.bz2
hostapd_cli: Add completion for sta command
Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
Diffstat (limited to 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 00e73f9..1d8ba7a 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -286,6 +286,21 @@ static int hostapd_cli_cmd_sta(struct wpa_ctrl *ctrl, int argc, char *argv[])
}
+static char ** hostapd_complete_sta(const char *str, int pos)
+{
+ int arg = get_cmd_arg_num(str, pos);
+ char **res = NULL;
+
+ switch (arg) {
+ case 1:
+ res = cli_txt_list_array(&stations);
+ break;
+ }
+
+ return res;
+}
+
+
static int hostapd_cli_cmd_new_sta(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
@@ -1275,7 +1290,7 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
"= get MIB variables (dot1x, dot11, radius)" },
{ "relog", hostapd_cli_cmd_relog, NULL, NULL },
{ "status", hostapd_cli_cmd_status, NULL, NULL },
- { "sta", hostapd_cli_cmd_sta, NULL,
+ { "sta", hostapd_cli_cmd_sta, hostapd_complete_sta,
"<addr> = get MIB variables for one station" },
{ "all_sta", hostapd_cli_cmd_all_sta, NULL,
"= get MIB variables for all stations" },