]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
eapol_supp: Request EAP method from EAP state machine
authorPaul Stewart <pstew@google.com>
Tue, 15 Mar 2011 11:49:26 +0000 (13:49 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 15 Mar 2011 11:49:26 +0000 (13:49 +0200)
Signed-off-by: Paul Stewart <pstew@google.com>
src/eapol_supp/eapol_supp_sm.c
src/eapol_supp/eapol_supp_sm.h

index 77cd564b0d43be397f22982bd7e2fa6273179f05..18abb4e3c4173af4eaeb612adf95fd617a0d9f1f 100644 (file)
@@ -1029,6 +1029,21 @@ void eapol_sm_configure(struct eapol_sm *sm, int heldPeriod, int authPeriod,
 }
 
 
+/**
+ * eapol_sm_get_method_name - Get EAPOL method name
+ * @sm: Pointer to EAPOL state machine allocated with eapol_sm_init()
+ * Returns: Static string containing name of current eap method or NULL
+ */
+const char * eapol_sm_get_method_name(struct eapol_sm *sm)
+{
+       if (sm->SUPP_PAE_state != SUPP_PAE_AUTHENTICATED ||
+           sm->suppPortStatus != Authorized)
+               return NULL;
+
+       return eap_sm_get_method_name(sm->eap);
+}
+
+
 #ifdef CONFIG_CTRL_IFACE
 /**
  * eapol_sm_get_status - Get EAPOL state machine status
index 1d2a32bb7cbf82e5a83e7fa26612f055d158f962..22897de5dba0aa19582aff9cf863e58af98f0591 100644 (file)
@@ -255,6 +255,7 @@ void eapol_sm_notify_ctrl_response(struct eapol_sm *sm);
 void eapol_sm_request_reauth(struct eapol_sm *sm);
 void eapol_sm_notify_lower_layer_success(struct eapol_sm *sm, int in_eapol_sm);
 void eapol_sm_invalidate_cached_session(struct eapol_sm *sm);
+const char * eapol_sm_get_method_name(struct eapol_sm *sm);
 #else /* IEEE8021X_EAPOL */
 static inline struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx)
 {