wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
eap_methods.h File Reference

EAP peer: Method registration. More...

#include "eap_common/eap_defs.h"

Go to the source code of this file.

Functions

const struct eap_methodeap_peer_get_eap_method (int vendor, EapType method)
 Get EAP method based on type number. More...
 
const struct eap_methodeap_peer_get_methods (size_t *count)
 Get a list of enabled EAP peer methods. More...
 
struct eap_methodeap_peer_method_alloc (int version, int vendor, EapType method, const char *name)
 Allocate EAP peer method structure. More...
 
void eap_peer_method_free (struct eap_method *method)
 Free EAP peer method structure. More...
 
int eap_peer_method_register (struct eap_method *method)
 Register an EAP peer method. More...
 
EapType eap_peer_get_type (const char *name, int *vendor)
 Get EAP type for the given EAP method name. More...
 
const char * eap_get_name (int vendor, EapType type)
 Get EAP method name for the given EAP type. More...
 
size_t eap_get_names (char *buf, size_t buflen)
 Get space separated list of names for supported EAP methods. More...
 
char ** eap_get_names_as_string_array (size_t *num)
 Get supported EAP methods as string array. More...
 
void eap_peer_unregister_methods (void)
 Unregister EAP peer methods. More...
 
int eap_peer_md5_register (void)
 
int eap_peer_tls_register (void)
 
int eap_peer_unauth_tls_register (void)
 
int eap_peer_wfa_unauth_tls_register (void)
 
int eap_peer_mschapv2_register (void)
 Register EAP-MSCHAPv2 peer method. More...
 
int eap_peer_peap_register (void)
 
int eap_peer_ttls_register (void)
 
int eap_peer_gtc_register (void)
 
int eap_peer_otp_register (void)
 
int eap_peer_sim_register (void)
 
int eap_peer_leap_register (void)
 
int eap_peer_psk_register (void)
 
int eap_peer_aka_register (void)
 
int eap_peer_aka_prime_register (void)
 
int eap_peer_fast_register (void)
 
int eap_peer_pax_register (void)
 
int eap_peer_sake_register (void)
 
int eap_peer_gpsk_register (void)
 
int eap_peer_wsc_register (void)
 
int eap_peer_ikev2_register (void)
 
int eap_peer_vendor_test_register (void)
 
int eap_peer_tnc_register (void)
 
int eap_peer_pwd_register (void)
 
int eap_peer_eke_register (void)
 

Detailed Description

EAP peer: Method registration.

Function Documentation

const char* eap_get_name ( int  vendor,
EapType  type 
)

Get EAP method name for the given EAP type.

Parameters
vendorEAP Vendor-Id (0 = IETF)
typeEAP method type
Returns
EAP method name, e.g., TLS, or NULL if not found

This function maps EAP type numbers into EAP type names based on the list of EAP methods included in the build.

size_t eap_get_names ( char *  buf,
size_t  buflen 
)

Get space separated list of names for supported EAP methods.

Parameters
bufBuffer for names
buflenBuffer length
Returns
Number of characters written into buf (not including nul termination)
char** eap_get_names_as_string_array ( size_t *  num)

Get supported EAP methods as string array.

Parameters
numBuffer for returning the number of items in array, not including NULL terminator. This parameter can be NULL if the length is not needed.
Returns
A NULL-terminated array of strings, or NULL on error.

This function returns the list of names for all supported EAP methods as an array of strings. The caller must free the returned array items and the array.

const struct eap_method* eap_peer_get_eap_method ( int  vendor,
EapType  method 
)

Get EAP method based on type number.

Parameters
vendorEAP Vendor-Id (0 = IETF)
methodEAP type number
Returns
Pointer to EAP method or NULL if not found
const struct eap_method* eap_peer_get_methods ( size_t *  count)

Get a list of enabled EAP peer methods.

Parameters
countSet to number of available methods
Returns
List of enabled EAP peer methods
EapType eap_peer_get_type ( const char *  name,
int *  vendor 
)

Get EAP type for the given EAP method name.

Parameters
nameEAP method name, e.g., TLS
vendorBuffer for returning EAP Vendor-Id
Returns
EAP method type or EAP_TYPE_NONE if not found

This function maps EAP type names into EAP type numbers based on the list of EAP methods included in the build.

struct eap_method* eap_peer_method_alloc ( int  version,
int  vendor,
EapType  method,
const char *  name 
)

Allocate EAP peer method structure.

Parameters
versionVersion of the EAP peer method interface (set to EAP_PEER_METHOD_INTERFACE_VERSION)
vendorEAP Vendor-ID (EAP_VENDOR_*) (0 = IETF)
methodEAP type number (EAP_TYPE_*)
nameName of the method (e.g., "TLS")
Returns
Allocated EAP method structure or NULL on failure

The returned structure should be freed with eap_peer_method_free() when it is not needed anymore.

void eap_peer_method_free ( struct eap_method method)

Free EAP peer method structure.

Parameters
methodMethod structure allocated with eap_peer_method_alloc()
int eap_peer_method_register ( struct eap_method method)

Register an EAP peer method.

Parameters
methodEAP method to register
Returns
0 on success, -1 on invalid method, or -2 if a matching EAP method has already been registered

Each EAP peer method needs to call this function to register itself as a supported EAP method.

int eap_peer_mschapv2_register ( void  )

Register EAP-MSCHAPv2 peer method.

Returns
0 on success, -1 on failure

This function is used to register EAP-MSCHAPv2 peer method into the EAP method list.

void eap_peer_unregister_methods ( void  )

Unregister EAP peer methods.

This function is called at program termination to unregister all EAP peer methods.