2 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5 * Copyright 1999, Howard Chu, All rights reserved. <hyc@highlandsun.com>
7 * Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
9 * This work has been developed to fulfill the requirements
10 * of SysNet s.n.c. <http:www.sys-net.it> and it has been donated
11 * to the OpenLDAP Foundation in the hope that it may be useful
12 * to the Open Source community, but WITHOUT ANY WARRANTY.
14 * Permission is granted to anyone to use this software for any purpose
15 * on any computer system, and to alter it and redistribute it, subject
16 * to the following restrictions:
18 * 1. The author and SysNet s.n.c. are not responsible for the consequences
19 * of use of this software, no matter how awful, even if they arise from
22 * 2. The origin of this software must not be misrepresented, either by
23 * explicit claim or by omission. Since few users ever read sources,
24 * credits should appear in the documentation.
26 * 3. Altered versions must be plainly marked as such, and must not be
27 * misrepresented as being the original software. Since few users
28 * ever read sources, credits should appear in the documentation.
29 * SysNet s.n.c. cannot be responsible for the consequences of the
32 * 4. This notice may not be removed or altered.
35 * This software is based on the backend back-ldap, implemented
36 * by Howard Chu <hyc@highlandsun.com>, and modified by Mark Valence
37 * <kurash@sassafras.com>, Pierangelo Masarati <ando@sys-net.it> and other
38 * contributors. The contribution of the original software to the present
39 * implementation is acknowledged in this copyright statement.
41 * A special acknowledgement goes to Howard for the overall architecture
42 * (and for borrowing large pieces of code), and to Mark, who implemented
43 * from scratch the attribute/objectclass mapping.
45 * The original copyright statement follows.
47 * Copyright 1999, Howard Chu, All rights reserved. <hyc@highlandsun.com>
49 * Permission is granted to anyone to use this software for any purpose
50 * on any computer system, and to alter it and redistribute it, subject
51 * to the following restrictions:
53 * 1. The author is not responsible for the consequences of use of this
54 * software, no matter how awful, even if they arise from flaws in it.
56 * 2. The origin of this software must not be misrepresented, either by
57 * explicit claim or by omission. Since few users ever read sources,
58 * credits should appear in the documentation.
60 * 3. Altered versions must be plainly marked as such, and must not be
61 * misrepresented as being the original software. Since few users
62 * ever read sources, credits should appear in the
65 * 4. This notice may not be removed or altered.
70 #error "include servers/slapd/back-ldap/back-ldap.h before this file!"
71 #endif /* SLAPD_LDAP_H */
78 /* String rewrite library */
86 struct metasingleconn {
88 #define META_NOT_CANDIDATE 0
89 #define META_CANDIDATE 1
90 #define META_LAST_CONN -1
93 struct berval bound_dn;
95 #define META_UNBOUND 0
97 #define META_ANONYMOUS 2
100 #define META_LAST(lsc) ((lsc)->candidate == META_LAST_CONN)
103 struct slap_conn *conn;
104 struct rewrite_info *rwinfo;
107 * means that the connection is bound;
108 * of course only one target actually is ...
111 #define META_BOUND_NONE -1
112 #define META_BOUND_ALL -2
113 /* supersedes the connection stuff */
114 struct metasingleconn *conns;
119 struct berval psuffix; /* pretty suffix */
120 struct berval suffix; /* normalized suffix */
121 struct berval binddn;
122 struct berval bindpw;
124 struct berval pseudorootdn;
125 struct berval pseudorootpw;
127 struct rewrite_info *rwinfo;
129 struct ldapmap oc_map;
130 struct ldapmap at_map;
134 ldap_pvt_thread_mutex_t mutex;
137 #define META_DNCACHE_DISABLED 0
138 #define META_DNCACHE_FOREVER -1
139 long int ttl; /* seconds; 0: no cache, -1: no expiry */
145 #define META_DEFAULT_TARGET_NONE -1
146 struct metatarget **targets;
148 struct metadncache cache;
150 ldap_pvt_thread_mutex_t conn_mutex;
154 #define META_OP_ALLOW_MULTIPLE 0x00
155 #define META_OP_REQUIRE_SINGLE 0x01
156 #define META_OP_REQUIRE_ALL 0x02
157 extern struct metaconn *
160 struct slap_conn *conn,
186 back_meta_LTX_init_module(
207 meta_back_is_candidate(
208 struct berval *nsuffix,
213 meta_back_count_candidates(
219 meta_back_is_candidate_unique(
225 meta_back_select_unique_candidate(
231 meta_clear_unused_candidates(
239 meta_clear_one_candidate(
240 struct metasingleconn *lc,
245 * Dn cache stuff (experimental)
260 meta_dncache_get_target(
261 struct metadncache *cache,
266 meta_dncache_update_entry(
267 struct metadncache *cache,
273 meta_dncache_delete_entry(
274 struct metadncache *cache,
285 #endif /* SLAPD_META_H */