eap_register.c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. #include "includes.h"
  9. #include "common.h"
  10. #include "eap_peer/eap_methods.h"
  11. #include "eap_server/eap_methods.h"
  12. #include "wpa_supplicant_i.h"
  13. /**
  14. * eap_register_methods - Register statically linked EAP methods
  15. * Returns: 0 on success, -1 or -2 on failure
  16. *
  17. * This function is called at program initialization to register all EAP
  18. * methods that were linked in statically.
  19. */
  20. int eap_register_methods(void)
  21. {
  22. int ret = 0;
  23. #ifdef EAP_MD5
  24. if (ret == 0)
  25. ret = eap_peer_md5_register();
  26. #endif /* EAP_MD5 */
  27. #ifdef EAP_TLS
  28. if (ret == 0)
  29. ret = eap_peer_tls_register();
  30. #endif /* EAP_TLS */
  31. #ifdef EAP_UNAUTH_TLS
  32. if (ret == 0)
  33. ret = eap_peer_unauth_tls_register();
  34. #endif /* EAP_UNAUTH_TLS */
  35. #ifdef EAP_MSCHAPv2
  36. if (ret == 0)
  37. ret = eap_peer_mschapv2_register();
  38. #endif /* EAP_MSCHAPv2 */
  39. #ifdef EAP_PEAP
  40. if (ret == 0)
  41. ret = eap_peer_peap_register();
  42. #endif /* EAP_PEAP */
  43. #ifdef EAP_TTLS
  44. if (ret == 0)
  45. ret = eap_peer_ttls_register();
  46. #endif /* EAP_TTLS */
  47. #ifdef EAP_GTC
  48. if (ret == 0)
  49. ret = eap_peer_gtc_register();
  50. #endif /* EAP_GTC */
  51. #ifdef EAP_OTP
  52. if (ret == 0)
  53. ret = eap_peer_otp_register();
  54. #endif /* EAP_OTP */
  55. #ifdef EAP_SIM
  56. if (ret == 0)
  57. ret = eap_peer_sim_register();
  58. #endif /* EAP_SIM */
  59. #ifdef EAP_LEAP
  60. if (ret == 0)
  61. ret = eap_peer_leap_register();
  62. #endif /* EAP_LEAP */
  63. #ifdef EAP_PSK
  64. if (ret == 0)
  65. ret = eap_peer_psk_register();
  66. #endif /* EAP_PSK */
  67. #ifdef EAP_AKA
  68. if (ret == 0)
  69. ret = eap_peer_aka_register();
  70. #endif /* EAP_AKA */
  71. #ifdef EAP_AKA_PRIME
  72. if (ret == 0)
  73. ret = eap_peer_aka_prime_register();
  74. #endif /* EAP_AKA_PRIME */
  75. #ifdef EAP_FAST
  76. if (ret == 0)
  77. ret = eap_peer_fast_register();
  78. #endif /* EAP_FAST */
  79. #ifdef EAP_PAX
  80. if (ret == 0)
  81. ret = eap_peer_pax_register();
  82. #endif /* EAP_PAX */
  83. #ifdef EAP_SAKE
  84. if (ret == 0)
  85. ret = eap_peer_sake_register();
  86. #endif /* EAP_SAKE */
  87. #ifdef EAP_GPSK
  88. if (ret == 0)
  89. ret = eap_peer_gpsk_register();
  90. #endif /* EAP_GPSK */
  91. #ifdef EAP_WSC
  92. if (ret == 0)
  93. ret = eap_peer_wsc_register();
  94. #endif /* EAP_WSC */
  95. #ifdef EAP_IKEV2
  96. if (ret == 0)
  97. ret = eap_peer_ikev2_register();
  98. #endif /* EAP_IKEV2 */
  99. #ifdef EAP_VENDOR_TEST
  100. if (ret == 0)
  101. ret = eap_peer_vendor_test_register();
  102. #endif /* EAP_VENDOR_TEST */
  103. #ifdef EAP_TNC
  104. if (ret == 0)
  105. ret = eap_peer_tnc_register();
  106. #endif /* EAP_TNC */
  107. #ifdef EAP_PWD
  108. if (ret == 0)
  109. ret = eap_peer_pwd_register();
  110. #endif /* EAP_PWD */
  111. #ifdef EAP_SERVER_IDENTITY
  112. if (ret == 0)
  113. ret = eap_server_identity_register();
  114. #endif /* EAP_SERVER_IDENTITY */
  115. #ifdef EAP_SERVER_MD5
  116. if (ret == 0)
  117. ret = eap_server_md5_register();
  118. #endif /* EAP_SERVER_MD5 */
  119. #ifdef EAP_SERVER_TLS
  120. if (ret == 0)
  121. ret = eap_server_tls_register();
  122. #endif /* EAP_SERVER_TLS */
  123. #ifdef EAP_SERVER_UNAUTH_TLS
  124. if (ret == 0)
  125. ret = eap_server_unauth_tls_register();
  126. #endif /* EAP_SERVER_UNAUTH_TLS */
  127. #ifdef EAP_SERVER_MSCHAPV2
  128. if (ret == 0)
  129. ret = eap_server_mschapv2_register();
  130. #endif /* EAP_SERVER_MSCHAPV2 */
  131. #ifdef EAP_SERVER_PEAP
  132. if (ret == 0)
  133. ret = eap_server_peap_register();
  134. #endif /* EAP_SERVER_PEAP */
  135. #ifdef EAP_SERVER_TLV
  136. if (ret == 0)
  137. ret = eap_server_tlv_register();
  138. #endif /* EAP_SERVER_TLV */
  139. #ifdef EAP_SERVER_GTC
  140. if (ret == 0)
  141. ret = eap_server_gtc_register();
  142. #endif /* EAP_SERVER_GTC */
  143. #ifdef EAP_SERVER_TTLS
  144. if (ret == 0)
  145. ret = eap_server_ttls_register();
  146. #endif /* EAP_SERVER_TTLS */
  147. #ifdef EAP_SERVER_SIM
  148. if (ret == 0)
  149. ret = eap_server_sim_register();
  150. #endif /* EAP_SERVER_SIM */
  151. #ifdef EAP_SERVER_AKA
  152. if (ret == 0)
  153. ret = eap_server_aka_register();
  154. #endif /* EAP_SERVER_AKA */
  155. #ifdef EAP_SERVER_AKA_PRIME
  156. if (ret == 0)
  157. ret = eap_server_aka_prime_register();
  158. #endif /* EAP_SERVER_AKA_PRIME */
  159. #ifdef EAP_SERVER_PAX
  160. if (ret == 0)
  161. ret = eap_server_pax_register();
  162. #endif /* EAP_SERVER_PAX */
  163. #ifdef EAP_SERVER_PSK
  164. if (ret == 0)
  165. ret = eap_server_psk_register();
  166. #endif /* EAP_SERVER_PSK */
  167. #ifdef EAP_SERVER_SAKE
  168. if (ret == 0)
  169. ret = eap_server_sake_register();
  170. #endif /* EAP_SERVER_SAKE */
  171. #ifdef EAP_SERVER_GPSK
  172. if (ret == 0)
  173. ret = eap_server_gpsk_register();
  174. #endif /* EAP_SERVER_GPSK */
  175. #ifdef EAP_SERVER_VENDOR_TEST
  176. if (ret == 0)
  177. ret = eap_server_vendor_test_register();
  178. #endif /* EAP_SERVER_VENDOR_TEST */
  179. #ifdef EAP_SERVER_FAST
  180. if (ret == 0)
  181. ret = eap_server_fast_register();
  182. #endif /* EAP_SERVER_FAST */
  183. #ifdef EAP_SERVER_WSC
  184. if (ret == 0)
  185. ret = eap_server_wsc_register();
  186. #endif /* EAP_SERVER_WSC */
  187. #ifdef EAP_SERVER_IKEV2
  188. if (ret == 0)
  189. ret = eap_server_ikev2_register();
  190. #endif /* EAP_SERVER_IKEV2 */
  191. #ifdef EAP_SERVER_TNC
  192. if (ret == 0)
  193. ret = eap_server_tnc_register();
  194. #endif /* EAP_SERVER_TNC */
  195. #ifdef EAP_SERVER_PWD
  196. if (ret == 0)
  197. ret = eap_server_pwd_register();
  198. #endif /* EAP_SERVER_PWD */
  199. return ret;
  200. }