2 /* Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h
23 * @brief APR-UTIL LDAP
29 * @defgroup APR_Util_LDAP LDAP
34 /* this will be defined if LDAP support was compiled into apr-util */
35 #define APR_HAS_LDAP 0
37 /* identify the LDAP toolkit used */
38 #define APR_HAS_NETSCAPE_LDAPSDK 0
39 #define APR_HAS_SOLARIS_LDAPSDK 0
40 #define APR_HAS_NOVELL_LDAPSDK 0
41 #define APR_HAS_MOZILLA_LDAPSDK 0
42 #define APR_HAS_OPENLDAP_LDAPSDK 0
43 #define APR_HAS_MICROSOFT_LDAPSDK 0
44 #define APR_HAS_TIVOLI_LDAPSDK 0
45 #define APR_HAS_ZOS_LDAPSDK 0
46 #define APR_HAS_OTHER_LDAPSDK 0
50 * Handle the case when LDAP is enabled
55 * The following #defines are DEPRECATED and should not be used for
56 * anything. They remain to maintain binary compatibility.
57 * The original code defined the OPENLDAP SDK as present regardless
58 * of what really was there, which was way bogus. In addition, the
59 * apr_ldap_url_parse*() functions have been rewritten specifically for
60 * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero.
62 #if APR_HAS_TIVOLI_LDAPSDK
63 #define APR_HAS_LDAP_SSL 0
65 #define APR_HAS_LDAP_SSL 1
67 #define APR_HAS_LDAP_URL_PARSE 0
69 #if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED)
70 /* Ensure that the "deprecated" interfaces are still exposed
71 * with OpenLDAP >= 2.3; these were exposed by default in earlier
73 #define LDAP_DEPRECATED 1
77 * Include the standard LDAP header files.
86 * Detected standard functions
88 #define APR_HAS_LDAPSSL_CLIENT_INIT 0
89 #define APR_HAS_LDAPSSL_CLIENT_DEINIT 0
90 #define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 0
91 #define APR_HAS_LDAP_START_TLS_S 0
92 #define APR_HAS_LDAP_SSLINIT 0
93 #define APR_HAS_LDAPSSL_INIT 0
94 #define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0
97 * Make sure the secure LDAP port is defined
100 #define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */
104 * For ldap function calls that input a size limit on the number of returned elements
105 * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0)
106 * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK
107 * or process is configured for.
109 #ifdef LDAP_DEFAULT_LIMIT
110 #define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT
113 #define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT
117 #ifndef APR_LDAP_SIZELIMIT
118 #define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */
122 * z/OS is missing some defines
124 #ifndef LDAP_VERSION_MAX
125 #define LDAP_VERSION_MAX LDAP_VERSION
127 #if APR_HAS_ZOS_LDAPSDK
128 #define LDAP_VENDOR_NAME "IBM z/OS"
131 /* Note: Macros defining const casting has been removed in APR v1.0,
132 * pending real support for LDAP v2.0 toolkits.
134 * In the mean time, please use an LDAP v3.0 toolkit.
136 #if LDAP_VERSION_MAX <= 2
137 #error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
142 #endif /* __cplusplus */
145 * This structure allows the C LDAP API error codes to be returned
146 * along with plain text error messages that explain to us mere mortals
147 * what really happened.
149 typedef struct apr_ldap_err_t {
159 /* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection
160 * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone
161 * manually chooses another SDK on Windows
163 #if APR_HAS_MICROSOFT_LDAPSDK
164 #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \
165 || (s) == LDAP_UNAVAILABLE)
167 #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN)
170 /* These symbols are not actually exported in a DSO build, but mapped into
171 * a private exported function array for apr_ldap_stub to bind dynamically.
172 * Rename them appropriately to protect the global namespace.
174 #ifdef APU_DSO_LDAP_BUILD
176 #define apr_ldap_info apr__ldap_info
177 #define apr_ldap_init apr__ldap_init
178 #define apr_ldap_ssl_init apr__ldap_ssl_init
179 #define apr_ldap_ssl_deinit apr__ldap_ssl_deinit
180 #define apr_ldap_get_option apr__ldap_get_option
181 #define apr_ldap_set_option apr__ldap_set_option
182 #define apr_ldap_rebind_init apr__ldap_rebind_init
183 #define apr_ldap_rebind_add apr__ldap_rebind_add
184 #define apr_ldap_rebind_remove apr__ldap_rebind_remove
186 #define APU_DECLARE_LDAP(type) type
188 #define APU_DECLARE_LDAP(type) APU_DECLARE(type)
191 #include "apr_ldap_url.h"
192 #include "apr_ldap_init.h"
193 #include "apr_ldap_option.h"
194 #include "apr_ldap_rebind.h"
196 #endif /* APR_HAS_LDAP */
198 #endif /* APU_LDAP_H */