From 2526ed6bf7e0a2606158a392f7451bc97d6975a5 Mon Sep 17 00:00:00 2001
From: Ola Olsson <ola1olsson@gmail.com>
Date: Fri, 27 Mar 2015 00:03:21 +0100
Subject: [PATCH] Removing redundant commands in wpa_cli
The removed commands can be set using the
"set" command instead.
Oh, fixed a typo as well.
If this commit broke your wpa_cli interaction, just use
the following commands instead:
set bss_expiration_scan_count x
set bss_expiration_age y
set ap_scan z
Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
---
wpa_supplicant/ctrl_iface.c | 34 ----------------------------------
wpa_supplicant/wpa_cli.c | 31 +------------------------------
2 files changed, 1 insertion(+), 64 deletions(-)
@@ -4406,14 +4406,6 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s,
}
-static int wpa_supplicant_ctrl_iface_ap_scan(
- struct wpa_supplicant *wpa_s, char *cmd)
-{
- int ap_scan = atoi(cmd);
- return wpa_supplicant_set_ap_scan(wpa_s, ap_scan);
-}
-
-
static int wpa_supplicant_ctrl_iface_scan_interval(
struct wpa_supplicant *wpa_s, char *cmd)
{
@@ -4422,22 +4414,6 @@ static int wpa_supplicant_ctrl_iface_scan_interval(
}
-static int wpa_supplicant_ctrl_iface_bss_expire_age(
- struct wpa_supplicant *wpa_s, char *cmd)
-{
- int expire_age = atoi(cmd);
- return wpa_supplicant_set_bss_expiration_age(wpa_s, expire_age);
-}
-
-
-static int wpa_supplicant_ctrl_iface_bss_expire_count(
- struct wpa_supplicant *wpa_s, char *cmd)
-{
- int expire_count = atoi(cmd);
- return wpa_supplicant_set_bss_expiration_count(wpa_s, expire_count);
-}
-
-
static void wpa_supplicant_ctrl_iface_bss_flush(
struct wpa_supplicant *wpa_s, char *cmd)
{
@@ -8337,9 +8313,6 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strncmp(buf, "GET_CAPABILITY ", 15) == 0) {
reply_len = wpa_supplicant_ctrl_iface_get_capability(
wpa_s, buf + 15, reply, reply_size);
- } else if (os_strncmp(buf, "AP_SCAN ", 8) == 0) {
- if (wpa_supplicant_ctrl_iface_ap_scan(wpa_s, buf + 8))
- reply_len = -1;
} else if (os_strncmp(buf, "SCAN_INTERVAL ", 14) == 0) {
if (wpa_supplicant_ctrl_iface_scan_interval(wpa_s, buf + 14))
reply_len = -1;
@@ -8387,13 +8360,6 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_len = -1;
} else if (os_strncmp(buf, "STA_AUTOCONNECT ", 16) == 0) {
wpa_s->auto_reconnect_disabled = atoi(buf + 16) == 0;
- } else if (os_strncmp(buf, "BSS_EXPIRE_AGE ", 15) == 0) {
- if (wpa_supplicant_ctrl_iface_bss_expire_age(wpa_s, buf + 15))
- reply_len = -1;
- } else if (os_strncmp(buf, "BSS_EXPIRE_COUNT ", 17) == 0) {
- if (wpa_supplicant_ctrl_iface_bss_expire_count(wpa_s,
- buf + 17))
- reply_len = -1;
} else if (os_strncmp(buf, "BSS_FLUSH ", 10) == 0) {
wpa_supplicant_ctrl_iface_bss_flush(wpa_s, buf + 10);
#ifdef CONFIG_TDLS
@@ -798,12 +798,6 @@ static int wpa_cli_cmd_preauthenticate(struct wpa_ctrl *ctrl, int argc,
}
-static int wpa_cli_cmd_ap_scan(struct wpa_ctrl *ctrl, int argc, char *argv[])
-{
- return wpa_cli_cmd(ctrl, "AP_SCAN", 1, argc, argv);
-}
-
-
static int wpa_cli_cmd_scan_interval(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
@@ -811,20 +805,6 @@ static int wpa_cli_cmd_scan_interval(struct wpa_ctrl *ctrl, int argc,
}
-static int wpa_cli_cmd_bss_expire_age(struct wpa_ctrl *ctrl, int argc,
- char *argv[])
-{
- return wpa_cli_cmd(ctrl, "BSS_EXPIRE_AGE", 1, argc, argv);
-}
-
-
-static int wpa_cli_cmd_bss_expire_count(struct wpa_ctrl *ctrl, int argc,
- char *argv[])
-{
- return wpa_cli_cmd(ctrl, "BSS_EXPIRE_COUNT", 1, argc, argv);
-}
-
-
static int wpa_cli_cmd_bss_flush(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
char cmd[256];
@@ -2978,7 +2958,7 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
{ "get_capability", wpa_cli_cmd_get_capability, NULL,
cli_cmd_flag_none,
"<eap/pairwise/group/key_mgmt/proto/auth_alg/channels/freq/modes> "
- "= get capabilies" },
+ "= get capabilities" },
{ "reconfigure", wpa_cli_cmd_reconfigure, NULL,
cli_cmd_flag_none,
"= force wpa_supplicant to re-read its configuration file" },
@@ -2996,18 +2976,9 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
{ "interface_list", wpa_cli_cmd_interface_list, NULL,
cli_cmd_flag_none,
"= list available interfaces" },
- { "ap_scan", wpa_cli_cmd_ap_scan, NULL,
- cli_cmd_flag_none,
- "<value> = set ap_scan parameter" },
{ "scan_interval", wpa_cli_cmd_scan_interval, NULL,
cli_cmd_flag_none,
"<value> = set scan_interval parameter (in seconds)" },
- { "bss_expire_age", wpa_cli_cmd_bss_expire_age, NULL,
- cli_cmd_flag_none,
- "<value> = set BSS expiration age parameter" },
- { "bss_expire_count", wpa_cli_cmd_bss_expire_count, NULL,
- cli_cmd_flag_none,
- "<value> = set BSS expiration scan count parameter" },
{ "bss_flush", wpa_cli_cmd_bss_flush, NULL,
cli_cmd_flag_none,
"<value> = set BSS flush age (0 by default)" },
--
1.7.9.5
Hi, Fair enough, I see your point. I am not sure about your view regarding backward compatibility though, but I'll include a new patch removing the commands in wpa_supplicant as well. Use it if you want. I apologize if this mail will confuse your mailing archive, I am using the digested version so I had to manually compose this email by copying the subject. /Ola To: hostap@lists.shmoo.com Message-ID: <20150327092415.GA11146@w1.fi> Content-Type: text/plain; charset=us-ascii On Fri, Mar 27, 2015 at 12:17:19AM +0100, Ola Olsson wrote: > Small patch in wpa_cli that does not need further explanation. Well, I'd say it would need more justification.. As long as wpa_supplicant continues to support these operations for backwards compatibility, I'd expect wpa_cli to do same. -- Jouni Malinen