apr_ldap.h.in 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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 @apu_has_ldap@
  32. /* identify the LDAP toolkit used */
  33. #define APR_HAS_NETSCAPE_LDAPSDK @apu_has_ldap_netscape@
  34. #define APR_HAS_SOLARIS_LDAPSDK @apu_has_ldap_solaris@
  35. #define APR_HAS_NOVELL_LDAPSDK @apu_has_ldap_novell@
  36. #define APR_HAS_MOZILLA_LDAPSDK @apu_has_ldap_mozilla@
  37. #define APR_HAS_OPENLDAP_LDAPSDK @apu_has_ldap_openldap@
  38. #define APR_HAS_MICROSOFT_LDAPSDK @apu_has_ldap_microsoft@
  39. #define APR_HAS_TIVOLI_LDAPSDK @apu_has_ldap_tivoli@
  40. #define APR_HAS_ZOS_LDAPSDK @apu_has_ldap_zos@
  41. #define APR_HAS_OTHER_LDAPSDK @apu_has_ldap_other@
  42. /*
  43. * Handle the case when LDAP is enabled
  44. */
  45. #if APR_HAS_LDAP
  46. /*
  47. * The following #defines are DEPRECATED and should not be used for
  48. * anything. They remain to maintain binary compatibility.
  49. * The original code defined the OPENLDAP SDK as present regardless
  50. * of what really was there, which was way bogus. In addition, the
  51. * apr_ldap_url_parse*() functions have been rewritten specifically for
  52. * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero.
  53. */
  54. #if APR_HAS_TIVOLI_LDAPSDK
  55. #define APR_HAS_LDAP_SSL 0
  56. #else
  57. #define APR_HAS_LDAP_SSL 1
  58. #endif
  59. #define APR_HAS_LDAP_URL_PARSE 0
  60. #if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED)
  61. /* Ensure that the "deprecated" interfaces are still exposed
  62. * with OpenLDAP >= 2.3; these were exposed by default in earlier
  63. * releases. */
  64. #define LDAP_DEPRECATED 1
  65. #endif
  66. /*
  67. * Include the standard LDAP header files.
  68. */
  69. @lber_h@
  70. @ldap_h@
  71. @ldap_ssl_h@
  72. /*
  73. * Detected standard functions
  74. */
  75. #define APR_HAS_LDAPSSL_CLIENT_INIT @apu_has_ldapssl_client_init@
  76. #define APR_HAS_LDAPSSL_CLIENT_DEINIT @apu_has_ldapssl_client_deinit@
  77. #define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT @apu_has_ldapssl_add_trusted_cert@
  78. #define APR_HAS_LDAP_START_TLS_S @apu_has_ldap_start_tls_s@
  79. #define APR_HAS_LDAP_SSLINIT @apu_has_ldap_sslinit@
  80. #define APR_HAS_LDAPSSL_INIT @apu_has_ldapssl_init@
  81. #define APR_HAS_LDAPSSL_INSTALL_ROUTINES @apu_has_ldapssl_install_routines@
  82. /*
  83. * Make sure the secure LDAP port is defined
  84. */
  85. #ifndef LDAPS_PORT
  86. #define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */
  87. #endif
  88. /*
  89. * For ldap function calls that input a size limit on the number of returned elements
  90. * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0)
  91. * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK
  92. * or process is configured for.
  93. */
  94. #ifdef LDAP_DEFAULT_LIMIT
  95. #define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT
  96. #else
  97. #ifdef LDAP_NO_LIMIT
  98. #define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT
  99. #endif
  100. #endif
  101. #ifndef APR_LDAP_SIZELIMIT
  102. #define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */
  103. #endif
  104. /*
  105. * z/OS is missing some defines
  106. */
  107. #ifndef LDAP_VERSION_MAX
  108. #define LDAP_VERSION_MAX LDAP_VERSION
  109. #endif
  110. #if APR_HAS_ZOS_LDAPSDK
  111. #define LDAP_VENDOR_NAME "IBM z/OS"
  112. #endif
  113. /* Note: Macros defining const casting has been removed in APR v1.0,
  114. * pending real support for LDAP v2.0 toolkits.
  115. *
  116. * In the mean time, please use an LDAP v3.0 toolkit.
  117. */
  118. #if LDAP_VERSION_MAX <= 2
  119. #error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
  120. #endif
  121. #ifdef __cplusplus
  122. extern "C" {
  123. #endif /* __cplusplus */
  124. /**
  125. * This structure allows the C LDAP API error codes to be returned
  126. * along with plain text error messages that explain to us mere mortals
  127. * what really happened.
  128. */
  129. typedef struct apr_ldap_err_t {
  130. const char *reason;
  131. const char *msg;
  132. int rc;
  133. } apr_ldap_err_t;
  134. #ifdef __cplusplus
  135. }
  136. #endif
  137. /* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection
  138. * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone
  139. * manually chooses another SDK on Windows
  140. */
  141. #if APR_HAS_MICROSOFT_LDAPSDK
  142. #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \
  143. || (s) == LDAP_UNAVAILABLE)
  144. #else
  145. #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN)
  146. #endif
  147. /* These symbols are not actually exported in a DSO build, but mapped into
  148. * a private exported function array for apr_ldap_stub to bind dynamically.
  149. * Rename them appropriately to protect the global namespace.
  150. */
  151. #ifdef APU_DSO_LDAP_BUILD
  152. #define apr_ldap_info apr__ldap_info
  153. #define apr_ldap_init apr__ldap_init
  154. #define apr_ldap_ssl_init apr__ldap_ssl_init
  155. #define apr_ldap_ssl_deinit apr__ldap_ssl_deinit
  156. #define apr_ldap_get_option apr__ldap_get_option
  157. #define apr_ldap_set_option apr__ldap_set_option
  158. #define apr_ldap_rebind_init apr__ldap_rebind_init
  159. #define apr_ldap_rebind_add apr__ldap_rebind_add
  160. #define apr_ldap_rebind_remove apr__ldap_rebind_remove
  161. #define APU_DECLARE_LDAP(type) type
  162. #else
  163. #define APU_DECLARE_LDAP(type) APU_DECLARE(type)
  164. #endif
  165. #include "apr_ldap_url.h"
  166. #include "apr_ldap_init.h"
  167. #include "apr_ldap_option.h"
  168. #include "apr_ldap_rebind.h"
  169. #endif /* APR_HAS_LDAP */
  170. /** @} */
  171. #endif /* APU_LDAP_H */