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 */
102 struct metasingleconn {
104 #define META_NOT_CANDIDATE 0
105 #define META_CANDIDATE 1
106 #define META_LAST_CONN -1
109 struct berval bound_dn;
112 #define META_UNBOUND 0
114 #define META_ANONYMOUS 2
117 #define META_LAST(lsc) ((lsc)->candidate == META_LAST_CONN)
120 struct slap_conn *conn;
121 struct rewrite_info *rwinfo;
124 * means that the connection is bound;
125 * of course only one target actually is ...
128 #define META_BOUND_NONE -1
129 #define META_BOUND_ALL -2
130 /* supersedes the connection stuff */
131 struct metasingleconn *conns;
136 struct berval psuffix; /* pretty suffix */
137 struct berval suffix; /* normalized suffix */
138 struct berval binddn;
139 struct berval bindpw;
141 struct berval pseudorootdn;
142 struct berval pseudorootpw;
145 struct rewrite_info *rwinfo;
147 struct ldapmap oc_map;
148 struct ldapmap at_map;
150 struct ldaprwmap rwmap;
154 ldap_pvt_thread_mutex_t mutex;
157 #define META_DNCACHE_DISABLED 0
158 #define META_DNCACHE_FOREVER -1
159 long int ttl; /* seconds; 0: no cache, -1: no expiry */
166 #define META_DEFAULT_TARGET_NONE -1
167 struct metatarget **targets;
169 struct rewrite_info *rwinfo;
172 struct metadncache cache;
174 ldap_pvt_thread_mutex_t conn_mutex;
180 #define META_OP_ALLOW_MULTIPLE 0x00
181 #define META_OP_REQUIRE_SINGLE 0x01
182 #define META_OP_REQUIRE_ALL 0x02
183 extern struct metaconn *
212 back_meta_LTX_init_module(
233 meta_back_is_candidate(
234 struct berval *nsuffix,
239 meta_back_count_candidates(
245 meta_back_is_candidate_unique(
251 meta_back_select_unique_candidate(
257 meta_clear_unused_candidates(
265 meta_clear_one_candidate(
266 struct metasingleconn *lc,
271 * Dn cache stuff (experimental)
286 meta_dncache_get_target(
287 struct metadncache *cache,
292 meta_dncache_update_entry(
293 struct metadncache *cache,
299 meta_dncache_delete_entry(
300 struct metadncache *cache,
311 #endif /* SLAPD_META_H */