Home | History | Annotate | Download | only in hostapd
      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_server/eap_methods.h"
     13 #include "eap_register.h"
     14 
     15 
     16 /**
     17  * eap_server_register_methods - Register statically linked EAP server methods
     18  * Returns: 0 on success, -1 or -2 on failure
     19  *
     20  * This function is called at program initialization to register all EAP
     21  * methods that were linked in statically.
     22  */
     23 int eap_server_register_methods(void)
     24 {
     25 	int ret = 0;
     26 
     27 #ifdef EAP_SERVER_IDENTITY
     28 	if (ret == 0)
     29 		ret = eap_server_identity_register();
     30 #endif /* EAP_SERVER_IDENTITY */
     31 
     32 #ifdef EAP_SERVER_MD5
     33 	if (ret == 0)
     34 		ret = eap_server_md5_register();
     35 #endif /* EAP_SERVER_MD5 */
     36 
     37 #ifdef EAP_SERVER_TLS
     38 	if (ret == 0)
     39 		ret = eap_server_tls_register();
     40 #endif /* EAP_SERVER_TLS */
     41 
     42 #ifdef EAP_SERVER_UNAUTH_TLS
     43 	if (ret == 0)
     44 		ret = eap_server_unauth_tls_register();
     45 #endif /* EAP_SERVER_TLS */
     46 
     47 #ifdef EAP_SERVER_TLS
     48 #ifdef CONFIG_HS20
     49 	if (ret == 0)
     50 		ret = eap_server_wfa_unauth_tls_register();
     51 #endif /* CONFIG_HS20 */
     52 #endif /* EAP_SERVER_TLS */
     53 
     54 #ifdef EAP_SERVER_MSCHAPV2
     55 	if (ret == 0)
     56 		ret = eap_server_mschapv2_register();
     57 #endif /* EAP_SERVER_MSCHAPV2 */
     58 
     59 #ifdef EAP_SERVER_PEAP
     60 	if (ret == 0)
     61 		ret = eap_server_peap_register();
     62 #endif /* EAP_SERVER_PEAP */
     63 
     64 #ifdef EAP_SERVER_TLV
     65 	if (ret == 0)
     66 		ret = eap_server_tlv_register();
     67 #endif /* EAP_SERVER_TLV */
     68 
     69 #ifdef EAP_SERVER_GTC
     70 	if (ret == 0)
     71 		ret = eap_server_gtc_register();
     72 #endif /* EAP_SERVER_GTC */
     73 
     74 #ifdef EAP_SERVER_TTLS
     75 	if (ret == 0)
     76 		ret = eap_server_ttls_register();
     77 #endif /* EAP_SERVER_TTLS */
     78 
     79 #ifdef EAP_SERVER_SIM
     80 	if (ret == 0)
     81 		ret = eap_server_sim_register();
     82 #endif /* EAP_SERVER_SIM */
     83 
     84 #ifdef EAP_SERVER_AKA
     85 	if (ret == 0)
     86 		ret = eap_server_aka_register();
     87 #endif /* EAP_SERVER_AKA */
     88 
     89 #ifdef EAP_SERVER_AKA_PRIME
     90 	if (ret == 0)
     91 		ret = eap_server_aka_prime_register();
     92 #endif /* EAP_SERVER_AKA_PRIME */
     93 
     94 #ifdef EAP_SERVER_PAX
     95 	if (ret == 0)
     96 		ret = eap_server_pax_register();
     97 #endif /* EAP_SERVER_PAX */
     98 
     99 #ifdef EAP_SERVER_PSK
    100 	if (ret == 0)
    101 		ret = eap_server_psk_register();
    102 #endif /* EAP_SERVER_PSK */
    103 
    104 #ifdef EAP_SERVER_SAKE
    105 	if (ret == 0)
    106 		ret = eap_server_sake_register();
    107 #endif /* EAP_SERVER_SAKE */
    108 
    109 #ifdef EAP_SERVER_GPSK
    110 	if (ret == 0)
    111 		ret = eap_server_gpsk_register();
    112 #endif /* EAP_SERVER_GPSK */
    113 
    114 #ifdef EAP_SERVER_VENDOR_TEST
    115 	if (ret == 0)
    116 		ret = eap_server_vendor_test_register();
    117 #endif /* EAP_SERVER_VENDOR_TEST */
    118 
    119 #ifdef EAP_SERVER_FAST
    120 	if (ret == 0)
    121 		ret = eap_server_fast_register();
    122 #endif /* EAP_SERVER_FAST */
    123 
    124 #ifdef EAP_SERVER_WSC
    125 	if (ret == 0)
    126 		ret = eap_server_wsc_register();
    127 #endif /* EAP_SERVER_WSC */
    128 
    129 #ifdef EAP_SERVER_IKEV2
    130 	if (ret == 0)
    131 		ret = eap_server_ikev2_register();
    132 #endif /* EAP_SERVER_IKEV2 */
    133 
    134 #ifdef EAP_SERVER_TNC
    135 	if (ret == 0)
    136 		ret = eap_server_tnc_register();
    137 #endif /* EAP_SERVER_TNC */
    138 
    139 #ifdef EAP_SERVER_PWD
    140 	if (ret == 0)
    141 		ret = eap_server_pwd_register();
    142 #endif /* EAP_SERVER_PWD */
    143 
    144 #ifdef EAP_SERVER_EKE
    145 	if (ret == 0)
    146 		ret = eap_server_eke_register();
    147 #endif /* EAP_SERVER_EKE */
    148 
    149 	return ret;
    150 }
    151