Home | History | Annotate | Download | only in wpa_supplicant
      1 /*
      2  * EAP method registration
      3  * Copyright (c) 2004-2009, Jouni Malinen <j (at) 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 #include "includes.h"
     10 
     11 #include "common.h"
     12 #include "eap_peer/eap_methods.h"
     13 #include "eap_server/eap_methods.h"
     14 #include "wpa_supplicant_i.h"
     15 
     16 
     17 /**
     18  * eap_register_methods - Register statically linked EAP methods
     19  * Returns: 0 on success, -1 or -2 on failure
     20  *
     21  * This function is called at program initialization to register all EAP
     22  * methods that were linked in statically.
     23  */
     24 int eap_register_methods(void)
     25 {
     26 	int ret = 0;
     27 
     28 #ifdef EAP_MD5
     29 	if (ret == 0)
     30 		ret = eap_peer_md5_register();
     31 #endif /* EAP_MD5 */
     32 
     33 #ifdef EAP_TLS
     34 	if (ret == 0)
     35 		ret = eap_peer_tls_register();
     36 #endif /* EAP_TLS */
     37 
     38 #ifdef EAP_UNAUTH_TLS
     39 	if (ret == 0)
     40 		ret = eap_peer_unauth_tls_register();
     41 #endif /* EAP_UNAUTH_TLS */
     42 
     43 #ifdef EAP_MSCHAPv2
     44 	if (ret == 0)
     45 		ret = eap_peer_mschapv2_register();
     46 #endif /* EAP_MSCHAPv2 */
     47 
     48 #ifdef EAP_PEAP
     49 	if (ret == 0)
     50 		ret = eap_peer_peap_register();
     51 #endif /* EAP_PEAP */
     52 
     53 #ifdef EAP_TTLS
     54 	if (ret == 0)
     55 		ret = eap_peer_ttls_register();
     56 #endif /* EAP_TTLS */
     57 
     58 #ifdef EAP_GTC
     59 	if (ret == 0)
     60 		ret = eap_peer_gtc_register();
     61 #endif /* EAP_GTC */
     62 
     63 #ifdef EAP_OTP
     64 	if (ret == 0)
     65 		ret = eap_peer_otp_register();
     66 #endif /* EAP_OTP */
     67 
     68 #ifdef EAP_SIM
     69 	if (ret == 0)
     70 		ret = eap_peer_sim_register();
     71 #endif /* EAP_SIM */
     72 
     73 #ifdef EAP_LEAP
     74 	if (ret == 0)
     75 		ret = eap_peer_leap_register();
     76 #endif /* EAP_LEAP */
     77 
     78 #ifdef EAP_PSK
     79 	if (ret == 0)
     80 		ret = eap_peer_psk_register();
     81 #endif /* EAP_PSK */
     82 
     83 #ifdef EAP_AKA
     84 	if (ret == 0)
     85 		ret = eap_peer_aka_register();
     86 #endif /* EAP_AKA */
     87 
     88 #ifdef EAP_AKA_PRIME
     89 	if (ret == 0)
     90 		ret = eap_peer_aka_prime_register();
     91 #endif /* EAP_AKA_PRIME */
     92 
     93 #ifdef EAP_FAST
     94 	if (ret == 0)
     95 		ret = eap_peer_fast_register();
     96 #endif /* EAP_FAST */
     97 
     98 #ifdef EAP_PAX
     99 	if (ret == 0)
    100 		ret = eap_peer_pax_register();
    101 #endif /* EAP_PAX */
    102 
    103 #ifdef EAP_SAKE
    104 	if (ret == 0)
    105 		ret = eap_peer_sake_register();
    106 #endif /* EAP_SAKE */
    107 
    108 #ifdef EAP_GPSK
    109 	if (ret == 0)
    110 		ret = eap_peer_gpsk_register();
    111 #endif /* EAP_GPSK */
    112 
    113 #ifdef EAP_WSC
    114 	if (ret == 0)
    115 		ret = eap_peer_wsc_register();
    116 #endif /* EAP_WSC */
    117 
    118 #ifdef EAP_IKEV2
    119 	if (ret == 0)
    120 		ret = eap_peer_ikev2_register();
    121 #endif /* EAP_IKEV2 */
    122 
    123 #ifdef EAP_VENDOR_TEST
    124 	if (ret == 0)
    125 		ret = eap_peer_vendor_test_register();
    126 #endif /* EAP_VENDOR_TEST */
    127 
    128 #ifdef EAP_TNC
    129 	if (ret == 0)
    130 		ret = eap_peer_tnc_register();
    131 #endif /* EAP_TNC */
    132 
    133 #ifdef EAP_PWD
    134 	if (ret == 0)
    135 		ret = eap_peer_pwd_register();
    136 #endif /* EAP_PWD */
    137 
    138 #ifdef EAP_EKE
    139 	if (ret == 0)
    140 		ret = eap_peer_eke_register();
    141 #endif /* EAP_EKE */
    142 
    143 #ifdef EAP_SERVER_IDENTITY
    144 	if (ret == 0)
    145 		ret = eap_server_identity_register();
    146 #endif /* EAP_SERVER_IDENTITY */
    147 
    148 #ifdef EAP_SERVER_MD5
    149 	if (ret == 0)
    150 		ret = eap_server_md5_register();
    151 #endif /* EAP_SERVER_MD5 */
    152 
    153 #ifdef EAP_SERVER_TLS
    154 	if (ret == 0)
    155 		ret = eap_server_tls_register();
    156 #endif /* EAP_SERVER_TLS */
    157 
    158 #ifdef EAP_SERVER_UNAUTH_TLS
    159 	if (ret == 0)
    160 		ret = eap_server_unauth_tls_register();
    161 #endif /* EAP_SERVER_UNAUTH_TLS */
    162 
    163 #ifdef EAP_SERVER_MSCHAPV2
    164 	if (ret == 0)
    165 		ret = eap_server_mschapv2_register();
    166 #endif /* EAP_SERVER_MSCHAPV2 */
    167 
    168 #ifdef EAP_SERVER_PEAP
    169 	if (ret == 0)
    170 		ret = eap_server_peap_register();
    171 #endif /* EAP_SERVER_PEAP */
    172 
    173 #ifdef EAP_SERVER_TLV
    174 	if (ret == 0)
    175 		ret = eap_server_tlv_register();
    176 #endif /* EAP_SERVER_TLV */
    177 
    178 #ifdef EAP_SERVER_GTC
    179 	if (ret == 0)
    180 		ret = eap_server_gtc_register();
    181 #endif /* EAP_SERVER_GTC */
    182 
    183 #ifdef EAP_SERVER_TTLS
    184 	if (ret == 0)
    185 		ret = eap_server_ttls_register();
    186 #endif /* EAP_SERVER_TTLS */
    187 
    188 #ifdef EAP_SERVER_SIM
    189 	if (ret == 0)
    190 		ret = eap_server_sim_register();
    191 #endif /* EAP_SERVER_SIM */
    192 
    193 #ifdef EAP_SERVER_AKA
    194 	if (ret == 0)
    195 		ret = eap_server_aka_register();
    196 #endif /* EAP_SERVER_AKA */
    197 
    198 #ifdef EAP_SERVER_AKA_PRIME
    199 	if (ret == 0)
    200 		ret = eap_server_aka_prime_register();
    201 #endif /* EAP_SERVER_AKA_PRIME */
    202 
    203 #ifdef EAP_SERVER_PAX
    204 	if (ret == 0)
    205 		ret = eap_server_pax_register();
    206 #endif /* EAP_SERVER_PAX */
    207 
    208 #ifdef EAP_SERVER_PSK
    209 	if (ret == 0)
    210 		ret = eap_server_psk_register();
    211 #endif /* EAP_SERVER_PSK */
    212 
    213 #ifdef EAP_SERVER_SAKE
    214 	if (ret == 0)
    215 		ret = eap_server_sake_register();
    216 #endif /* EAP_SERVER_SAKE */
    217 
    218 #ifdef EAP_SERVER_GPSK
    219 	if (ret == 0)
    220 		ret = eap_server_gpsk_register();
    221 #endif /* EAP_SERVER_GPSK */
    222 
    223 #ifdef EAP_SERVER_VENDOR_TEST
    224 	if (ret == 0)
    225 		ret = eap_server_vendor_test_register();
    226 #endif /* EAP_SERVER_VENDOR_TEST */
    227 
    228 #ifdef EAP_SERVER_FAST
    229 	if (ret == 0)
    230 		ret = eap_server_fast_register();
    231 #endif /* EAP_SERVER_FAST */
    232 
    233 #ifdef EAP_SERVER_WSC
    234 	if (ret == 0)
    235 		ret = eap_server_wsc_register();
    236 #endif /* EAP_SERVER_WSC */
    237 
    238 #ifdef EAP_SERVER_IKEV2
    239 	if (ret == 0)
    240 		ret = eap_server_ikev2_register();
    241 #endif /* EAP_SERVER_IKEV2 */
    242 
    243 #ifdef EAP_SERVER_TNC
    244 	if (ret == 0)
    245 		ret = eap_server_tnc_register();
    246 #endif /* EAP_SERVER_TNC */
    247 
    248 #ifdef EAP_SERVER_PWD
    249 	if (ret == 0)
    250 		ret = eap_server_pwd_register();
    251 #endif /* EAP_SERVER_PWD */
    252 
    253 	return ret;
    254 }
    255