aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-06-26 19:11:17 +0300
committerJouni Malinen <j@w1.fi>2012-06-26 19:11:17 +0300
commit2bdd8342577c2b1f04f9937131f0fbed0c3bae2c (patch)
tree2ea55f04099f45af2868df73b7c68f0eb3ca8318 /wpa_supplicant/wpa_cli.c
parentbc5d330ae0ec9bf78c4cc2bf1b2a87c365e0c673 (diff)
downloadexternal_wpa_supplicant_8_ti-2bdd8342577c2b1f04f9937131f0fbed0c3bae2c.zip
external_wpa_supplicant_8_ti-2bdd8342577c2b1f04f9937131f0fbed0c3bae2c.tar.gz
external_wpa_supplicant_8_ti-2bdd8342577c2b1f04f9937131f0fbed0c3bae2c.tar.bz2
Add autoscan command into wpa_cli
Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index d1c421d..cff7df8 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -2811,6 +2811,28 @@ static int wpa_cli_cmd_reauthenticate(struct wpa_ctrl *ctrl, int argc,
}
+#ifdef CONFIG_AUTOSCAN
+
+static int wpa_cli_cmd_autoscan(struct wpa_ctrl *ctrl, int argc, char *argv[])
+{
+ char cmd[256];
+ int res;
+
+ if (argc == 0)
+ return wpa_ctrl_command(ctrl, "AUTOSCAN ");
+
+ res = os_snprintf(cmd, sizeof(cmd), "AUTOSCAN %s", argv[0]);
+ if (res < 0 || (size_t) res >= sizeof(cmd) - 1) {
+ printf("Too long AUTOSCAN command.\n");
+ return -1;
+ }
+
+ return wpa_ctrl_command(ctrl, cmd);
+}
+
+#endif /* CONFIG_AUTOSCAN */
+
+
enum wpa_cli_cmd_flags {
cli_cmd_flag_none = 0x00,
cli_cmd_flag_sensitive = 0x01
@@ -3181,6 +3203,10 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
"= get signal parameters" },
{ "reauthenticate", wpa_cli_cmd_reauthenticate, cli_cmd_flag_none,
"= trigger IEEE 802.1X/EAPOL reauthentication" },
+#ifdef CONFIG_AUTOSCAN
+ { "autoscan", wpa_cli_cmd_autoscan, cli_cmd_flag_none,
+ "[params] = Set or unset (if none) autoscan parameters" },
+#endif /* CONFIG_AUTOSCAN */
{ NULL, NULL, cli_cmd_flag_none, NULL }
};