1/*
2 * EAP method registration
3 * Copyright (c) 2004-2009, Jouni Malinen <j@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 */
23int 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_MSCHAPV2
48	if (ret == 0)
49		ret = eap_server_mschapv2_register();
50#endif /* EAP_SERVER_MSCHAPV2 */
51
52#ifdef EAP_SERVER_PEAP
53	if (ret == 0)
54		ret = eap_server_peap_register();
55#endif /* EAP_SERVER_PEAP */
56
57#ifdef EAP_SERVER_TLV
58	if (ret == 0)
59		ret = eap_server_tlv_register();
60#endif /* EAP_SERVER_TLV */
61
62#ifdef EAP_SERVER_GTC
63	if (ret == 0)
64		ret = eap_server_gtc_register();
65#endif /* EAP_SERVER_GTC */
66
67#ifdef EAP_SERVER_TTLS
68	if (ret == 0)
69		ret = eap_server_ttls_register();
70#endif /* EAP_SERVER_TTLS */
71
72#ifdef EAP_SERVER_SIM
73	if (ret == 0)
74		ret = eap_server_sim_register();
75#endif /* EAP_SERVER_SIM */
76
77#ifdef EAP_SERVER_AKA
78	if (ret == 0)
79		ret = eap_server_aka_register();
80#endif /* EAP_SERVER_AKA */
81
82#ifdef EAP_SERVER_AKA_PRIME
83	if (ret == 0)
84		ret = eap_server_aka_prime_register();
85#endif /* EAP_SERVER_AKA_PRIME */
86
87#ifdef EAP_SERVER_PAX
88	if (ret == 0)
89		ret = eap_server_pax_register();
90#endif /* EAP_SERVER_PAX */
91
92#ifdef EAP_SERVER_PSK
93	if (ret == 0)
94		ret = eap_server_psk_register();
95#endif /* EAP_SERVER_PSK */
96
97#ifdef EAP_SERVER_SAKE
98	if (ret == 0)
99		ret = eap_server_sake_register();
100#endif /* EAP_SERVER_SAKE */
101
102#ifdef EAP_SERVER_GPSK
103	if (ret == 0)
104		ret = eap_server_gpsk_register();
105#endif /* EAP_SERVER_GPSK */
106
107#ifdef EAP_SERVER_VENDOR_TEST
108	if (ret == 0)
109		ret = eap_server_vendor_test_register();
110#endif /* EAP_SERVER_VENDOR_TEST */
111
112#ifdef EAP_SERVER_FAST
113	if (ret == 0)
114		ret = eap_server_fast_register();
115#endif /* EAP_SERVER_FAST */
116
117#ifdef EAP_SERVER_WSC
118	if (ret == 0)
119		ret = eap_server_wsc_register();
120#endif /* EAP_SERVER_WSC */
121
122#ifdef EAP_SERVER_IKEV2
123	if (ret == 0)
124		ret = eap_server_ikev2_register();
125#endif /* EAP_SERVER_IKEV2 */
126
127#ifdef EAP_SERVER_TNC
128	if (ret == 0)
129		ret = eap_server_tnc_register();
130#endif /* EAP_SERVER_TNC */
131
132#ifdef EAP_SERVER_PWD
133	if (ret == 0)
134		ret = eap_server_pwd_register();
135#endif /* EAP_SERVER_PWD */
136
137#ifdef EAP_SERVER_EKE
138	if (ret == 0)
139		ret = eap_server_eke_register();
140#endif /* EAP_SERVER_EKE */
141
142	return ret;
143}
144