@@ -53,6 +53,19 @@ OBJS += ../src/ap/wpa_auth_ie.o
OBJS += ../src/ap/preauth_auth.o
OBJS += ../src/ap/pmksa_cache_auth.o
+CONFIG_DFS_DETECTOR=y
+
+ifdef CONFIG_DFS_DETECTOR
+CFLAGS += -DCONFIG_DFS_DETECTOR
+OBJS += ../src/dfs/dfs_debug.o
+OBJS += ../src/dfs/dfs_handler.o
+OBJS += ../src/dfs/dfs_pattern_detector.o
+
+# enable syslog logging to see DFS pattern detector results
+CFLAGS += -DCONFIG_DEBUG_SYSLOG
+endif
+
+
NEED_RC4=y
NEED_AES=y
NEED_MD5=y
@@ -31,6 +31,12 @@
#include "dump_state.h"
#include "ctrl_iface.h"
+#ifdef CONFIG_DFS_DETECTOR
+#include "dfs/dfs.h"
+
+/* only one global DFS handler instance enough for proof-of-concept */
+struct dfs_handler *global_dfs_handler;
+#endif
extern int wpa_debug_level;
extern int wpa_debug_show_keys;
@@ -194,6 +200,10 @@ static struct hostapd_iface * hostapd_init(const char *config_file)
if (hapd_iface == NULL)
goto fail;
+#ifdef CONFIG_DEBUG_SYSLOG
+ wpa_debug_open_syslog();
+#endif
+
hapd_iface->init_complete = hostapd_init_complete;
hapd_iface->reload_config = hostapd_reload_config;
hapd_iface->config_read_cb = hostapd_config_read;
@@ -399,6 +409,9 @@ static int hostapd_global_init(struct hapd_interfaces *interfaces)
openlog("hostapd", 0, LOG_DAEMON);
#endif /* CONFIG_NATIVE_WINDOWS */
+#ifdef CONFIG_DFS_DETECTOR
+ global_dfs_handler = dfs_handler_init(DFS_ETSI_DOMAIN);
+#endif
return 0;
}
@@ -415,6 +428,12 @@ static void hostapd_global_deinit(void)
closelog();
#endif /* CONFIG_NATIVE_WINDOWS */
+#ifdef CONFIG_DFS_DETECTOR
+ if (global_dfs_handler) {
+ global_dfs_handler->exit(global_dfs_handler);
+ global_dfs_handler = NULL;
+ }
+#endif
eap_server_unregister_methods();
os_daemonize_terminate(pid_file);
@@ -1,5 +1,7 @@
SUBDIRS=ap common crypto drivers eapol_auth eapol_supp eap_common eap_peer eap_server l2_packet p2p radius rsn_supp tls utils wps
+SUBDIRS += dfs
+
all:
for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d; done
@@ -80,12 +80,15 @@ int hostapd_get_hw_features(struct hostapd_iface *iface)
* since that (in addition to full DFS) is not yet
* supported.
*/
+#ifndef CONFIG_DFS_DETECTOR
+ /* do not disable if we have DFS detection */
if (feature->channels[j].flag &
(HOSTAPD_CHAN_NO_IBSS |
HOSTAPD_CHAN_PASSIVE_SCAN |
HOSTAPD_CHAN_RADAR))
feature->channels[j].flag |=
HOSTAPD_CHAN_DISABLED;
+#endif /* CONFIG_DFS_DETECTOR */
if (feature->channels[j].flag & HOSTAPD_CHAN_DISABLED)
continue;
wpa_printf(MSG_MSGDUMP, "Allowed channel: mode=%d "