2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1999-2003 The OpenLDAP Foundation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
11 * A copy of this license is available in the file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
16 * This work was initially developed by the Howard Chu for inclusion
17 * in OpenLDAP Software and subsequently enhanced by Pierangelo
20 /* This is an altered version */
22 * Copyright 1999, Howard Chu, All rights reserved. <hyc@highlandsun.com>
24 * Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
26 * This work has been developed to fulfill the requirements
27 * of SysNet s.n.c. <http:www.sys-net.it> and it has been donated
28 * to the OpenLDAP Foundation in the hope that it may be useful
29 * to the Open Source community, but WITHOUT ANY WARRANTY.
31 * Permission is granted to anyone to use this software for any purpose
32 * on any computer system, and to alter it and redistribute it, subject
33 * to the following restrictions:
35 * 1. The author and SysNet s.n.c. are not responsible for the consequences
36 * of use of this software, no matter how awful, even if they arise from
39 * 2. The origin of this software must not be misrepresented, either by
40 * explicit claim or by omission. Since few users ever read sources,
41 * credits should appear in the documentation.
43 * 3. Altered versions must be plainly marked as such, and must not be
44 * misrepresented as being the original software. Since few users
45 * ever read sources, credits should appear in the documentation.
46 * SysNet s.n.c. cannot be responsible for the consequences of the
49 * 4. This notice may not be removed or altered.
52 * This software is based on the backend back-ldap, implemented
53 * by Howard Chu <hyc@highlandsun.com>, and modified by Mark Valence
54 * <kurash@sassafras.com>, Pierangelo Masarati <ando@sys-net.it> and other
55 * contributors. The contribution of the original software to the present
56 * implementation is acknowledged in this copyright statement.
58 * A special acknowledgement goes to Howard for the overall architecture
59 * (and for borrowing large pieces of code), and to Mark, who implemented
60 * from scratch the attribute/objectclass mapping.
62 * The original copyright statement follows.
64 * Copyright 1999, Howard Chu, All rights reserved. <hyc@highlandsun.com>
66 * Permission is granted to anyone to use this software for any purpose
67 * on any computer system, and to alter it and redistribute it, subject
68 * to the following restrictions:
70 * 1. The author is not responsible for the consequences of use of this
71 * software, no matter how awful, even if they arise from flaws in it.
73 * 2. The origin of this software must not be misrepresented, either by
74 * explicit claim or by omission. Since few users ever read sources,
75 * credits should appear in the documentation.
77 * 3. Altered versions must be plainly marked as such, and must not be
78 * misrepresented as being the original software. Since few users
79 * ever read sources, credits should appear in the
82 * 4. This notice may not be removed or altered.
87 #error "include servers/slapd/back-ldap/back-ldap.h before this file!"
88 #endif /* SLAPD_LDAP_H */
95 /* String rewrite library */
103 struct metasingleconn {
105 #define META_NOT_CANDIDATE 0
106 #define META_CANDIDATE 1
107 #define META_LAST_CONN -1
110 struct berval bound_dn;
113 #define META_UNBOUND 0
115 #define META_ANONYMOUS 2
118 #define META_LAST(lsc) ((lsc)->candidate == META_LAST_CONN)
121 struct slap_conn *conn;
122 struct rewrite_info *rwinfo;
125 * means that the connection is bound;
126 * of course only one target actually is ...
129 #define META_BOUND_NONE -1
130 #define META_BOUND_ALL -2
131 /* supersedes the connection stuff */
132 struct metasingleconn *conns;
137 struct berval psuffix; /* pretty suffix */
138 struct berval suffix; /* normalized suffix */
139 struct berval binddn;
140 struct berval bindpw;
142 struct berval pseudorootdn;
143 struct berval pseudorootpw;
146 struct rewrite_info *rwinfo;
148 struct ldapmap oc_map;
149 struct ldapmap at_map;
151 struct ldaprwmap rwmap;
155 ldap_pvt_thread_mutex_t mutex;
158 #define META_DNCACHE_DISABLED 0
159 #define META_DNCACHE_FOREVER -1
160 long int ttl; /* seconds; 0: no cache, -1: no expiry */
167 #define META_DEFAULT_TARGET_NONE -1
168 struct metatarget **targets;
170 struct rewrite_info *rwinfo;
174 struct metadncache cache;
176 ldap_pvt_thread_mutex_t conn_mutex;
182 #define META_OP_ALLOW_MULTIPLE 0x00
183 #define META_OP_REQUIRE_SINGLE 0x01
184 #define META_OP_REQUIRE_ALL 0x02
185 extern struct metaconn *
214 back_meta_LTX_init_module(
235 meta_back_is_candidate(
236 struct berval *nsuffix,
241 meta_back_count_candidates(
247 meta_back_is_candidate_unique(
253 meta_back_select_unique_candidate(
259 meta_clear_unused_candidates(
267 meta_clear_one_candidate(
268 struct metasingleconn *lc,
273 * Dn cache stuff (experimental)
288 meta_dncache_get_target(
289 struct metadncache *cache,
294 meta_dncache_update_entry(
295 struct metadncache *cache,
301 meta_dncache_delete_entry(
302 struct metadncache *cache,
313 #endif /* SLAPD_META_H */