eap_register.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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_server/eap_methods.h"
  11. #include "eap_register.h"
  12. /**
  13. * eap_server_register_methods - Register statically linked EAP server methods
  14. * Returns: 0 on success, -1 or -2 on failure
  15. *
  16. * This function is called at program initialization to register all EAP
  17. * methods that were linked in statically.
  18. */
  19. int eap_server_register_methods(void)
  20. {
  21. int ret = 0;
  22. #ifdef EAP_SERVER_IDENTITY
  23. if (ret == 0)
  24. ret = eap_server_identity_register();
  25. #endif /* EAP_SERVER_IDENTITY */
  26. #ifdef EAP_SERVER_MD5
  27. if (ret == 0)
  28. ret = eap_server_md5_register();
  29. #endif /* EAP_SERVER_MD5 */
  30. #ifdef EAP_SERVER_TLS
  31. if (ret == 0)
  32. ret = eap_server_tls_register();
  33. #endif /* EAP_SERVER_TLS */
  34. #ifdef EAP_SERVER_UNAUTH_TLS
  35. if (ret == 0)
  36. ret = eap_server_unauth_tls_register();
  37. #endif /* EAP_SERVER_TLS */
  38. #ifdef EAP_SERVER_TLS
  39. #ifdef CONFIG_HS20
  40. if (ret == 0)
  41. ret = eap_server_wfa_unauth_tls_register();
  42. #endif /* CONFIG_HS20 */
  43. #endif /* EAP_SERVER_TLS */
  44. #ifdef EAP_SERVER_MSCHAPV2
  45. if (ret == 0)
  46. ret = eap_server_mschapv2_register();
  47. #endif /* EAP_SERVER_MSCHAPV2 */
  48. #ifdef EAP_SERVER_PEAP
  49. if (ret == 0)
  50. ret = eap_server_peap_register();
  51. #endif /* EAP_SERVER_PEAP */
  52. #ifdef EAP_SERVER_TLV
  53. if (ret == 0)
  54. ret = eap_server_tlv_register();
  55. #endif /* EAP_SERVER_TLV */
  56. #ifdef EAP_SERVER_GTC
  57. if (ret == 0)
  58. ret = eap_server_gtc_register();
  59. #endif /* EAP_SERVER_GTC */
  60. #ifdef EAP_SERVER_TTLS
  61. if (ret == 0)
  62. ret = eap_server_ttls_register();
  63. #endif /* EAP_SERVER_TTLS */
  64. #ifdef EAP_SERVER_SIM
  65. if (ret == 0)
  66. ret = eap_server_sim_register();
  67. #endif /* EAP_SERVER_SIM */
  68. #ifdef EAP_SERVER_AKA
  69. if (ret == 0)
  70. ret = eap_server_aka_register();
  71. #endif /* EAP_SERVER_AKA */
  72. #ifdef EAP_SERVER_AKA_PRIME
  73. if (ret == 0)
  74. ret = eap_server_aka_prime_register();
  75. #endif /* EAP_SERVER_AKA_PRIME */
  76. #ifdef EAP_SERVER_PAX
  77. if (ret == 0)
  78. ret = eap_server_pax_register();
  79. #endif /* EAP_SERVER_PAX */
  80. #ifdef EAP_SERVER_PSK
  81. if (ret == 0)
  82. ret = eap_server_psk_register();
  83. #endif /* EAP_SERVER_PSK */
  84. #ifdef EAP_SERVER_SAKE
  85. if (ret == 0)
  86. ret = eap_server_sake_register();
  87. #endif /* EAP_SERVER_SAKE */
  88. #ifdef EAP_SERVER_GPSK
  89. if (ret == 0)
  90. ret = eap_server_gpsk_register();
  91. #endif /* EAP_SERVER_GPSK */
  92. #ifdef EAP_SERVER_VENDOR_TEST
  93. if (ret == 0)
  94. ret = eap_server_vendor_test_register();
  95. #endif /* EAP_SERVER_VENDOR_TEST */
  96. #ifdef EAP_SERVER_FAST
  97. if (ret == 0)
  98. ret = eap_server_fast_register();
  99. #endif /* EAP_SERVER_FAST */
  100. #ifdef EAP_SERVER_WSC
  101. if (ret == 0)
  102. ret = eap_server_wsc_register();
  103. #endif /* EAP_SERVER_WSC */
  104. #ifdef EAP_SERVER_IKEV2
  105. if (ret == 0)
  106. ret = eap_server_ikev2_register();
  107. #endif /* EAP_SERVER_IKEV2 */
  108. #ifdef EAP_SERVER_TNC
  109. if (ret == 0)
  110. ret = eap_server_tnc_register();
  111. #endif /* EAP_SERVER_TNC */
  112. #ifdef EAP_SERVER_PWD
  113. if (ret == 0)
  114. ret = eap_server_pwd_register();
  115. #endif /* EAP_SERVER_PWD */
  116. #ifdef EAP_SERVER_EKE
  117. if (ret == 0)
  118. ret = eap_server_eke_register();
  119. #endif /* EAP_SERVER_EKE */
  120. return ret;
  121. }