aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index cbb99a9..a523d37 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -79,8 +79,9 @@ static const char *hostapd_cli_full_license =
static const char *commands_help =
"Commands:\n"
" mib get MIB variables (dot1x, dot11, radius)\n"
-" sta <addr> get MIB vatiables for one station\n"
+" 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"
" help show this usage help\n"
" interface [ifname] show interfaces/select interface\n"
" level <debug level> change debug level\n"
@@ -214,6 +215,20 @@ static int hostapd_cli_cmd_sta(struct wpa_ctrl *ctrl, int argc, char *argv[])
}
+static int hostapd_cli_cmd_new_sta(struct wpa_ctrl *ctrl, int argc,
+ char *argv[])
+{
+ char buf[64];
+ if (argc != 1) {
+ printf("Invalid 'new_sta' command - exactly one argument, STA "
+ "address, is required.\n");
+ return -1;
+ }
+ snprintf(buf, sizeof(buf), "NEW_STA %s", argv[0]);
+ return wpa_ctrl_command(ctrl, buf);
+}
+
+
static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd,
char *addr, size_t addr_len)
{
@@ -361,6 +376,7 @@ static struct hostapd_cli_cmd hostapd_cli_commands[] = {
{ "mib", hostapd_cli_cmd_mib },
{ "sta", hostapd_cli_cmd_sta },
{ "all_sta", hostapd_cli_cmd_all_sta },
+ { "new_sta", hostapd_cli_cmd_new_sta },
{ "help", hostapd_cli_cmd_help },
{ "interface", hostapd_cli_cmd_interface },
{ "level", hostapd_cli_cmd_level },