Browse Source

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>
Paul Stewart 14 years ago
parent
commit
8813e4d57e
2 changed files with 8 additions and 0 deletions
  1. 7 0
      src/eap_peer/eap.c
  2. 1 0
      src/eap_peer/eap.h

+ 7 - 0
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)

+ 1 - 0
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);