FST: Integration into hostapd

This commit integrates the FST into the hostapd.

Change-Id: Ifd23c80d89084bd052dec8ca0767e5d5844c40f4
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Git-commit: 6959145b86318710d0186b618d54bce2991a6e6f
Git-repo: git://w1.fi/srv/git/hostap.git
CRs-Fixed: 891455
diff --git a/hostapd/main.c b/hostapd/main.c
index 62d0775..534f182 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -24,6 +24,7 @@
 #include "ap/hostapd.h"
 #include "ap/ap_config.h"
 #include "ap/ap_drv_ops.h"
+#include "fst/fst.h"
 #include "config_file.h"
 #include "eap_register.h"
 #include "ctrl_iface.h"
@@ -666,6 +667,17 @@
 		return -1;
 	}
 
+	if (fst_global_init()) {
+		wpa_printf(MSG_ERROR,
+			   "Failed to initialize global FST context");
+		goto out;
+	}
+
+#if defined(CONFIG_FST) && defined(CONFIG_CTRL_IFACE)
+	if (!fst_global_add_ctrl(fst_ctrl_cli))
+		wpa_printf(MSG_WARNING, "Failed to add CLI FST ctrl");
+#endif /* CONFIG_FST && CONFIG_CTRL_IFACE */
+
 	/* Allocate and parse configuration for full interface files */
 	for (i = 0; i < interfaces.count; i++) {
 		interfaces.iface[i] = hostapd_interface_init(&interfaces,
@@ -759,6 +771,8 @@
 
 	os_free(bss_config);
 
+	fst_global_deinit();
+
 	os_program_deinit();
 
 	return ret;