aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-06 09:28:41 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-06 09:28:41 (GMT)
commit127608152e55d16c57005b6f54e9f8ea18235c7a (patch)
tree3d7958a4a2e428a0b516c2b68b341130b0ef3c3f /src/eap_peer
parent2d106f21aa342e30710682c0ee5ecad211d11c2a (diff)
downloadhostap-127608152e55d16c57005b6f54e9f8ea18235c7a.zip
hostap-127608152e55d16c57005b6f54e9f8ea18235c7a.tar.gz
hostap-127608152e55d16c57005b6f54e9f8ea18235c7a.tar.bz2
Move EAP method registration away from src/eap_{peer,server}
This makes it easier to make a library out of EAP methods without losing possiblity of binary size optimization by linker dropping unreferenced code.
Diffstat (limited to 'src/eap_peer')
-rw-r--r--src/eap_peer/eap_methods.c155
-rw-r--r--src/eap_peer/eap_methods.h23
2 files changed, 22 insertions, 156 deletions
diff --git a/src/eap_peer/eap_methods.c b/src/eap_peer/eap_methods.c
index 2374e5e..3b0af05 100644
--- a/src/eap_peer/eap_methods.c
+++ b/src/eap_peer/eap_methods.c
@@ -340,161 +340,6 @@ int eap_peer_method_register(struct eap_method *method)
/**
- * eap_peer_register_methods - Register statically linked EAP peer methods
- * Returns: 0 on success, -1 on failure
- *
- * This function is called at program initialization to register all EAP peer
- * methods that were linked in statically.
- */
-int eap_peer_register_methods(void)
-{
- int ret = 0;
-
-#ifdef EAP_MD5
- if (ret == 0) {
- int eap_peer_md5_register(void);
- ret = eap_peer_md5_register();
- }
-#endif /* EAP_MD5 */
-
-#ifdef EAP_TLS
- if (ret == 0) {
- int eap_peer_tls_register(void);
- ret = eap_peer_tls_register();
- }
-#endif /* EAP_TLS */
-
-#ifdef EAP_MSCHAPv2
- if (ret == 0) {
- int eap_peer_mschapv2_register(void);
- ret = eap_peer_mschapv2_register();
- }
-#endif /* EAP_MSCHAPv2 */
-
-#ifdef EAP_PEAP
- if (ret == 0) {
- int eap_peer_peap_register(void);
- ret = eap_peer_peap_register();
- }
-#endif /* EAP_PEAP */
-
-#ifdef EAP_TTLS
- if (ret == 0) {
- int eap_peer_ttls_register(void);
- ret = eap_peer_ttls_register();
- }
-#endif /* EAP_TTLS */
-
-#ifdef EAP_GTC
- if (ret == 0) {
- int eap_peer_gtc_register(void);
- ret = eap_peer_gtc_register();
- }
-#endif /* EAP_GTC */
-
-#ifdef EAP_OTP
- if (ret == 0) {
- int eap_peer_otp_register(void);
- ret = eap_peer_otp_register();
- }
-#endif /* EAP_OTP */
-
-#ifdef EAP_SIM
- if (ret == 0) {
- int eap_peer_sim_register(void);
- ret = eap_peer_sim_register();
- }
-#endif /* EAP_SIM */
-
-#ifdef EAP_LEAP
- if (ret == 0) {
- int eap_peer_leap_register(void);
- ret = eap_peer_leap_register();
- }
-#endif /* EAP_LEAP */
-
-#ifdef EAP_PSK
- if (ret == 0) {
- int eap_peer_psk_register(void);
- ret = eap_peer_psk_register();
- }
-#endif /* EAP_PSK */
-
-#ifdef EAP_AKA
- if (ret == 0) {
- int eap_peer_aka_register(void);
- ret = eap_peer_aka_register();
- }
-#endif /* EAP_AKA */
-
-#ifdef EAP_AKA_PRIME
- if (ret == 0) {
- int eap_peer_aka_prime_register(void);
- ret = eap_peer_aka_prime_register();
- }
-#endif /* EAP_AKA_PRIME */
-
-#ifdef EAP_FAST
- if (ret == 0) {
- int eap_peer_fast_register(void);
- ret = eap_peer_fast_register();
- }
-#endif /* EAP_FAST */
-
-#ifdef EAP_PAX
- if (ret == 0) {
- int eap_peer_pax_register(void);
- ret = eap_peer_pax_register();
- }
-#endif /* EAP_PAX */
-
-#ifdef EAP_SAKE
- if (ret == 0) {
- int eap_peer_sake_register(void);
- ret = eap_peer_sake_register();
- }
-#endif /* EAP_SAKE */
-
-#ifdef EAP_GPSK
- if (ret == 0) {
- int eap_peer_gpsk_register(void);
- ret = eap_peer_gpsk_register();
- }
-#endif /* EAP_GPSK */
-
-#ifdef EAP_WSC
- if (ret == 0) {
- int eap_peer_wsc_register(void);
- ret = eap_peer_wsc_register();
- }
-#endif /* EAP_WSC */
-
-#ifdef EAP_IKEV2
- if (ret == 0) {
- int eap_peer_ikev2_register(void);
- ret = eap_peer_ikev2_register();
- }
-#endif /* EAP_IKEV2 */
-
-#ifdef EAP_VENDOR_TEST
- if (ret == 0) {
- int eap_peer_vendor_test_register(void);
- ret = eap_peer_vendor_test_register();
- }
-#endif /* EAP_VENDOR_TEST */
-
-#ifdef EAP_TNC
- if (ret == 0) {
- int eap_peer_tnc_register(void);
- ret = eap_peer_tnc_register();
- }
-#endif /* EAP_TNC */
-
- return ret;
-}
-
-
-/**
* eap_peer_unregister_methods - Unregister EAP peer methods
*
* This function is called at program termination to unregister all EAP peer
diff --git a/src/eap_peer/eap_methods.h b/src/eap_peer/eap_methods.h
index 9fd9b51..384c61b 100644
--- a/src/eap_peer/eap_methods.h
+++ b/src/eap_peer/eap_methods.h
@@ -32,7 +32,6 @@ EapType eap_peer_get_type(const char *name, int *vendor);
const char * eap_get_name(int vendor, EapType type);
size_t eap_get_names(char *buf, size_t buflen);
char ** eap_get_names_as_string_array(size_t *num);
-int eap_peer_register_methods(void);
void eap_peer_unregister_methods(void);
#else /* IEEE8021X_EAPOL */
@@ -89,4 +88,26 @@ static inline int eap_peer_method_unload(struct eap_method *method)
#endif /* CONFIG_DYNAMIC_EAP_METHODS */
+/* EAP peer method registration calls for statically linked in methods */
+int eap_peer_md5_register(void);
+int eap_peer_tls_register(void);
+int eap_peer_mschapv2_register(void);
+int eap_peer_peap_register(void);
+int eap_peer_ttls_register(void);
+int eap_peer_gtc_register(void);
+int eap_peer_otp_register(void);
+int eap_peer_sim_register(void);
+int eap_peer_leap_register(void);
+int eap_peer_psk_register(void);
+int eap_peer_aka_register(void);
+int eap_peer_aka_prime_register(void);
+int eap_peer_fast_register(void);
+int eap_peer_pax_register(void);
+int eap_peer_sake_register(void);
+int eap_peer_gpsk_register(void);
+int eap_peer_wsc_register(void);
+int eap_peer_ikev2_register(void);
+int eap_peer_vendor_test_register(void);
+int eap_peer_tnc_register(void);
+
#endif /* EAP_METHODS_H */