#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"
static void hostapd_deauth_all_stas(struct hostapd_data *hapd)
{
-#if 0
u8 addr[ETH_ALEN];
- os_memset(addr, 0xff, ETH_ALEN);
- hostapd_sta_deauth(hapd, addr, WLAN_REASON_PREV_AUTH_NOT_VALID);
-#else
/* New Prism2.5/3 STA firmware versions seem to have issues with this
* broadcast deauth frame. This gets the firmware in odd state where
- * nothing works correctly, so let's skip sending this for a while
- * until the issue has been resolved. */
-#endif
+ * nothing works correctly, so let's skip sending this for the hostap
+ * driver. */
+
+ if (os_strcmp(hapd->driver->name, "hostap") != 0) {
+ os_memset(addr, 0xff, ETH_ALEN);
+ hostapd_sta_deauth(hapd, addr,
+ WLAN_REASON_PREV_AUTH_NOT_VALID);
+ }
}
wconf->eapol_version = conf->eapol_version;
wconf->peerkey = conf->peerkey;
wconf->wme_enabled = conf->wme_enabled;
+ wconf->okc = conf->okc;
#ifdef CONFIG_IEEE80211W
wconf->ieee80211w = conf->ieee80211w;
#endif /* CONFIG_IEEE80211W */
fprintf(f, "\nSTA=" MACSTR "\n", MAC2STR(sta->addr));
fprintf(f,
- " AID=%d flags=0x%x %s%s%s%s%s%s%s%s%s%s\n"
+ " AID=%d flags=0x%x %s%s%s%s%s%s%s%s%s%s%s%s\n"
" capability=0x%x listen_interval=%d\n",
sta->aid,
sta->flags,
(sta->flags & WLAN_STA_SHORT_PREAMBLE ?
"[SHORT_PREAMBLE]" : ""),
(sta->flags & WLAN_STA_PREAUTH ? "[PREAUTH]" : ""),
+ (sta->flags & WLAN_STA_WME ? "[WME]" : ""),
+ (sta->flags & WLAN_STA_MFP ? "[MFP]" : ""),
(sta->flags & WLAN_STA_NONERP ? "[NonERP]" : ""),
sta->capability,
sta->listen_interval);
}
+static int hostapd_wpa_auth_for_each_auth(
+ void *ctx, int (*cb)(struct wpa_authenticator *sm, void *ctx),
+ void *cb_ctx)
+{
+ struct hostapd_data *ohapd;
+ size_t i, j;
+ struct hapd_interfaces *interfaces = eloop_get_user_data();
+
+ for (i = 0; i < interfaces->count; i++) {
+ for (j = 0; j < interfaces->iface[i]->num_bss; j++) {
+ ohapd = interfaces->iface[i]->bss[j];
+ if (cb(ohapd->wpa_auth, cb_ctx))
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
static int hostapd_wpa_auth_send_ether(void *ctx, const u8 *dst, u16 proto,
const u8 *data, size_t data_len)
{
cb.get_seqnum_igtk = hostapd_wpa_auth_get_seqnum_igtk;
cb.send_eapol = hostapd_wpa_auth_send_eapol;
cb.for_each_sta = hostapd_wpa_auth_for_each_sta;
+ cb.for_each_auth = hostapd_wpa_auth_for_each_auth;
cb.send_ether = hostapd_wpa_auth_send_ether;
#ifdef CONFIG_IEEE80211R
cb.send_ft_action = hostapd_wpa_auth_send_ft_action;
srv.pac_opaque_encr_key = conf->pac_opaque_encr_key;
srv.eap_fast_a_id = conf->eap_fast_a_id;
srv.eap_sim_aka_result_ind = conf->eap_sim_aka_result_ind;
+ srv.tnc = conf->tnc;
srv.ipv6 = conf->radius_server_ipv6;
srv.get_eap_user = hostapd_radius_get_eap_user;
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);
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");
}
os_free(interfaces.iface);
+#ifdef EAP_TNC
+ tncs_global_deinit();
+#endif /* EAP_TNC */
+
eloop_destroy();
#ifndef CONFIG_NATIVE_WINDOWS