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