aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ctrl_iface.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-08-25 17:35:19 (GMT)
committerJouni Malinen <j@w1.fi>2013-08-25 17:35:19 (GMT)
commit1b9b31c1530fdb456bd4b19805553f8b4166f02e (patch)
tree401163adb1a29dffcfc8809094ad6f39c0c76ec5 /wpa_supplicant/ctrl_iface.c
parentc548fb27c80a4d7477de8e440157bf5fde2bbeba (diff)
downloadhostap-1b9b31c1530fdb456bd4b19805553f8b4166f02e.zip
hostap-1b9b31c1530fdb456bd4b19805553f8b4166f02e.tar.gz
hostap-1b9b31c1530fdb456bd4b19805553f8b4166f02e.tar.bz2
Add SET command for global control interface
This allows global parameters to be set through the global control interface without having to use IFNAME prefix. For now, this covers only the wifi_display parameter. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/ctrl_iface.c')
-rw-r--r--wpa_supplicant/ctrl_iface.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 81ca37d..c27325c 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -5989,6 +5989,28 @@ static char * wpas_global_ctrl_iface_redir(struct wpa_global *global,
}
+static int wpas_global_ctrl_iface_set(struct wpa_global *global, char *cmd)
+{
+ char *value;
+
+ value = os_strchr(cmd, ' ');
+ if (value == NULL)
+ return -1;
+ *value++ = '\0';
+
+ wpa_printf(MSG_DEBUG, "GLOBAL_CTRL_IFACE SET '%s'='%s'", cmd, value);
+
+#ifdef CONFIG_WIFI_DISPLAY
+ if (os_strcasecmp(cmd, "wifi_display") == 0) {
+ wifi_display_enable(global, !!atoi(value));
+ return 0;
+ }
+#endif /* CONFIG_WIFI_DISPLAY */
+
+ return -1;
+}
+
+
char * wpa_supplicant_global_ctrl_iface_process(struct wpa_global *global,
char *buf, size_t *resp_len)
{
@@ -6046,6 +6068,9 @@ char * wpa_supplicant_global_ctrl_iface_process(struct wpa_global *global,
wpas_notify_suspend(global);
} else if (os_strcmp(buf, "RESUME") == 0) {
wpas_notify_resume(global);
+ } else if (os_strncmp(buf, "SET ", 4) == 0) {
+ if (wpas_global_ctrl_iface_set(global, buf + 4))
+ reply_len = -1;
} else {
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;