ap_ldap.h.in revision 5f103e27107c82224e1964fca6f91945199660d9
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton/* Licensed to the Apache Software Foundation (ASF) under one or more
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * contributor license agreements. See the NOTICE file distributed with
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * this work for additional information regarding copyright ownership.
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * The ASF licenses this file to You under the Apache License, Version 2.0
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * (the "License"); you may not use this file except in compliance with
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * the License. You may obtain a copy of the License at
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * Unless required by applicable law or agreed to in writing, software
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * distributed under the License is distributed on an "AS IS" BASIS,
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * See the License for the specific language governing permissions and
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * limitations under the License.
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * ap_ldap.h is generated from ap_ldap.h.in by configure -- do not edit ap_ldap.h
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * @file ap_ldap.h
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * @brief MODLDAP
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * @defgroup AP_Util_LDAP LDAP
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * @ingroup APR_Util
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton/* Create a set of LDAP_DECLARE macros with appropriate export
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * and import tags for the platform
338eb440128c076c0418429cbc4845148d52a09ejorton#define LDAP_DECLARE(type) __declspec(dllexport) type __stdcall
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define LDAP_DECLARE_NONSTD(type) __declspec(dllexport) type
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define LDAP_DECLARE(type) __declspec(dllimport) type __stdcall
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define LDAP_DECLARE_NONSTD(type) __declspec(dllimport) type
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton/* this will be defined if LDAP support was compiled into apr-util */
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton/* identify the LDAP toolkit used */
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define AP_HAS_NETSCAPE_LDAPSDK @ap_has_ldap_netscape@
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define AP_HAS_OPENLDAP_LDAPSDK @ap_has_ldap_openldap@
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define AP_HAS_MICROSOFT_LDAPSDK @ap_has_ldap_microsoft@
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * Handle the case when LDAP is enabled
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * The following #defines are DEPRECATED and should not be used for
5bfaaf573bacb45c1cf290ce85ecc676587e8a64jim * anything. They remain to maintain binary compatibility.
5bfaaf573bacb45c1cf290ce85ecc676587e8a64jim * The original code defined the OPENLDAP SDK as present regardless
185aa71728867671e105178b4c66fbc22b65ae26sf * of what really was there, which was way bogus. In addition, the
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * ap_ldap_url_parse*() functions have been rewritten specifically for
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * APR, so the AP_HAS_LDAP_URL_PARSE macro is forced to zero.
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#if AP_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED)
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton/* Ensure that the "deprecated" interfaces are still exposed
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * with OpenLDAP >= 2.3; these were exposed by default in earlier
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * releases. */
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * Include the standard LDAP header files.
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * Detected standard functions
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define AP_HAS_LDAPSSL_CLIENT_INIT @ap_has_ldapssl_client_init@
5bfaaf573bacb45c1cf290ce85ecc676587e8a64jim#define AP_HAS_LDAPSSL_CLIENT_DEINIT @ap_has_ldapssl_client_deinit@
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define AP_HAS_LDAPSSL_ADD_TRUSTED_CERT @ap_has_ldapssl_add_trusted_cert@
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define AP_HAS_LDAP_START_TLS_S @ap_has_ldap_start_tls_s@
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define AP_HAS_LDAPSSL_INSTALL_ROUTINES @ap_has_ldapssl_install_routines@
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * Make sure the secure LDAP port is defined
185aa71728867671e105178b4c66fbc22b65ae26sf#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * For ldap function calls that input a size limit on the number of returned elements
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0)
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * or process is configured for.
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define AP_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * z/OS is missing some defines
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton/* Note: Macros defining const casting has been removed in APR v1.0,
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * pending real support for LDAP v2.0 toolkits.
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * In the mean time, please use an LDAP v3.0 toolkit.
3efea4a958cbb2e193a2f34ba5afdfe216a34324jorton#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * This structure allows the C LDAP API error codes to be returned
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * along with plain text error messages that explain to us mere mortals
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * what really happened.
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton const char *reason;
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton const char *msg;
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton/* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * between LDAP calls. Protect with AP_HAS_MICROSOFT_LDAPSDK in case someone
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton * manually chooses another SDK on Windows
39c7699ec0799d394d3f67145d4a12ed82f587b8jorton#define AP_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \