apr_ldap.hnw 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*
  17. * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h
  18. */
  19. /**
  20. * @file apr_ldap.h
  21. * @brief APR-UTIL LDAP
  22. */
  23. #ifndef APU_LDAP_H
  24. #define APU_LDAP_H
  25. /**
  26. * @defgroup APR_Util_LDAP LDAP
  27. * @ingroup APR_Util
  28. * @{
  29. */
  30. /* this will be defined if LDAP support was compiled into apr-util */
  31. #define APR_HAS_LDAP 1
  32. /* identify the LDAP toolkit used */
  33. #define APR_HAS_NETSCAPE_LDAPSDK 0
  34. #define APR_HAS_SOLARIS_LDAPSDK 0
  35. #define APR_HAS_NOVELL_LDAPSDK 1
  36. #define APR_HAS_MOZILLA_LDAPSDK 0
  37. #define APR_HAS_OPENLDAP_LDAPSDK 0
  38. #define APR_HAS_MICROSOFT_LDAPSDK 0
  39. #define APR_HAS_OTHER_LDAPSDK 0
  40. /*
  41. * Handle the case when LDAP is enabled
  42. */
  43. #if APR_HAS_LDAP
  44. /*
  45. * The following #defines are DEPRECATED and should not be used for
  46. * anything. They remain to maintain binary compatibility.
  47. * The original code defined the OPENLDAP SDK as present regardless
  48. * of what really was there, which was way bogus. In addition, the
  49. * apr_ldap_url_parse*() functions have been rewritten specifically for
  50. * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero.
  51. */
  52. #define APR_HAS_LDAP_SSL 1
  53. #define APR_HAS_LDAP_URL_PARSE 0
  54. /*
  55. * Include the standard LDAP header files.
  56. */
  57. #ifdef GENEXPORTS
  58. #define LDAP_VERSION_MAX 3
  59. #define LDAP_INSUFFICIENT_ACCESS
  60. #else
  61. #include <lber.h>
  62. #include <ldap.h>
  63. #if APR_HAS_LDAP_SSL
  64. #include <ldap_ssl.h>
  65. #endif
  66. #endif
  67. /*
  68. * Detected standard functions
  69. */
  70. #define APR_HAS_LDAPSSL_CLIENT_INIT 1
  71. #define APR_HAS_LDAPSSL_CLIENT_DEINIT 1
  72. #define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 1
  73. #define APR_HAS_LDAP_START_TLS_S 0
  74. #define APR_HAS_LDAP_SSLINIT 0
  75. #define APR_HAS_LDAPSSL_INIT 1
  76. #define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0
  77. /*
  78. * Make sure the secure LDAP port is defined
  79. */
  80. #ifndef LDAPS_PORT
  81. #define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */
  82. #endif
  83. /* Note: Macros defining const casting has been removed in APR v1.0,
  84. * pending real support for LDAP v2.0 toolkits.
  85. *
  86. * In the mean time, please use an LDAP v3.0 toolkit.
  87. */
  88. #if LDAP_VERSION_MAX <= 2
  89. #error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
  90. #endif
  91. #ifdef __cplusplus
  92. extern "C" {
  93. #endif /* __cplusplus */
  94. /**
  95. * This structure allows the C LDAP API error codes to be returned
  96. * along with plain text error messages that explain to us mere mortals
  97. * what really happened.
  98. */
  99. typedef struct apr_ldap_err_t {
  100. const char *reason;
  101. const char *msg;
  102. int rc;
  103. } apr_ldap_err_t;
  104. #ifdef __cplusplus
  105. }
  106. #endif
  107. #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN)
  108. /* These symbols are not actually exported in a DSO build, but mapped into
  109. * a private exported function array for apr_ldap_stub to bind dynamically.
  110. * Rename them appropriately to protect the global namespace.
  111. */
  112. #ifdef APU_DSO_LDAP_BUILD
  113. #define apr_ldap_info apr__ldap_info
  114. #define apr_ldap_init apr__ldap_init
  115. #define apr_ldap_ssl_init apr__ldap_ssl_init
  116. #define apr_ldap_ssl_deinit apr__ldap_ssl_deinit
  117. #define apr_ldap_get_option apr__ldap_get_option
  118. #define apr_ldap_set_option apr__ldap_set_option
  119. #define apr_ldap_rebind_init apr__ldap_rebind_init
  120. #define apr_ldap_rebind_add apr__ldap_rebind_add
  121. #define apr_ldap_rebind_remove apr__ldap_rebind_remove
  122. #define APU_DECLARE_LDAP(type) type
  123. #else
  124. #define APU_DECLARE_LDAP(type) APU_DECLARE(type)
  125. #endif
  126. #include "apr_ldap_url.h"
  127. #include "apr_ldap_init.h"
  128. #include "apr_ldap_option.h"
  129. #include "apr_ldap_rebind.h"
  130. /** @} */
  131. #endif /* APR_HAS_LDAP */
  132. #endif /* APU_LDAP_H */