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 14 const struct eap_method * eap_peer_get_eap_method(int vendor, 15 enum eap_type method); 16 const struct eap_method * eap_peer_get_methods(size_t *count); 17 18 struct eap_method * eap_peer_method_alloc(int version, int vendor, 19 enum eap_type method, 20 const char *name); 21 int eap_peer_method_register(struct eap_method *method); 22 23 24 #ifdef IEEE8021X_EAPOL 25 26 enum eap_type eap_peer_get_type(const char *name, int *vendor); 27 const char * eap_get_name(int vendor, enum eap_type type); 28 size_t eap_get_names(char *buf, size_t buflen); 29 char ** eap_get_names_as_string_array(size_t *num); 30 void eap_peer_unregister_methods(void); 31 32 #else /* IEEE8021X_EAPOL */ 33 34 static inline enum eap_type eap_peer_get_type(const char *name, int *vendor) 35 { 36 *vendor = EAP_VENDOR_IETF; 37 return EAP_TYPE_NONE; 38 } 39 40 static inline const char * eap_get_name(int vendor, enum eap_type type) 41 { 42 return NULL; 43 } 44 45 static inline size_t eap_get_names(char *buf, size_t buflen) 46 { 47 return 0; 48 } 49 50 static inline int eap_peer_register_methods(void) 51 { 52 return 0; 53 } 54 55 static inline void eap_peer_unregister_methods(void) 56 { 57 } 58 59 static inline char ** eap_get_names_as_string_array(size_t *num) 60 { 61 return NULL; 62 } 63 64 #endif /* IEEE8021X_EAPOL */ 65 66 67 #ifdef CONFIG_DYNAMIC_EAP_METHODS 68 69 int eap_peer_method_load(const char *so); 70 int eap_peer_method_unload(struct eap_method *method); 71 72 #else /* CONFIG_DYNAMIC_EAP_METHODS */ 73 74 static inline int eap_peer_method_load(const char *so) 75 { 76 return 0; 77 } 78 79 static inline int eap_peer_method_unload(struct eap_method *method) 80 { 81 return 0; 82 } 83 84 #endif /* CONFIG_DYNAMIC_EAP_METHODS */ 85 86 /* EAP peer method registration calls for statically linked in methods */ 87 int eap_peer_md5_register(void); 88 int eap_peer_tls_register(void); 89 int eap_peer_unauth_tls_register(void); 90 int eap_peer_wfa_unauth_tls_register(void); 91 int eap_peer_mschapv2_register(void); 92 int eap_peer_peap_register(void); 93 int eap_peer_ttls_register(void); 94 int eap_peer_gtc_register(void); 95 int eap_peer_otp_register(void); 96 int eap_peer_sim_register(void); 97 int eap_peer_leap_register(void); 98 int eap_peer_psk_register(void); 99 int eap_peer_aka_register(void); 100 int eap_peer_aka_prime_register(void); 101 int eap_peer_fast_register(void); 102 int eap_peer_teap_register(void); 103 int eap_peer_pax_register(void); 104 int eap_peer_sake_register(void); 105 int eap_peer_gpsk_register(void); 106 int eap_peer_wsc_register(void); 107 int eap_peer_ikev2_register(void); 108 int eap_peer_vendor_test_register(void); 109 int eap_peer_tnc_register(void); 110 int eap_peer_pwd_register(void); 111 int eap_peer_eke_register(void); 112 113 #endif /* EAP_METHODS_H */ 114