aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer
diff options
context:
space:
mode:
authorPaul Stewart <pstew@google.com>2011-03-15 13:47:33 +0200
committerJouni Malinen <j@w1.fi>2011-03-15 13:47:33 +0200
commit8813e4d57e2de675384ea025bbd5bb8598f1f10c (patch)
treef2c06208e18b716235a783a21783e2f19d509c37 /src/eap_peer
parente17a2477dbb6cc930ce0beb8678916b554674a4a (diff)
downloadexternal_wpa_supplicant_8_ti-8813e4d57e2de675384ea025bbd5bb8598f1f10c.zip
external_wpa_supplicant_8_ti-8813e4d57e2de675384ea025bbd5bb8598f1f10c.tar.gz
external_wpa_supplicant_8_ti-8813e4d57e2de675384ea025bbd5bb8598f1f10c.tar.bz2
eap_peer: Add method to return current method name
If there is an active EAP method, return its name. Signed-off-by: Paul Stewart <pstew@google.com>
Diffstat (limited to 'src/eap_peer')
-rw-r--r--src/eap_peer/eap.c7
-rw-r--r--src/eap_peer/eap.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c
index 330164a..8a9826f 100644
--- a/src/eap_peer/eap.c
+++ b/src/eap_peer/eap.c
@@ -1554,6 +1554,13 @@ static void eap_sm_request(struct eap_sm *sm, eap_ctrl_req_type type,
#define eap_sm_request(sm, type, msg, msglen) do { } while (0)
#endif /* CONFIG_CTRL_IFACE || !CONFIG_NO_STDOUT_DEBUG */
+const char * eap_sm_get_method_name(struct eap_sm *sm)
+{
+ if (sm->m == NULL)
+ return "UNKNOWN";
+ return sm->m->name;
+}
+
/**
* eap_sm_request_identity - Request identity from user (ctrl_iface)
diff --git a/src/eap_peer/eap.h b/src/eap_peer/eap.h
index 40d0b69..3550909 100644
--- a/src/eap_peer/eap.h
+++ b/src/eap_peer/eap.h
@@ -261,6 +261,7 @@ int eap_peer_sm_step(struct eap_sm *sm);
void eap_sm_abort(struct eap_sm *sm);
int eap_sm_get_status(struct eap_sm *sm, char *buf, size_t buflen,
int verbose);
+const char * eap_sm_get_method_name(struct eap_sm *sm);
struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted);
void eap_sm_request_identity(struct eap_sm *sm);
void eap_sm_request_password(struct eap_sm *sm);