aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-03-09 08:37:18 (GMT)
committerJouni Malinen <j@w1.fi>2008-03-09 08:37:18 (GMT)
commitda08a7c732263621d2b18ac6482fdc148031c0d9 (patch)
tree09f23b9a7d212c5a2e951e5192e328a7f9b15f6d /hostapd/hostapd.c
parent8e888179e1dcfc53e6770be53226668a4137ee5f (diff)
downloadhostap-06-da08a7c732263621d2b18ac6482fdc148031c0d9.zip
hostap-06-da08a7c732263621d2b18ac6482fdc148031c0d9.tar.gz
hostap-06-da08a7c732263621d2b18ac6482fdc148031c0d9.tar.bz2
TNC: Added preliminary TNC implementation for hostapd
This adds EAP-TNC method and TNCS (IF-IMV and IF-TNCCS) functionality. There is no integration with EAP-TTLS and EAP-FAST at this point, so this version is not yet suitable for real use (i.e., EAP-TNC can only be tested outside a tunnel which is not an allowed configuration for deployment). However, the basic TNCS functionality is more or less complete and this version seems to interoperate with wpa_supplicant.
Diffstat (limited to 'hostapd/hostapd.c')
-rw-r--r--hostapd/hostapd.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c
index 1e6a7bb..e8e8b8a 100644
--- a/hostapd/hostapd.c
+++ b/hostapd/hostapd.c
@@ -41,6 +41,7 @@
#include "tls.h"
#include "eap_server/eap_sim_db.h"
#include "eap_server/eap.h"
+#include "eap_server/tncs.h"
#include "version.h"
#include "l2_packet/l2_packet.h"
@@ -1854,7 +1855,7 @@ int main(int argc, char *argv[])
struct hapd_interfaces interfaces;
int ret = 1, k;
size_t i, j;
- int c, debug = 0, daemonize = 0;
+ int c, debug = 0, daemonize = 0, tnc = 0;
const char *pid_file = NULL;
hostapd_logger_register_cb(hostapd_logger_cb);
@@ -1940,7 +1941,19 @@ int main(int argc, char *argv[])
setup_interface_done);
if (ret)
goto out;
+
+ for (k = 0; k < (int) interfaces.iface[i]->num_bss; k++) {
+ if (interfaces.iface[i]->bss[0]->conf->tnc)
+ tnc++;
+ }
+ }
+
+#ifdef EAP_TNC
+ if (tnc && tncs_global_init() < 0) {
+ wpa_printf(MSG_ERROR, "Failed to initialize TNCS");
+ goto out;
}
+#endif /* EAP_TNC */
if (daemonize && os_daemonize(pid_file)) {
perror("daemon");
@@ -1986,6 +1999,10 @@ int main(int argc, char *argv[])
}
os_free(interfaces.iface);
+#ifdef EAP_TNC
+ tncs_global_deinit();
+#endif /* EAP_TNC */
+
eloop_destroy();
#ifndef CONFIG_NATIVE_WINDOWS