~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to srclib/apr-util/include/apr_ldap_init.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
 
2
 * applicable.
 
3
 *
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * 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
/**
 
18
 * @file apr_ldap_init.h
 
19
 * @brief  APR-UTIL LDAP ldap_init() functions
 
20
 */
 
21
#ifndef APR_LDAP_INIT_H
 
22
#define APR_LDAP_INIT_H
 
23
 
 
24
/**
 
25
 * @defgroup APR_Util_LDAP LDAP
 
26
 * @ingroup APR_Util
 
27
 * @{
 
28
 */
 
29
 
 
30
#include "apr_ldap.h"
 
31
 
 
32
#if APR_HAS_LDAP
 
33
 
 
34
#ifdef __cplusplus
 
35
extern "C" {
 
36
#endif /* __cplusplus */
 
37
 
 
38
/**
 
39
 * APR LDAP SSL Initialise function
 
40
 *
 
41
 * This function initialises SSL on the underlying LDAP toolkit
 
42
 * if this is necessary.
 
43
 *
 
44
 * If a CA certificate is provided, this is set, however the setting
 
45
 * of certificates via this method has been deprecated and will be removed in
 
46
 * APR v2.0.
 
47
 *
 
48
 * The apr_ldap_set_option() function with the APR_LDAP_OPT_TLS_CERT option
 
49
 * should be used instead to set certificates.
 
50
 *
 
51
 * If SSL support is not available on this platform, or a problem
 
52
 * was encountered while trying to set the certificate, the function
 
53
 * will return APR_EGENERAL. Further LDAP specific error information
 
54
 * can be found in result_err.
 
55
 * @param pool The pool to use
 
56
 * @param cert_auth_file The name of the certificate to use, can be NULL
 
57
 * @param cert_file_type The type of certificate specified. See the
 
58
 * apr_ldap_set_option() APR_LDAP_OPT_TLS_CERT option for details.
 
59
 * @param result_err The returned result
 
60
 */
 
61
APU_DECLARE(int) apr_ldap_ssl_init(apr_pool_t *pool,
 
62
                                   const char *cert_auth_file,
 
63
                                   int cert_file_type,
 
64
                                   apr_ldap_err_t **result_err);
 
65
 
 
66
/**
 
67
 * APR LDAP SSL De-Initialise function
 
68
 *
 
69
 * This function tears down any SSL certificate setup previously
 
70
 * set using apr_ldap_ssl_init(). It should be called to clean
 
71
 * up if a graceful restart of a service is attempted.
 
72
 * @todo currently we do not check whether apr_ldap_ssl_init()
 
73
 * has been called first - we probably should.
 
74
 */
 
75
APU_DECLARE(int) apr_ldap_ssl_deinit(void);
 
76
 
 
77
/**
 
78
 * APR LDAP initialise function
 
79
 *
 
80
 * This function is responsible for initialising an LDAP
 
81
 * connection in a toolkit independant way. It does the
 
82
 * job of ldap_init() from the C api.
 
83
 *
 
84
 * It handles both the SSL and non-SSL case, and attempts
 
85
 * to hide the complexity setup from the user. This function
 
86
 * assumes that any certificate setup necessary has already
 
87
 * been done.
 
88
 *
 
89
 * If SSL or STARTTLS needs to be enabled, and the underlying
 
90
 * toolkit supports it, the following values are accepted for
 
91
 * secure:
 
92
 *
 
93
 * APR_LDAP_NONE: No encryption
 
94
 * APR_LDAP_SSL: SSL encryption (ldaps://)
 
95
 * APR_LDAP_STARTTLS: Force STARTTLS on ldap://
 
96
 * @remark The Novell toolkit is only able to set the SSL mode via this
 
97
 * function. To work around this limitation, set the SSL mode here if no
 
98
 * per connection client certificates are present, otherwise set secure
 
99
 * APR_LDAP_NONE here, then set the per connection client certificates,
 
100
 * followed by setting the SSL mode via apr_ldap_set_option(). As Novell
 
101
 * does not support per connection client certificates, this problem is
 
102
 * worked around while still being compatible with other LDAP toolkits.
 
103
 * @param pool The pool to use
 
104
 * @param ldap The LDAP handle
 
105
 * @param hostname The name of the host to connect to. This can be either a
 
106
 * DNS name, or an IP address.
 
107
 * @param portno The port to connect to
 
108
 * @param secure The security mode to set
 
109
 * @param result_err The returned result
 
110
 */
 
111
APU_DECLARE(int) apr_ldap_init(apr_pool_t *pool,
 
112
                               LDAP **ldap,
 
113
                               const char *hostname,
 
114
                               int portno,
 
115
                               int secure,
 
116
                               apr_ldap_err_t **result_err);
 
117
 
 
118
/**
 
119
 * APR LDAP info function
 
120
 *
 
121
 * This function returns a string describing the LDAP toolkit
 
122
 * currently in use. The string is placed inside result_err->reason.
 
123
 * @param pool The pool to use
 
124
 * @param result_err The returned result
 
125
 */
 
126
APU_DECLARE(int) apr_ldap_info(apr_pool_t *pool,
 
127
                               apr_ldap_err_t **result_err);
 
128
 
 
129
#ifdef __cplusplus
 
130
}
 
131
#endif
 
132
 
 
133
#endif /* APR_HAS_LDAP */
 
134
 
 
135
/** @} */
 
136
 
 
137
#endif /* APR_LDAP_URL_H */