aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorAnton Nayshtut <qca_antonn@qca.qualcomm.com>2014-11-16 15:28:53 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-16 15:26:15 (GMT)
commit3794af2dc18a75dbb7b258903a2faae7fe5e4406 (patch)
treeb24a4a1dddf001bda082747d4e25788269b1ca2e /wpa_supplicant
parent9fbfd1b0d4afb73ec466e1abc2125302a4d105c8 (diff)
downloadhostap-3794af2dc18a75dbb7b258903a2faae7fe5e4406.zip
hostap-3794af2dc18a75dbb7b258903a2faae7fe5e4406.tar.gz
hostap-3794af2dc18a75dbb7b258903a2faae7fe5e4406.tar.bz2
FST: wpa_supplicant control interface
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ctrl_iface.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 31f57a4..417ae57 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -28,6 +28,7 @@
#include "rsn_supp/pmksa_cache.h"
#include "l2_packet/l2_packet.h"
#include "wps/wps.h"
+#include "fst/fst_ctrl_iface.h"
#include "config.h"
#include "wpa_supplicant_i.h"
#include "driver_i.h"
@@ -4291,6 +4292,15 @@ static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
pos += ret;
}
+#ifdef CONFIG_FST
+ if (mask & WPA_BSS_MASK_FST) {
+ ret = fst_ctrl_iface_mb_info(bss->bssid, pos, end - pos);
+ if (ret < 0 || ret >= end - pos)
+ return 0;
+ pos += ret;
+ }
+#endif /* CONFIG_FST */
+
if (mask & WPA_BSS_MASK_DELIM) {
ret = os_snprintf(pos, end - pos, "====\n");
if (os_snprintf_error(end - pos, ret))
@@ -9130,6 +9140,55 @@ static int wpas_global_ctrl_iface_status(struct wpa_global *global,
}
+#ifdef CONFIG_FST
+
+static int wpas_global_ctrl_iface_fst_attach(struct wpa_global *global,
+ char *cmd, char *buf,
+ size_t reply_size)
+{
+ char ifname[IFNAMSIZ + 1];
+ struct fst_iface_cfg cfg;
+ struct wpa_supplicant *wpa_s;
+ struct fst_wpa_obj iface_obj;
+
+ if (!fst_parse_attach_command(cmd, ifname, sizeof(ifname), &cfg)) {
+ wpa_s = wpa_supplicant_get_iface(global, ifname);
+ if (wpa_s) {
+ fst_wpa_supplicant_fill_iface_obj(wpa_s, &iface_obj);
+ wpa_s->fst = fst_attach(ifname, wpa_s->own_addr,
+ &iface_obj, &cfg);
+ if (wpa_s->fst)
+ return os_snprintf(buf, reply_size, "OK\n");
+ }
+ }
+
+ return -1;
+}
+
+
+static int wpas_global_ctrl_iface_fst_detach(struct wpa_global *global,
+ char *cmd, char *buf,
+ size_t reply_size)
+{
+ char ifname[IFNAMSIZ + 1];
+ struct wpa_supplicant *wpa_s;
+
+ if (!fst_parse_detach_command(cmd, ifname, sizeof(ifname))) {
+ wpa_s = wpa_supplicant_get_iface(global, ifname);
+ if (wpa_s) {
+ if (!fst_iface_detach(ifname)) {
+ wpa_s->fst = NULL;
+ return os_snprintf(buf, reply_size, "OK\n");
+ }
+ }
+ }
+
+ return -1;
+}
+
+#endif /* CONFIG_FST */
+
+
char * wpa_supplicant_global_ctrl_iface_process(struct wpa_global *global,
char *buf, size_t *resp_len)
{
@@ -9181,6 +9240,18 @@ char * wpa_supplicant_global_ctrl_iface_process(struct wpa_global *global,
} else if (os_strcmp(buf, "INTERFACES") == 0) {
reply_len = wpa_supplicant_global_iface_interfaces(
global, reply, reply_size);
+#ifdef CONFIG_FST
+ } else if (os_strncmp(buf, "FST-ATTACH ", 11) == 0) {
+ reply_len = wpas_global_ctrl_iface_fst_attach(global, buf + 11,
+ reply,
+ reply_size);
+ } else if (os_strncmp(buf, "FST-DETACH ", 11) == 0) {
+ reply_len = wpas_global_ctrl_iface_fst_detach(global, buf + 11,
+ reply,
+ reply_size);
+ } else if (os_strncmp(buf, "FST-MANAGER ", 12) == 0) {
+ reply_len = fst_ctrl_iface_receive(buf + 12, reply, reply_size);
+#endif /* CONFIG_FST */
} else if (os_strcmp(buf, "TERMINATE") == 0) {
wpa_supplicant_terminate_proc(global);
} else if (os_strcmp(buf, "SUSPEND") == 0) {