Interworking: Add GAS server support for AP mode
[mech_eap.git] / src / ap / hostapd.c
index 8e072d3..bb8fea7 100644 (file)
@@ -30,6 +30,7 @@
 #include "ap_drv_ops.h"
 #include "ap_config.h"
 #include "p2p_hostapd.h"
+#include "gas_serv.h"
 
 
 static int hostapd_flush_old_stations(struct hostapd_data *hapd);
@@ -262,6 +263,10 @@ static void hostapd_free_hapd_data(struct hostapd_data *hapd)
 #endif /* CONFIG_P2P */
 
        wpabuf_free(hapd->time_adv);
+
+#ifdef CONFIG_INTERWORKING
+       gas_serv_deinit(hapd);
+#endif /* CONFIG_INTERWORKING */
 }
 
 
@@ -653,6 +658,13 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
                return -1;
        }
 
+#ifdef CONFIG_INTERWORKING
+       if (gas_serv_init(hapd)) {
+               wpa_printf(MSG_ERROR, "GAS server initialization failed");
+               return -1;
+       }
+#endif /* CONFIG_INTERWORKING */
+
        if (hapd->iface->ctrl_iface_init &&
            hapd->iface->ctrl_iface_init(hapd)) {
                wpa_printf(MSG_ERROR, "Failed to setup control interface");