]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - hostapd/main.c
HE: Add Spatial Reuse Parameter Set element to the Beacon frames
[thirdparty/hostap.git] / hostapd / main.c
index 593267c96f660f516be9181afb3b6a5c14d8ade8..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.
 #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"
 #include "ap/hostapd.h"
 #include "ap/ap_config.h"
 #include "ap/ap_drv_ops.h"
+#include "ap/dpp_hostapd.h"
 #include "fst/fst.h"
 #include "config_file.h"
 #include "eap_register.h"
@@ -252,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,
@@ -455,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");
 }
 
@@ -651,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;
@@ -666,6 +671,16 @@ int main(int argc, char *argv[])
        interfaces.global_iface_name = NULL;
        interfaces.global_ctrl_sock = -1;
        dl_list_init(&interfaces.global_ctrl_dst);
+#ifdef CONFIG_ETH_P_OUI
+       dl_list_init(&interfaces.eth_p_oui);
+#endif /* CONFIG_ETH_P_OUI */
+#ifdef CONFIG_DPP
+       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 (;;) {
                c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:");
@@ -893,6 +908,10 @@ int main(int argc, char *argv[])
        }
        os_free(interfaces.iface);
 
+#ifdef CONFIG_DPP
+       dpp_global_deinit(interfaces.dpp);
+#endif /* CONFIG_DPP */
+
        if (interfaces.eloop_initialized)
                eloop_cancel_timeout(hostapd_periodic, &interfaces, NULL);
        hostapd_global_deinit(pid_file, interfaces.eloop_initialized);