1251876Speter/* Licensed to the Apache Software Foundation (ASF) under one or more
2251876Speter * contributor license agreements.  See the NOTICE file distributed with
3251876Speter * this work for additional information regarding copyright ownership.
4251876Speter * The ASF licenses this file to You under the Apache License, Version 2.0
5251876Speter * (the "License"); you may not use this file except in compliance with
6251876Speter * the License.  You may obtain a copy of the License at
7251876Speter *
8251876Speter *     http://www.apache.org/licenses/LICENSE-2.0
9251876Speter *
10251876Speter * Unless required by applicable law or agreed to in writing, software
11251876Speter * distributed under the License is distributed on an "AS IS" BASIS,
12251876Speter * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13251876Speter * See the License for the specific language governing permissions and
14251876Speter * limitations under the License.
15251876Speter */
16251876Speter
17251876Speter/**
18251876Speter * The APR LDAP rebind functions provide an implementation of
19251876Speter * a rebind procedure that can be used to allow clients to chase referrals,
20251876Speter * using the same credentials used to log in originally.
21251876Speter *
22251876Speter * Use of this implementation is optional.
23251876Speter *
24251876Speter * @file apr_ldap_rebind.h
25251876Speter * @brief Apache LDAP library
26251876Speter */
27251876Speter
28251876Speter#ifndef APU_LDAP_REBIND_H
29251876Speter#define APU_LDAP_REBIND_H
30251876Speter
31251876Speter/**
32251876Speter * @addtogroup APR_Util_LDAP
33251876Speter * @{
34251876Speter **/
35251876Speter
36251876Speter#if defined(DOXYGEN)
37251876Speter#include "apr_ldap.h"
38251876Speter#endif
39251876Speter
40251876Speter/*
41251876Speter * Handle the case when LDAP is enabled
42251876Speter */
43251876Speter#if APR_HAS_LDAP
44251876Speter
45251876Speter/**
46251876Speter * APR LDAP initialize rebind lock
47251876Speter *
48251876Speter * This function creates the lock for controlling access to the xref list..
49251876Speter * @param pool Pool to use when creating the xref_lock.
50251876Speter */
51251876SpeterAPU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool);
52251876Speter
53251876Speter
54251876Speter/**
55251876Speter * APR LDAP rebind_add function
56251876Speter *
57251876Speter * This function creates a cross reference entry for the specified ldap
58251876Speter * connection. The rebind callback function will look up this ldap
59251876Speter * connection so it can retrieve the bindDN and bindPW for use in any
60251876Speter * binds while referrals are being chased.
61251876Speter *
62251876Speter * This function will add the callback to the LDAP handle passed in.
63251876Speter *
64251876Speter * A cleanup is registered within the pool provided to remove this
65251876Speter * entry when the pool is removed. Alternatively apr_ldap_rebind_remove()
66251876Speter * can be called to explicitly remove the entry at will.
67251876Speter *
68251876Speter * @param pool The pool to use
69251876Speter * @param ld The LDAP connectionhandle
70251876Speter * @param bindDN The bind DN to be used for any binds while chasing
71251876Speter *               referrals on this ldap connection.
72251876Speter * @param bindPW The bind Password to be used for any binds while
73251876Speter *               chasing referrals on this ldap connection.
74251876Speter */
75251876SpeterAPU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool,
76251876Speter                                                   LDAP *ld,
77251876Speter                                                   const char *bindDN,
78251876Speter                                                   const char *bindPW);
79251876Speter
80251876Speter/**
81251876Speter * APR LDAP rebind_remove function
82251876Speter *
83251876Speter * This function removes the rebind cross reference entry for the
84251876Speter * specified ldap connection.
85251876Speter *
86251876Speter * If not explicitly removed, this function will be called automatically
87251876Speter * when the pool is cleaned up.
88251876Speter *
89251876Speter * @param ld The LDAP connectionhandle
90251876Speter */
91251876SpeterAPU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld);
92251876Speter
93251876Speter#endif /* APR_HAS_LDAP */
94251876Speter
95251876Speter/** @} */
96251876Speter
97251876Speter#endif /* APU_LDAP_REBIND_H */
98251876Speter
99