1/* 2 * EAP peer: Method registration 3 * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi> 4 * 5 * This software may be distributed under the terms of the BSD license. 6 * See README for more details. 7 */ 8 9#ifndef EAP_METHODS_H 10#define EAP_METHODS_H 11 12#include "eap_common/eap_defs.h" 13 14const struct eap_method * eap_peer_get_eap_method(int vendor, EapType method); 15const struct eap_method * eap_peer_get_methods(size_t *count); 16 17struct eap_method * eap_peer_method_alloc(int version, int vendor, 18 EapType method, const char *name); 19void eap_peer_method_free(struct eap_method *method); 20int eap_peer_method_register(struct eap_method *method); 21 22 23#ifdef IEEE8021X_EAPOL 24 25EapType eap_peer_get_type(const char *name, int *vendor); 26const char * eap_get_name(int vendor, EapType type); 27size_t eap_get_names(char *buf, size_t buflen); 28char ** eap_get_names_as_string_array(size_t *num); 29void eap_peer_unregister_methods(void); 30 31#else /* IEEE8021X_EAPOL */ 32 33static inline EapType eap_peer_get_type(const char *name, int *vendor) 34{ 35 *vendor = EAP_VENDOR_IETF; 36 return EAP_TYPE_NONE; 37} 38 39static inline const char * eap_get_name(int vendor, EapType type) 40{ 41 return NULL; 42} 43 44static inline size_t eap_get_names(char *buf, size_t buflen) 45{ 46 return 0; 47} 48 49static inline int eap_peer_register_methods(void) 50{ 51 return 0; 52} 53 54static inline void eap_peer_unregister_methods(void) 55{ 56} 57 58static inline char ** eap_get_names_as_string_array(size_t *num) 59{ 60 return NULL; 61} 62 63#endif /* IEEE8021X_EAPOL */ 64 65 66#ifdef CONFIG_DYNAMIC_EAP_METHODS 67 68int eap_peer_method_load(const char *so); 69int eap_peer_method_unload(struct eap_method *method); 70 71#else /* CONFIG_DYNAMIC_EAP_METHODS */ 72 73static inline int eap_peer_method_load(const char *so) 74{ 75 return 0; 76} 77 78static inline int eap_peer_method_unload(struct eap_method *method) 79{ 80 return 0; 81} 82 83#endif /* CONFIG_DYNAMIC_EAP_METHODS */ 84 85/* EAP peer method registration calls for statically linked in methods */ 86int eap_peer_md5_register(void); 87int eap_peer_tls_register(void); 88int eap_peer_unauth_tls_register(void); 89int eap_peer_mschapv2_register(void); 90int eap_peer_peap_register(void); 91int eap_peer_ttls_register(void); 92int eap_peer_gtc_register(void); 93int eap_peer_otp_register(void); 94int eap_peer_sim_register(void); 95int eap_peer_leap_register(void); 96int eap_peer_psk_register(void); 97int eap_peer_aka_register(void); 98int eap_peer_aka_prime_register(void); 99int eap_peer_fast_register(void); 100int eap_peer_pax_register(void); 101int eap_peer_sake_register(void); 102int eap_peer_gpsk_register(void); 103int eap_peer_wsc_register(void); 104int eap_peer_ikev2_register(void); 105int eap_peer_vendor_test_register(void); 106int eap_peer_tnc_register(void); 107int eap_peer_pwd_register(void); 108int eap_peer_eke_register(void); 109 110#endif /* EAP_METHODS_H */ 111