]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - hostapd/main.c
EAP-TEAP server: Testing mechanism for Result TLV in a separate message
[thirdparty/hostap.git] / hostapd / main.c
index cbeb6075b07572669cc2d6a715b8923492807c9f..08896ffe2a79d4fdc89a993363885397bd69c880 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * hostapd / main()
- * Copyright (c) 2002-2017, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -18,6 +18,7 @@
 #include "crypto/random.h"
 #include "crypto/tls.h"
 #include "common/version.h"
+#include "common/dpp.h"
 #include "drivers/driver.h"
 #include "eap_server/eap.h"
 #include "eap_server/tncs.h"
@@ -253,7 +254,7 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
  *
  * This function is used to parse configuration file for a full interface (one
  * or more BSSes sharing the same radio) and allocate memory for the BSS
- * interfaces. No actiual driver operations are started.
+ * interfaces. No actual driver operations are started.
  */
 static struct hostapd_iface *
 hostapd_interface_init(struct hapd_interfaces *interfaces, const char *if_name,
@@ -456,7 +457,7 @@ static void show_version(void)
                "hostapd v" VERSION_STR "\n"
                "User space daemon for IEEE 802.11 AP management,\n"
                "IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator\n"
-               "Copyright (c) 2002-2017, Jouni Malinen <j@w1.fi> "
+               "Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi> "
                "and contributors\n");
 }
 
@@ -652,6 +653,9 @@ int main(int argc, char *argv[])
        int start_ifaces_in_sync = 0;
        char **if_names = NULL;
        size_t if_names_size = 0;
+#ifdef CONFIG_DPP
+       struct dpp_global_config dpp_conf;
+#endif /* CONFIG_DPP */
 
        if (os_program_init())
                return -1;
@@ -671,7 +675,11 @@ int main(int argc, char *argv[])
        dl_list_init(&interfaces.eth_p_oui);
 #endif /* CONFIG_ETH_P_OUI */
 #ifdef CONFIG_DPP
-       hostapd_dpp_init_global(&interfaces);
+       os_memset(&dpp_conf, 0, sizeof(dpp_conf));
+       /* TODO: dpp_conf.msg_ctx? */
+       interfaces.dpp = dpp_global_init(&dpp_conf);
+       if (!interfaces.dpp)
+               return -1;
 #endif /* CONFIG_DPP */
 
        for (;;) {
@@ -873,27 +881,8 @@ int main(int argc, char *argv[])
         */
        interfaces.terminate_on_error = interfaces.count;
        for (i = 0; i < interfaces.count; i++) {
-               if (hostapd_driver_init(interfaces.iface[i]))
-                       goto out;
-#ifdef CONFIG_MBO
-               for (j = 0; j < interfaces.iface[i]->num_bss; j++) {
-                       struct hostapd_data *hapd = interfaces.iface[i]->bss[j];
-
-                       if (hapd && (hapd->conf->oce & OCE_STA_CFON) &&
-                           (interfaces.iface[i]->drv_flags &
-                            WPA_DRIVER_FLAGS_OCE_STA_CFON))
-                               hapd->enable_oce = OCE_STA_CFON;
-
-                       if (hapd && (hapd->conf->oce & OCE_AP) &&
-                           (interfaces.iface[i]->drv_flags &
-                            WPA_DRIVER_FLAGS_OCE_STA_CFON)) {
-                               /* TODO: Need to add OCE-AP support */
-                               wpa_printf(MSG_ERROR,
-                                          "OCE-AP feature is not yet supported");
-                       }
-               }
-#endif /* CONFIG_MBO */
-               if (hostapd_setup_interface(interfaces.iface[i]))
+               if (hostapd_driver_init(interfaces.iface[i]) ||
+                   hostapd_setup_interface(interfaces.iface[i]))
                        goto out;
        }
 
@@ -920,7 +909,7 @@ int main(int argc, char *argv[])
        os_free(interfaces.iface);
 
 #ifdef CONFIG_DPP
-       hostapd_dpp_deinit_global(&interfaces);
+       dpp_global_deinit(interfaces.dpp);
 #endif /* CONFIG_DPP */
 
        if (interfaces.eloop_initialized)