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