Apache Portable Runtime Utility Library
apr_ldap_init.h
Go to the documentation of this file.
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 
21 #ifndef APR_LDAP_INIT_H
22 #define APR_LDAP_INIT_H
23 
29 #include "apr_ldap.h"
30 
31 #if APR_HAS_LDAP
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36 
37 
41 #if defined(LDAP_INSUFFICIENT_ACCESS)
42 #define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_ACCESS
43 #elif defined(LDAP_INSUFFICIENT_RIGHTS)
44 #define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS
45 #elif defined(APR_HAS_MICROSOFT_LDAPSDK)
46 /* The macros above fail to contemplate that LDAP_RETCODE values
47  * may be represented by an enum. autoconf tests would be much
48  * more robust.
49  */
50 #define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS
51 #else
52 #error The security return codes must be added to support this LDAP toolkit.
53 #endif
54 
55 #if defined(LDAP_SECURITY_ERROR)
56 #define APU_LDAP_SECURITY_ERROR LDAP_SECURITY_ERROR
57 #else
58 #define APU_LDAP_SECURITY_ERROR(n) \
59  (LDAP_INAPPROPRIATE_AUTH == n) ? 1 \
60  : (LDAP_INVALID_CREDENTIALS == n) ? 1 \
61  : (APU_LDAP_INSUFFICIENT_ACCESS == n) ? 1 \
62  : 0
63 #endif
64 
65 
89 APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool,
90  const char *cert_auth_file,
91  int cert_file_type,
92  apr_ldap_err_t **result_err);
93 
103 APU_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void);
104 
139 APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool,
140  LDAP **ldap,
141  const char *hostname,
142  int portno,
143  int secure,
144  apr_ldap_err_t **result_err);
145 
154 APU_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool,
155  apr_ldap_err_t **result_err);
156 
157 #ifdef __cplusplus
158 }
159 #endif
160 
161 #endif /* APR_HAS_LDAP */
162 
165 #endif /* APR_LDAP_URL_H */
APR-UTIL LDAP.
apr_pool_t * pool
Definition: apr_dbm_private.h:96