aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Nayshtut <qca_antonn@qca.qualcomm.com>2015-01-21 15:30:48 +0200
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:19:32 -0600
commit3a08d5f7dfcf846c2c394d29a71df1b379df98a5 (patch)
tree4bfb7f7d39cc41faa294b317b933393aabbd15cc
parent22db13345f4deaa042890efa8f4028fa382a1afd (diff)
downloadandroid_external_wpa_supplicant_8-3a08d5f7dfcf846c2c394d29a71df1b379df98a5.tar.gz
android_external_wpa_supplicant_8-3a08d5f7dfcf846c2c394d29a71df1b379df98a5.tar.bz2
android_external_wpa_supplicant_8-3a08d5f7dfcf846c2c394d29a71df1b379df98a5.zip
FST: hostapd control interface
Change-Id: I6ca7b6b6691be3878024c44cae9947195a0af5c6 Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Git-commit: 8e9a8b0f8cb5e9060c3df59feafe9adfb7ff8f92 Git-repo: git://w1.fi/srv/git/hostap.git CRs-Fixed: 891455
-rw-r--r--hostapd/ctrl_iface.c64
-rw-r--r--src/ap/ctrl_iface_ap.c6
2 files changed, 69 insertions, 1 deletions
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index c606f2cf..bab82b5b 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -43,6 +43,7 @@
#include "ap/beacon.h"
#include "wps/wps_defs.h"
#include "wps/wps.h"
+#include "fst/fst_ctrl_iface.h"
#include "config_file.h"
#include "ctrl_iface.h"
@@ -2423,6 +2424,55 @@ static void hostapd_ctrl_iface_flush(struct hapd_interfaces *interfaces)
}
+#ifdef CONFIG_FST
+
+static int
+hostapd_global_ctrl_iface_fst_attach(struct hapd_interfaces *interfaces,
+ const char *cmd)
+{
+ char ifname[IFNAMSIZ + 1];
+ struct fst_iface_cfg cfg;
+ struct hostapd_data *hapd;
+ struct fst_wpa_obj iface_obj;
+
+ if (!fst_parse_attach_command(cmd, ifname, sizeof(ifname), &cfg)) {
+ hapd = hostapd_get_iface(interfaces, ifname);
+ if (hapd) {
+ fst_hostapd_fill_iface_obj(hapd, &iface_obj);
+ hapd->iface->fst = fst_attach(ifname, hapd->own_addr,
+ &iface_obj, &cfg);
+ if (hapd->iface->fst)
+ return 0;
+ }
+ }
+
+ return EINVAL;
+}
+
+
+static int
+hostapd_global_ctrl_iface_fst_detach(struct hapd_interfaces *interfaces,
+ const char *cmd)
+{
+ char ifname[IFNAMSIZ + 1];
+ struct hostapd_data * hapd;
+
+ if (!fst_parse_detach_command(cmd, ifname, sizeof(ifname))) {
+ hapd = hostapd_get_iface(interfaces, ifname);
+ if (hapd) {
+ if (!fst_iface_detach(ifname)) {
+ hapd->iface->fst = NULL;
+ return 0;
+ }
+ }
+ }
+
+ return EINVAL;
+}
+
+#endif /* CONFIG_FST */
+
+
static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx,
void *sock_ctx)
{
@@ -2486,6 +2536,20 @@ static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx,
if (hapd_module_tests() < 0)
reply_len = -1;
#endif /* CONFIG_MODULE_TESTS */
+#ifdef CONFIG_FST
+ } else if (os_strncmp(buf, "FST-ATTACH ", 11) == 0) {
+ if (!hostapd_global_ctrl_iface_fst_attach(interfaces, buf + 11))
+ reply_len = os_snprintf(reply, reply_size, "OK\n");
+ else
+ reply_len = -1;
+ } else if (os_strncmp(buf, "FST-DETACH ", 11) == 0) {
+ if (!hostapd_global_ctrl_iface_fst_detach(interfaces, buf + 11))
+ reply_len = os_snprintf(reply, reply_size, "OK\n");
+ else
+ reply_len = -1;
+ } else if (os_strncmp(buf, "FST-MANAGER ", 12) == 0) {
+ reply_len = fst_ctrl_iface_receive(buf + 12, reply, reply_size);
+#endif /* CONFIG_FST */
} else {
wpa_printf(MSG_DEBUG, "Unrecognized global ctrl_iface command "
"ignored");
diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
index 60afcb08..c98978f3 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
@@ -12,6 +12,7 @@
#include "common/ieee802_11_defs.h"
#include "common/sae.h"
#include "eapol_auth/eapol_auth_sm.h"
+#include "fst/fst_ctrl_iface.h"
#include "hostapd.h"
#include "ieee802_1x.h"
#include "wpa_auth.h"
@@ -206,7 +207,10 @@ int hostapd_ctrl_iface_sta(struct hostapd_data *hapd, const char *txtaddr,
return -1;
}
- return hostapd_ctrl_iface_sta_mib(hapd, sta, buf, buflen);
+ ret = hostapd_ctrl_iface_sta_mib(hapd, sta, buf, buflen);
+ ret += fst_ctrl_iface_mb_info(addr, buf + ret, buflen - ret);
+
+ return ret;
}