#include "accounting.h"
#include "iapp.h"
#include "ieee802_11_auth.h"
-#include "sta_flags.h"
#include "sta_info.h"
#include "ap_list.h"
#include "driver_i.h"
}
if (hapd->conf->ieee802_1x || hapd->conf->wpa)
- hostapd_set_ieee8021x(hapd->conf->iface, hapd, 1);
+ hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 1);
+ else
+ hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 0);
hostapd_config_free(oldconf);
}
-static int hostapd_wpa_auth_get_seqnum_igtk(void *ctx, const u8 *addr, int idx,
- u8 *seq)
-{
- struct hostapd_data *hapd = ctx;
- return hostapd_get_seqnum_igtk(hapd->conf->iface, hapd, addr, idx,
- seq);
-}
-
-
static int hostapd_wpa_auth_send_eapol(void *ctx, const u8 *addr,
const u8 *data, size_t data_len,
int encrypt)
void *ctx, int (*cb)(struct wpa_authenticator *sm, void *ctx),
void *cb_ctx)
{
+ struct hostapd_data *hapd = ctx;
struct wpa_auth_iface_iter_data data;
data.cb = cb;
data.cb_ctx = cb_ctx;
- return hostapd_for_each_interface(wpa_auth_iface_iter, &data);
+ return hostapd_for_each_interface(hapd->iface->interfaces,
+ wpa_auth_iface_iter, &data);
}
cb.get_msk = hostapd_wpa_auth_get_msk;
cb.set_key = hostapd_wpa_auth_set_key;
cb.get_seqnum = hostapd_wpa_auth_get_seqnum;
- 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;
hapd->interface_added = 1;
if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS,
- hapd->conf->iface, hapd->own_addr)) {
+ hapd->conf->iface, hapd->own_addr, hapd)) {
wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID="
MACSTR ")", MAC2STR(hapd->own_addr));
return -1;
if (hapd == NULL)
return NULL;
+ hostapd_set_driver_ops(&hapd->drv);
hapd->iconf = conf;
hapd->conf = bss;
hapd->iface = hapd_iface;
return 0;
}
+
+
+int hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
+ int enabled)
+{
+ struct wpa_bss_params params;
+ os_memset(¶ms, 0, sizeof(params));
+ params.ifname = ifname;
+ params.enabled = enabled;
+ if (enabled) {
+ params.wpa = hapd->conf->wpa;
+ params.ieee802_1x = hapd->conf->ieee802_1x;
+ params.wpa_group = hapd->conf->wpa_group;
+ params.wpa_pairwise = hapd->conf->wpa_pairwise;
+ params.wpa_key_mgmt = hapd->conf->wpa_key_mgmt;
+ params.rsn_preauth = hapd->conf->rsn_preauth;
+ }
+ return hostapd_set_ieee8021x(hapd, ¶ms);
+}
+
+
+int hostapd_sta_flags_to_drv(int flags)
+{
+ int res = 0;
+ if (flags & WLAN_STA_AUTHORIZED)
+ res |= WPA_STA_AUTHORIZED;
+ if (flags & WLAN_STA_WMM)
+ res |= WPA_STA_WMM;
+ if (flags & WLAN_STA_SHORT_PREAMBLE)
+ res |= WPA_STA_SHORT_PREAMBLE;
+ if (flags & WLAN_STA_MFP)
+ res |= WPA_STA_MFP;
+ return res;
+}