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_MSCHAPv2
     39 	if (ret == 0)
     40 		ret = eap_peer_mschapv2_register();
     41 #endif /* EAP_MSCHAPv2 */
     42 
     43 #ifdef EAP_PEAP
     44 	if (ret == 0)
     45 		ret = eap_peer_peap_register();
     46 #endif /* EAP_PEAP */
     47 
     48 #ifdef EAP_TTLS
     49 	if (ret == 0)
     50 		ret = eap_peer_ttls_register();
     51 #endif /* EAP_TTLS */
     52 
     53 #ifdef EAP_GTC
     54 	if (ret == 0)
     55 		ret = eap_peer_gtc_register();
     56 #endif /* EAP_GTC */
     57 
     58 #ifdef EAP_OTP
     59 	if (ret == 0)
     60 		ret = eap_peer_otp_register();
     61 #endif /* EAP_OTP */
     62 
     63 #ifdef EAP_SIM
     64 	if (ret == 0)
     65 		ret = eap_peer_sim_register();
     66 #endif /* EAP_SIM */
     67 
     68 #ifdef EAP_LEAP
     69 	if (ret == 0)
     70 		ret = eap_peer_leap_register();
     71 #endif /* EAP_LEAP */
     72 
     73 #ifdef EAP_PSK
     74 	if (ret == 0)
     75 		ret = eap_peer_psk_register();
     76 #endif /* EAP_PSK */
     77 
     78 #ifdef EAP_AKA
     79 	if (ret == 0)
     80 		ret = eap_peer_aka_register();
     81 #endif /* EAP_AKA */
     82 
     83 #ifdef EAP_AKA_PRIME
     84 	if (ret == 0)
     85 		ret = eap_peer_aka_prime_register();
     86 #endif /* EAP_AKA_PRIME */
     87 
     88 #ifdef EAP_FAST
     89 	if (ret == 0)
     90 		ret = eap_peer_fast_register();
     91 #endif /* EAP_FAST */
     92 
     93 #ifdef EAP_PAX
     94 	if (ret == 0)
     95 		ret = eap_peer_pax_register();
     96 #endif /* EAP_PAX */
     97 
     98 #ifdef EAP_SAKE
     99 	if (ret == 0)
    100 		ret = eap_peer_sake_register();
    101 #endif /* EAP_SAKE */
    102 
    103 #ifdef EAP_GPSK
    104 	if (ret == 0)
    105 		ret = eap_peer_gpsk_register();
    106 #endif /* EAP_GPSK */
    107 
    108 #ifdef EAP_WSC
    109 	if (ret == 0)
    110 		ret = eap_peer_wsc_register();
    111 #endif /* EAP_WSC */
    112 
    113 #ifdef EAP_IKEV2
    114 	if (ret == 0)
    115 		ret = eap_peer_ikev2_register();
    116 #endif /* EAP_IKEV2 */
    117 
    118 #ifdef EAP_VENDOR_TEST
    119 	if (ret == 0)
    120 		ret = eap_peer_vendor_test_register();
    121 #endif /* EAP_VENDOR_TEST */
    122 
    123 #ifdef EAP_TNC
    124 	if (ret == 0)
    125 		ret = eap_peer_tnc_register();
    126 #endif /* EAP_TNC */
    127 
    128 #ifdef EAP_PWD
    129 	if (ret == 0)
    130 		ret = eap_peer_pwd_register();
    131 #endif /* EAP_PWD */
    132 
    133 #ifdef EAP_SERVER_IDENTITY
    134 	if (ret == 0)
    135 		ret = eap_server_identity_register();
    136 #endif /* EAP_SERVER_IDENTITY */
    137 
    138 #ifdef EAP_SERVER_MD5
    139 	if (ret == 0)
    140 		ret = eap_server_md5_register();
    141 #endif /* EAP_SERVER_MD5 */
    142 
    143 #ifdef EAP_SERVER_TLS
    144 	if (ret == 0)
    145 		ret = eap_server_tls_register();
    146 #endif /* EAP_SERVER_TLS */
    147 
    148 #ifdef EAP_SERVER_MSCHAPV2
    149 	if (ret == 0)
    150 		ret = eap_server_mschapv2_register();
    151 #endif /* EAP_SERVER_MSCHAPV2 */
    152 
    153 #ifdef EAP_SERVER_PEAP
    154 	if (ret == 0)
    155 		ret = eap_server_peap_register();
    156 #endif /* EAP_SERVER_PEAP */
    157 
    158 #ifdef EAP_SERVER_TLV
    159 	if (ret == 0)
    160 		ret = eap_server_tlv_register();
    161 #endif /* EAP_SERVER_TLV */
    162 
    163 #ifdef EAP_SERVER_GTC
    164 	if (ret == 0)
    165 		ret = eap_server_gtc_register();
    166 #endif /* EAP_SERVER_GTC */
    167 
    168 #ifdef EAP_SERVER_TTLS
    169 	if (ret == 0)
    170 		ret = eap_server_ttls_register();
    171 #endif /* EAP_SERVER_TTLS */
    172 
    173 #ifdef EAP_SERVER_SIM
    174 	if (ret == 0)
    175 		ret = eap_server_sim_register();
    176 #endif /* EAP_SERVER_SIM */
    177 
    178 #ifdef EAP_SERVER_AKA
    179 	if (ret == 0)
    180 		ret = eap_server_aka_register();
    181 #endif /* EAP_SERVER_AKA */
    182 
    183 #ifdef EAP_SERVER_AKA_PRIME
    184 	if (ret == 0)
    185 		ret = eap_server_aka_prime_register();
    186 #endif /* EAP_SERVER_AKA_PRIME */
    187 
    188 #ifdef EAP_SERVER_PAX
    189 	if (ret == 0)
    190 		ret = eap_server_pax_register();
    191 #endif /* EAP_SERVER_PAX */
    192 
    193 #ifdef EAP_SERVER_PSK
    194 	if (ret == 0)
    195 		ret = eap_server_psk_register();
    196 #endif /* EAP_SERVER_PSK */
    197 
    198 #ifdef EAP_SERVER_SAKE
    199 	if (ret == 0)
    200 		ret = eap_server_sake_register();
    201 #endif /* EAP_SERVER_SAKE */
    202 
    203 #ifdef EAP_SERVER_GPSK
    204 	if (ret == 0)
    205 		ret = eap_server_gpsk_register();
    206 #endif /* EAP_SERVER_GPSK */
    207 
    208 #ifdef EAP_SERVER_VENDOR_TEST
    209 	if (ret == 0)
    210 		ret = eap_server_vendor_test_register();
    211 #endif /* EAP_SERVER_VENDOR_TEST */
    212 
    213 #ifdef EAP_SERVER_FAST
    214 	if (ret == 0)
    215 		ret = eap_server_fast_register();
    216 #endif /* EAP_SERVER_FAST */
    217 
    218 #ifdef EAP_SERVER_WSC
    219 	if (ret == 0)
    220 		ret = eap_server_wsc_register();
    221 #endif /* EAP_SERVER_WSC */
    222 
    223 #ifdef EAP_SERVER_IKEV2
    224 	if (ret == 0)
    225 		ret = eap_server_ikev2_register();
    226 #endif /* EAP_SERVER_IKEV2 */
    227 
    228 #ifdef EAP_SERVER_TNC
    229 	if (ret == 0)
    230 		ret = eap_server_tnc_register();
    231 #endif /* EAP_SERVER_TNC */
    232 
    233 #ifdef EAP_SERVER_PWD
    234 	if (ret == 0)
    235 		ret = eap_server_pwd_register();
    236 #endif /* EAP_SERVER_PWD */
    237 
    238 	return ret;
    239 }
    240