eap_register.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * EAP method registration
  3. * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #include "includes.h"
  15. #include "common.h"
  16. #include "eap_server/eap_methods.h"
  17. #include "eap_register.h"
  18. /**
  19. * eap_server_register_methods - Register statically linked EAP server methods
  20. * Returns: 0 on success, -1 or -2 on failure
  21. *
  22. * This function is called at program initialization to register all EAP
  23. * methods that were linked in statically.
  24. */
  25. int eap_server_register_methods(void)
  26. {
  27. int ret = 0;
  28. #ifdef EAP_SERVER_IDENTITY
  29. if (ret == 0)
  30. ret = eap_server_identity_register();
  31. #endif /* EAP_SERVER_IDENTITY */
  32. #ifdef EAP_SERVER_MD5
  33. if (ret == 0)
  34. ret = eap_server_md5_register();
  35. #endif /* EAP_SERVER_MD5 */
  36. #ifdef EAP_SERVER_TLS
  37. if (ret == 0)
  38. ret = eap_server_tls_register();
  39. #endif /* EAP_SERVER_TLS */
  40. #ifdef EAP_SERVER_MSCHAPV2
  41. if (ret == 0)
  42. ret = eap_server_mschapv2_register();
  43. #endif /* EAP_SERVER_MSCHAPV2 */
  44. #ifdef EAP_SERVER_PEAP
  45. if (ret == 0)
  46. ret = eap_server_peap_register();
  47. #endif /* EAP_SERVER_PEAP */
  48. #ifdef EAP_SERVER_TLV
  49. if (ret == 0)
  50. ret = eap_server_tlv_register();
  51. #endif /* EAP_SERVER_TLV */
  52. #ifdef EAP_SERVER_GTC
  53. if (ret == 0)
  54. ret = eap_server_gtc_register();
  55. #endif /* EAP_SERVER_GTC */
  56. #ifdef EAP_SERVER_TTLS
  57. if (ret == 0)
  58. ret = eap_server_ttls_register();
  59. #endif /* EAP_SERVER_TTLS */
  60. #ifdef EAP_SERVER_SIM
  61. if (ret == 0)
  62. ret = eap_server_sim_register();
  63. #endif /* EAP_SERVER_SIM */
  64. #ifdef EAP_SERVER_AKA
  65. if (ret == 0)
  66. ret = eap_server_aka_register();
  67. #endif /* EAP_SERVER_AKA */
  68. #ifdef EAP_SERVER_AKA_PRIME
  69. if (ret == 0)
  70. ret = eap_server_aka_prime_register();
  71. #endif /* EAP_SERVER_AKA_PRIME */
  72. #ifdef EAP_SERVER_PAX
  73. if (ret == 0)
  74. ret = eap_server_pax_register();
  75. #endif /* EAP_SERVER_PAX */
  76. #ifdef EAP_SERVER_PSK
  77. if (ret == 0)
  78. ret = eap_server_psk_register();
  79. #endif /* EAP_SERVER_PSK */
  80. #ifdef EAP_SERVER_SAKE
  81. if (ret == 0)
  82. ret = eap_server_sake_register();
  83. #endif /* EAP_SERVER_SAKE */
  84. #ifdef EAP_SERVER_GPSK
  85. if (ret == 0)
  86. ret = eap_server_gpsk_register();
  87. #endif /* EAP_SERVER_GPSK */
  88. #ifdef EAP_SERVER_VENDOR_TEST
  89. if (ret == 0)
  90. ret = eap_server_vendor_test_register();
  91. #endif /* EAP_SERVER_VENDOR_TEST */
  92. #ifdef EAP_SERVER_FAST
  93. if (ret == 0)
  94. ret = eap_server_fast_register();
  95. #endif /* EAP_SERVER_FAST */
  96. #ifdef EAP_SERVER_WSC
  97. if (ret == 0)
  98. ret = eap_server_wsc_register();
  99. #endif /* EAP_SERVER_WSC */
  100. #ifdef EAP_SERVER_IKEV2
  101. if (ret == 0)
  102. ret = eap_server_ikev2_register();
  103. #endif /* EAP_SERVER_IKEV2 */
  104. #ifdef EAP_SERVER_TNC
  105. if (ret == 0)
  106. ret = eap_server_tnc_register();
  107. #endif /* EAP_SERVER_TNC */
  108. return ret;
  109. }