eap_register.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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_MSCHAPV2
  39. if (ret == 0)
  40. ret = eap_server_mschapv2_register();
  41. #endif /* EAP_SERVER_MSCHAPV2 */
  42. #ifdef EAP_SERVER_PEAP
  43. if (ret == 0)
  44. ret = eap_server_peap_register();
  45. #endif /* EAP_SERVER_PEAP */
  46. #ifdef EAP_SERVER_TLV
  47. if (ret == 0)
  48. ret = eap_server_tlv_register();
  49. #endif /* EAP_SERVER_TLV */
  50. #ifdef EAP_SERVER_GTC
  51. if (ret == 0)
  52. ret = eap_server_gtc_register();
  53. #endif /* EAP_SERVER_GTC */
  54. #ifdef EAP_SERVER_TTLS
  55. if (ret == 0)
  56. ret = eap_server_ttls_register();
  57. #endif /* EAP_SERVER_TTLS */
  58. #ifdef EAP_SERVER_SIM
  59. if (ret == 0)
  60. ret = eap_server_sim_register();
  61. #endif /* EAP_SERVER_SIM */
  62. #ifdef EAP_SERVER_AKA
  63. if (ret == 0)
  64. ret = eap_server_aka_register();
  65. #endif /* EAP_SERVER_AKA */
  66. #ifdef EAP_SERVER_AKA_PRIME
  67. if (ret == 0)
  68. ret = eap_server_aka_prime_register();
  69. #endif /* EAP_SERVER_AKA_PRIME */
  70. #ifdef EAP_SERVER_PAX
  71. if (ret == 0)
  72. ret = eap_server_pax_register();
  73. #endif /* EAP_SERVER_PAX */
  74. #ifdef EAP_SERVER_PSK
  75. if (ret == 0)
  76. ret = eap_server_psk_register();
  77. #endif /* EAP_SERVER_PSK */
  78. #ifdef EAP_SERVER_SAKE
  79. if (ret == 0)
  80. ret = eap_server_sake_register();
  81. #endif /* EAP_SERVER_SAKE */
  82. #ifdef EAP_SERVER_GPSK
  83. if (ret == 0)
  84. ret = eap_server_gpsk_register();
  85. #endif /* EAP_SERVER_GPSK */
  86. #ifdef EAP_SERVER_VENDOR_TEST
  87. if (ret == 0)
  88. ret = eap_server_vendor_test_register();
  89. #endif /* EAP_SERVER_VENDOR_TEST */
  90. #ifdef EAP_SERVER_FAST
  91. if (ret == 0)
  92. ret = eap_server_fast_register();
  93. #endif /* EAP_SERVER_FAST */
  94. #ifdef EAP_SERVER_WSC
  95. if (ret == 0)
  96. ret = eap_server_wsc_register();
  97. #endif /* EAP_SERVER_WSC */
  98. #ifdef EAP_SERVER_IKEV2
  99. if (ret == 0)
  100. ret = eap_server_ikev2_register();
  101. #endif /* EAP_SERVER_IKEV2 */
  102. #ifdef EAP_SERVER_TNC
  103. if (ret == 0)
  104. ret = eap_server_tnc_register();
  105. #endif /* EAP_SERVER_TNC */
  106. #ifdef EAP_SERVER_PWD
  107. if (ret == 0)
  108. ret = eap_server_pwd_register();
  109. #endif /* EAP_SERVER_PWD */
  110. #ifdef EAP_SERVER_EKE
  111. if (ret == 0)
  112. ret = eap_server_eke_register();
  113. #endif /* EAP_SERVER_EKE */
  114. return ret;
  115. }