dbus: Fix init-failure-detection
[hostap-gosc2009.git] / wpa_supplicant / eap_register.c
blobf6688740bb77f1ed250a036eaf4204a6eb2d5815
1 /*
2 * EAP method registration
3 * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #include "includes.h"
17 #include "common.h"
18 #include "eap_peer/eap_methods.h"
19 #include "eap_server/eap_methods.h"
22 /**
23 * eap_register_methods - Register statically linked EAP methods
24 * Returns: 0 on success, -1 or -2 on failure
26 * This function is called at program initialization to register all EAP
27 * methods that were linked in statically.
29 int eap_register_methods(void)
31 int ret = 0;
33 #ifdef EAP_MD5
34 if (ret == 0)
35 ret = eap_peer_md5_register();
36 #endif /* EAP_MD5 */
38 #ifdef EAP_TLS
39 if (ret == 0)
40 ret = eap_peer_tls_register();
41 #endif /* EAP_TLS */
43 #ifdef EAP_MSCHAPv2
44 if (ret == 0)
45 ret = eap_peer_mschapv2_register();
46 #endif /* EAP_MSCHAPv2 */
48 #ifdef EAP_PEAP
49 if (ret == 0)
50 ret = eap_peer_peap_register();
51 #endif /* EAP_PEAP */
53 #ifdef EAP_TTLS
54 if (ret == 0)
55 ret = eap_peer_ttls_register();
56 #endif /* EAP_TTLS */
58 #ifdef EAP_GTC
59 if (ret == 0)
60 ret = eap_peer_gtc_register();
61 #endif /* EAP_GTC */
63 #ifdef EAP_OTP
64 if (ret == 0)
65 ret = eap_peer_otp_register();
66 #endif /* EAP_OTP */
68 #ifdef EAP_SIM
69 if (ret == 0)
70 ret = eap_peer_sim_register();
71 #endif /* EAP_SIM */
73 #ifdef EAP_LEAP
74 if (ret == 0)
75 ret = eap_peer_leap_register();
76 #endif /* EAP_LEAP */
78 #ifdef EAP_PSK
79 if (ret == 0)
80 ret = eap_peer_psk_register();
81 #endif /* EAP_PSK */
83 #ifdef EAP_AKA
84 if (ret == 0)
85 ret = eap_peer_aka_register();
86 #endif /* EAP_AKA */
88 #ifdef EAP_AKA_PRIME
89 if (ret == 0)
90 ret = eap_peer_aka_prime_register();
91 #endif /* EAP_AKA_PRIME */
93 #ifdef EAP_FAST
94 if (ret == 0)
95 ret = eap_peer_fast_register();
96 #endif /* EAP_FAST */
98 #ifdef EAP_PAX
99 if (ret == 0)
100 ret = eap_peer_pax_register();
101 #endif /* EAP_PAX */
103 #ifdef EAP_SAKE
104 if (ret == 0)
105 ret = eap_peer_sake_register();
106 #endif /* EAP_SAKE */
108 #ifdef EAP_GPSK
109 if (ret == 0)
110 ret = eap_peer_gpsk_register();
111 #endif /* EAP_GPSK */
113 #ifdef EAP_WSC
114 if (ret == 0)
115 ret = eap_peer_wsc_register();
116 #endif /* EAP_WSC */
118 #ifdef EAP_IKEV2
119 if (ret == 0)
120 ret = eap_peer_ikev2_register();
121 #endif /* EAP_IKEV2 */
123 #ifdef EAP_VENDOR_TEST
124 if (ret == 0)
125 ret = eap_peer_vendor_test_register();
126 #endif /* EAP_VENDOR_TEST */
128 #ifdef EAP_TNC
129 if (ret == 0)
130 ret = eap_peer_tnc_register();
131 #endif /* EAP_TNC */
134 #ifdef EAP_SERVER_IDENTITY
135 if (ret == 0)
136 ret = eap_server_identity_register();
137 #endif /* EAP_SERVER_IDENTITY */
139 #ifdef EAP_SERVER_MD5
140 if (ret == 0)
141 ret = eap_server_md5_register();
142 #endif /* EAP_SERVER_MD5 */
144 #ifdef EAP_SERVER_TLS
145 if (ret == 0)
146 ret = eap_server_tls_register();
147 #endif /* EAP_SERVER_TLS */
149 #ifdef EAP_SERVER_MSCHAPV2
150 if (ret == 0)
151 ret = eap_server_mschapv2_register();
152 #endif /* EAP_SERVER_MSCHAPV2 */
154 #ifdef EAP_SERVER_PEAP
155 if (ret == 0)
156 ret = eap_server_peap_register();
157 #endif /* EAP_SERVER_PEAP */
159 #ifdef EAP_SERVER_TLV
160 if (ret == 0)
161 ret = eap_server_tlv_register();
162 #endif /* EAP_SERVER_TLV */
164 #ifdef EAP_SERVER_GTC
165 if (ret == 0)
166 ret = eap_server_gtc_register();
167 #endif /* EAP_SERVER_GTC */
169 #ifdef EAP_SERVER_TTLS
170 if (ret == 0)
171 ret = eap_server_ttls_register();
172 #endif /* EAP_SERVER_TTLS */
174 #ifdef EAP_SERVER_SIM
175 if (ret == 0)
176 ret = eap_server_sim_register();
177 #endif /* EAP_SERVER_SIM */
179 #ifdef EAP_SERVER_AKA
180 if (ret == 0)
181 ret = eap_server_aka_register();
182 #endif /* EAP_SERVER_AKA */
184 #ifdef EAP_SERVER_AKA_PRIME
185 if (ret == 0)
186 ret = eap_server_aka_prime_register();
187 #endif /* EAP_SERVER_AKA_PRIME */
189 #ifdef EAP_SERVER_PAX
190 if (ret == 0)
191 ret = eap_server_pax_register();
192 #endif /* EAP_SERVER_PAX */
194 #ifdef EAP_SERVER_PSK
195 if (ret == 0)
196 ret = eap_server_psk_register();
197 #endif /* EAP_SERVER_PSK */
199 #ifdef EAP_SERVER_SAKE
200 if (ret == 0)
201 ret = eap_server_sake_register();
202 #endif /* EAP_SERVER_SAKE */
204 #ifdef EAP_SERVER_GPSK
205 if (ret == 0)
206 ret = eap_server_gpsk_register();
207 #endif /* EAP_SERVER_GPSK */
209 #ifdef EAP_SERVER_VENDOR_TEST
210 if (ret == 0)
211 ret = eap_server_vendor_test_register();
212 #endif /* EAP_SERVER_VENDOR_TEST */
214 #ifdef EAP_SERVER_FAST
215 if (ret == 0)
216 ret = eap_server_fast_register();
217 #endif /* EAP_SERVER_FAST */
219 #ifdef EAP_SERVER_WSC
220 if (ret == 0)
221 ret = eap_server_wsc_register();
222 #endif /* EAP_SERVER_WSC */
224 #ifdef EAP_SERVER_IKEV2
225 if (ret == 0)
226 ret = eap_server_ikev2_register();
227 #endif /* EAP_SERVER_IKEV2 */
229 #ifdef EAP_SERVER_TNC
230 if (ret == 0)
231 ret = eap_server_tnc_register();
232 #endif /* EAP_SERVER_TNC */
234 return ret;