wpa_supplicant: Add wpa_supplicant_get_eap_mode method

Signed-off-by: Paul Stewart <pstew@google.com>
This commit is contained in:
Paul Stewart 2011-03-15 13:53:08 +02:00 committed by Jouni Malinen
parent c83e2e1c45
commit cf83fb0b5b
3 changed files with 27 additions and 0 deletions

View file

@ -343,6 +343,10 @@ static inline void eapol_sm_notify_lower_layer_success(struct eapol_sm *sm,
static inline void eapol_sm_invalidate_cached_session(struct eapol_sm *sm)
{
}
static inline const char * eapol_sm_get_method_name(struct eapol_sm *sm)
{
return NULL;
}
#endif /* IEEE8021X_EAPOL */
#endif /* EAPOL_SUPP_SM_H */

View file

@ -2330,6 +2330,28 @@ int wpa_supplicant_remove_iface(struct wpa_global *global,
}
/**
* wpa_supplicant_get_eap_mode - Get the current EAP mode
* @wpa_s: Pointer to the network interface
* Returns: Pointer to the eap mode or the string "UNKNOWN" if not found
*/
const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s)
{
const char *eapol_method;
if (wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt) == 0 &&
wpa_s->key_mgmt != WPA_KEY_MGMT_IEEE8021X_NO_WPA) {
return "NO-EAP";
}
eapol_method = eapol_sm_get_method_name(wpa_s->eapol);
if (eapol_method == NULL)
return "UNKNOWN-EAP";
return eapol_method;
}
/**
* wpa_supplicant_get_iface - Get a new network interface
* @global: Pointer to global data from wpa_supplicant_init()

View file

@ -575,6 +575,7 @@ void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
enum wpa_states state);
struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
int reason_code);