apr_ldap.h revision 251886
1/* $FreeBSD: head/usr.bin/svn/lib/libapr_util/apr_ldap.h 251886 2013-06-18 02:53:45Z peter $ */ 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 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 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. 16 */ 17 18/* 19 * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h 20 */ 21/** 22 * @file apr_ldap.h 23 * @brief APR-UTIL LDAP 24 */ 25#ifndef APU_LDAP_H 26#define APU_LDAP_H 27 28/** 29 * @defgroup APR_Util_LDAP LDAP 30 * @ingroup APR_Util 31 * @{ 32 */ 33 34/* this will be defined if LDAP support was compiled into apr-util */ 35#define APR_HAS_LDAP 0 36 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_ZOS_LDAPSDK 0 45#define APR_HAS_OTHER_LDAPSDK 0 46 47 48/* 49 * Handle the case when LDAP is enabled 50 */ 51#if APR_HAS_LDAP 52 53/* 54 * The following #defines are DEPRECATED and should not be used for 55 * anything. They remain to maintain binary compatibility. 56 * The original code defined the OPENLDAP SDK as present regardless 57 * of what really was there, which was way bogus. In addition, the 58 * apr_ldap_url_parse*() functions have been rewritten specifically for 59 * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. 60 */ 61#define APR_HAS_LDAP_SSL 1 62#define APR_HAS_LDAP_URL_PARSE 0 63 64#if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) 65/* Ensure that the "deprecated" interfaces are still exposed 66 * with OpenLDAP >= 2.3; these were exposed by default in earlier 67 * releases. */ 68#define LDAP_DEPRECATED 1 69#endif 70 71/* 72 * Include the standard LDAP header files. 73 */ 74 75 76 77 78 79 80/* 81 * Detected standard functions 82 */ 83#define APR_HAS_LDAPSSL_CLIENT_INIT 0 84#define APR_HAS_LDAPSSL_CLIENT_DEINIT 0 85#define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 0 86#define APR_HAS_LDAP_START_TLS_S 0 87#define APR_HAS_LDAP_SSLINIT 0 88#define APR_HAS_LDAPSSL_INIT 0 89#define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0 90 91/* 92 * Make sure the secure LDAP port is defined 93 */ 94#ifndef LDAPS_PORT 95#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ 96#endif 97 98/* 99 * For ldap function calls that input a size limit on the number of returned elements 100 * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) 101 */ 102#if APR_HAS_ZOS_LDAPSDK 103#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT 104#else 105#ifdef LDAP_DEFAULT_LIMIT 106#define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT 107#else 108#define APR_LDAP_SIZELIMIT -1 /* equivalent to LDAP_DEFAULT_LIMIT */ 109#endif 110#endif 111 112/* 113 * z/OS is missing some defines 114 */ 115#ifndef LDAP_VERSION_MAX 116#define LDAP_VERSION_MAX LDAP_VERSION 117#endif 118#if APR_HAS_ZOS_LDAPSDK 119#define LDAP_VENDOR_NAME "IBM z/OS" 120#endif 121 122/* Note: Macros defining const casting has been removed in APR v1.0, 123 * pending real support for LDAP v2.0 toolkits. 124 * 125 * In the mean time, please use an LDAP v3.0 toolkit. 126 */ 127#if LDAP_VERSION_MAX <= 2 128#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. 129#endif 130 131#ifdef __cplusplus 132extern "C" { 133#endif /* __cplusplus */ 134 135/** 136 * This structure allows the C LDAP API error codes to be returned 137 * along with plain text error messages that explain to us mere mortals 138 * what really happened. 139 */ 140typedef struct apr_ldap_err_t { 141 const char *reason; 142 const char *msg; 143 int rc; 144} apr_ldap_err_t; 145 146#ifdef __cplusplus 147} 148#endif 149 150#include "apr_ldap_url.h" 151#include "apr_ldap_init.h" 152#include "apr_ldap_option.h" 153 154/** @} */ 155#endif /* APR_HAS_LDAP */ 156#endif /* APU_LDAP_H */ 157