#include "eapol_sm.h"
#include "eloop.h"
#include "common/eapol_common.h"
-#include "sta_info.h"
#include "eap_server/eap.h"
#include "state_machine.h"
#include "eap_common/eap_common.h"
struct eapol_state_machine *
eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
- int flags, struct sta_info *sta)
+ int flags, const struct wpabuf *assoc_wps_ie, void *sta_ctx)
{
struct eapol_state_machine *sm;
struct hostapd_data *hapd; /* TODO: to be removed */
sm->hapd = hapd;
sm->eapol = eapol;
- sm->sta = sta;
+ sm->sta = sta_ctx;
/* Set default values for state machine constants */
sm->auth_pae_state = AUTH_PAE_INITIALIZE;
eap_conf.eap_sim_aka_result_ind = eapol->conf.eap_sim_aka_result_ind;
eap_conf.tnc = eapol->conf.tnc;
eap_conf.wps = eapol->conf.wps;
- eap_conf.assoc_wps_ie = sta->wps_ie;
+ eap_conf.assoc_wps_ie = assoc_wps_ie;
eap_conf.peer_addr = addr;
sm->eap = eap_server_sm_init(sm, &eapol_cb, &eap_conf);
if (sm->eap == NULL) {
struct eapol_authenticator *eapol;
- /* Somewhat nasty pointers to global hostapd and STA data to avoid
- * passing these to every function */
+ void *sta; /* station context pointer to use in callbacks */
+
+ /* Somewhat nasty pointer to global hostapd data to avoid
+ * passing this to every function */
struct hostapd_data *hapd;
- struct sta_info *sta;
};
void eapol_auth_deinit(struct eapol_authenticator *eapol);
struct eapol_state_machine *
eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
- int flags, struct sta_info *sta);
+ int flags, const struct wpabuf *assoc_wps_ie, void *sta_ctx);
void eapol_auth_free(struct eapol_state_machine *sm);
void eapol_auth_step(struct eapol_state_machine *sm);
void eapol_auth_dump_state(FILE *f, const char *prefix,
if (wpa_auth_sta_get_pmksa(sta->wpa_sm))
flags |= EAPOL_SM_FROM_PMKSA_CACHE;
}
- return eapol_auth_alloc(hapd->eapol_auth, sta->addr, flags, sta);
+ return eapol_auth_alloc(hapd->eapol_auth, sta->addr, flags,
+ sta->wps_ie, sta);
}
radius_copy_class(&entry->radius_class, &eapol->radius_class);
entry->eap_type_authsrv = eapol->eap_type_authsrv;
- entry->vlan_id = eapol->sta->vlan_id;
+ entry->vlan_id = ((struct sta_info *) eapol->sta)->vlan_id;
}
}
eapol->eap_type_authsrv = entry->eap_type_authsrv;
- eapol->sta->vlan_id = entry->vlan_id;
+ ((struct sta_info *) eapol->sta)->vlan_id = entry->vlan_id;
}