eap_method Struct Reference

EAP method interface. More...

#include <eap_i.h>


Data Fields

EapType method
 EAP type number (EAP_TYPE_*).
const char * name
 Name of the method (e.g., "TLS").
void *(* init )(struct eap_sm *sm)
 Initialize an EAP method.
void(* deinit )(struct eap_sm *sm, void *priv)
 Deinitialize an EAP method.
u8 *(* process )(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, const u8 *reqData, size_t reqDataLen, size_t *respDataLen)
 Process an EAP request.
Boolean(* isKeyAvailable )(struct eap_sm *sm, void *priv)
 Find out whether EAP method has keying material.
u8 *(* getKey )(struct eap_sm *sm, void *priv, size_t *len)
 Get EAP method specific keying material (eapKeyData).
int(* get_status )(struct eap_sm *sm, void *priv, char *buf, size_t buflen, int verbose)
 Get EAP method status.
Boolean(* has_reauth_data )(struct eap_sm *sm, void *priv)
 Whether method is ready for fast reauthentication.
void(* deinit_for_reauth )(struct eap_sm *sm, void *priv)
 Release data that is not needed for fast re-auth.
void *(* init_for_reauth )(struct eap_sm *sm, void *priv)
 Prepare for start of fast re-authentication.
const u8 *(* get_identity )(struct eap_sm *sm, void *priv, size_t *len)
 Get method specific identity for re-authentication.


Detailed Description

EAP method interface.

This structure defines the EAP method interface. Each method will need to register its own EAP type, EAP name, and set of function pointers for method specific operations. This interface is based on section 4.4 of RFC 4137.

Definition at line 74 of file eap_i.h.


Field Documentation

void(* eap_method::deinit)(struct eap_sm *sm, void *priv)
 

Deinitialize an EAP method.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
priv Pointer to private EAP method data from eap_method::init()
Deinitialize the EAP method and free any allocated private data.

void(* eap_method::deinit_for_reauth)(struct eap_sm *sm, void *priv)
 

Release data that is not needed for fast re-auth.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
priv Pointer to private EAP method data from eap_method::init()
This function is an optional handler that only EAP methods supporting fast re-authentication need to implement. This is called when authentication has been completed and EAP state machine is requesting that enough state information is maintained for fast re-authentication

const u8*(* eap_method::get_identity)(struct eap_sm *sm, void *priv, size_t *len)
 

Get method specific identity for re-authentication.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
priv Pointer to private EAP method data from eap_method::init()
len Length of the returned identity
Returns:
Pointer to the method specific identity or NULL if default identity is to be used
This function is an optional handler that only EAP methods that use method specific identity need to implement.

int(* eap_method::get_status)(struct eap_sm *sm, void *priv, char *buf, size_t buflen, int verbose)
 

Get EAP method status.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
priv Pointer to private EAP method data from eap_method::init()
buf Buffer for status information
buflen Maximum buffer length
verbose Whether to include verbose status information
Returns:
Number of bytes written to buf
Query EAP method for status information. This function fills in a text area with current status information from the EAP method. If the buffer (buf) is not large enough, status information will be truncated to fit the buffer.

u8*(* eap_method::getKey)(struct eap_sm *sm, void *priv, size_t *len)
 

Get EAP method specific keying material (eapKeyData).

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
priv Pointer to private EAP method data from eap_method::init()
len Pointer to variable to store key length (eapKeyDataLen)
Returns:
Keying material (eapKeyData) or NULL if not available
This function can be used to get the keying material from the EAP method. The key may already be stored in the method-specific private data or this function may derive the key.

Boolean(* eap_method::has_reauth_data)(struct eap_sm *sm, void *priv)
 

Whether method is ready for fast reauthentication.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
priv Pointer to private EAP method data from eap_method::init()
Returns:
TRUE or FALSE based on whether fast reauthentication is possible
This function is an optional handler that only EAP methods supporting fast re-authentication need to implement.

void*(* eap_method::init)(struct eap_sm *sm)
 

Initialize an EAP method.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
Returns:
Pointer to allocated private data, or NULL on failure
This function is used to initialize the EAP method explicitly instead of using METHOD_INIT state as specific in RFC 4137. The method is expected to initialize it method-specific state and return a pointer that will be used as the priv argument to other calls.

void*(* eap_method::init_for_reauth)(struct eap_sm *sm, void *priv)
 

Prepare for start of fast re-authentication.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
priv Pointer to private EAP method data from eap_method::init()
This function is an optional handler that only EAP methods supporting fast re-authentication need to implement. This is called when EAP authentication is started and EAP state machine is requesting fast re-authentication to be used.

Boolean(* eap_method::isKeyAvailable)(struct eap_sm *sm, void *priv)
 

Find out whether EAP method has keying material.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
priv Pointer to private EAP method data from eap_method::init()
Returns:
TRUE if key material (eapKeyData) is available

u8*(* eap_method::process)(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, const u8 *reqData, size_t reqDataLen, size_t *respDataLen)
 

Process an EAP request.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
priv Pointer to private EAP method data from eap_method::init()
ret Return values from EAP request validation and processing
reqData EAP request to be processed (eapReqData)
reqDataLen Length of the EAP request
respDataLen Length of the returned EAP response
Returns:
Pointer to allocated EAP response packet (eapRespData)
This function is a combination of m.check(), m.process(), and m.buildResp() procedures defined in section 4.4 of RFC 4137 In other words, this function validates the incoming request, processes it, and build a response packet. m.check() and m.process() return values are returned through struct eap_method_ret *ret variable. Caller is responsible for freeing the returned EAP response packet.


The documentation for this struct was generated from the following file:
Generated on Sat May 6 21:20:17 2006 for wpa_supplicant by  doxygen 1.4.2