eap_methods.c File Reference

EAP peer: Method registration. More...

#include "includes.h"
#include "common.h"
#include "eap_i.h"
#include "eap_methods.h"

Include dependency graph for eap_methods.c:

Go to the source code of this file.

Functions

const struct eap_methodeap_sm_get_eap_methods (int vendor, EapType method)
 Get EAP method based on type number.
EapType eap_get_type (const char *name, int *vendor)
 Get EAP type for the given EAP method name.
const char * eap_get_name (int vendor, EapType type)
 Get EAP method name for the given EAP type.
size_t eap_get_names (char *buf, size_t buflen)
 Get space separated list of names for supported EAP methods.
char ** eap_get_names_as_string_array (size_t *num)
 Get supported EAP methods as string array.
const struct eap_methodeap_peer_get_methods (size_t *count)
 Get a list of enabled EAP peer methods.
eap_methodeap_peer_method_alloc (int version, int vendor, EapType method, const char *name)
 Allocate EAP peer method structure.
void eap_peer_method_free (struct eap_method *method)
 Free EAP peer method structure.
int eap_peer_method_register (struct eap_method *method)
 Register an EAP peer method.
int eap_peer_register_methods (void)
 Register statically linked EAP peer methods.
void eap_peer_unregister_methods (void)
 Unregister EAP peer methods.


Detailed Description

EAP peer: Method registration.

Copyright
Copyright (c) 2004-2006, Jouni Malinen <[email protected]>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Alternatively, this software may be distributed under the terms of BSD license.

See README and COPYING for more details.

Definition in file eap_methods.c.


Function Documentation

const char* eap_get_name int  vendor,
EapType  type
 

Get EAP method name for the given EAP type.

Parameters:
vendor EAP Vendor-Id (0 = IETF)
type EAP 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.

Definition at line 81 of file eap_methods.c.

size_t eap_get_names char *  buf,
size_t  buflen
 

Get space separated list of names for supported EAP methods.

Parameters:
buf Buffer for names
buflen Buffer length
Returns:
Number of characters written into buf (not including nul termination)

Definition at line 100 of file eap_methods.c.

char** eap_get_names_as_string_array size_t *  num  ) 
 

Get supported EAP methods as string array.

Parameters:
num Buffer 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.

Definition at line 136 of file eap_methods.c.

Here is the call graph for this function:

EapType eap_get_type const char *  name,
int *  vendor
 

Get EAP type for the given EAP method name.

Parameters:
name EAP method name, e.g., TLS
vendor Buffer 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.

Definition at line 57 of file eap_methods.c.

const struct eap_method* eap_peer_get_methods size_t *  count  ) 
 

Get a list of enabled EAP peer methods.

Parameters:
count Set to number of available methods
Returns:
List of enabled EAP peer methods

Definition at line 174 of file eap_methods.c.

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

Allocate EAP peer method structure.

Parameters:
version Version of the EAP peer method interface (set to EAP_PEER_METHOD_INTERFACE_VERSION)
vendor EAP Vendor-ID (EAP_VENDOR_*) (0 = IETF)
method EAP type number (EAP_TYPE_*)
name Name 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.

Definition at line 293 of file eap_methods.c.

Here is the call graph for this function:

void eap_peer_method_free struct eap_method method  ) 
 

Free EAP peer method structure.

Parameters:
method Method structure allocated with eap_peer_method_alloc()

Definition at line 313 of file eap_methods.c.

int eap_peer_method_register struct eap_method method  ) 
 

Register an EAP peer method.

Parameters:
method EAP 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.

Definition at line 329 of file eap_methods.c.

int eap_peer_register_methods void   ) 
 

Register statically linked EAP peer methods.

Returns:
0 on success, -1 on failure
This function is called at program initialization to register all EAP peer methods that were linked in statically.

Definition at line 362 of file eap_methods.c.

Here is the call graph for this function:

void eap_peer_unregister_methods void   ) 
 

Unregister EAP peer methods.

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

Definition at line 489 of file eap_methods.c.

Here is the call graph for this function:

const struct eap_method* eap_sm_get_eap_methods int  vendor,
EapType  method
 

Get EAP method based on type number.

Parameters:
vendor EAP Vendor-Id (0 = IETF)
method EAP type number
Returns:
Pointer to EAP method or NULL if not found

Definition at line 36 of file eap_methods.c.


Generated on Sun Dec 31 13:51:27 2006 for wpa_supplicant by  doxygen 1.4.2