2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1999-2004 The OpenLDAP Foundation.
5 * Portions Copyright 2001-2003 Pierangelo Masarati.
6 * Portions Copyright 1999-2003 Howard Chu.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted only as authorized by the OpenLDAP
13 * A copy of this license is available in the file LICENSE in the
14 * top-level directory of the distribution or, alternatively, at
15 * <http://www.OpenLDAP.org/license.html>.
18 * This work was initially developed by the Howard Chu for inclusion
19 * in OpenLDAP Software and subsequently enhanced by Pierangelo
24 #error "include servers/slapd/back-ldap/back-ldap.h before this file!"
25 #endif /* SLAPD_LDAP_H */
32 /* String rewrite library */
39 struct metasingleconn {
41 #define META_NOT_CANDIDATE 0
42 #define META_CANDIDATE 1
43 #define META_LAST_CONN -1
46 struct berval bound_dn;
49 #define META_UNBOUND 0
51 #define META_ANONYMOUS 2
54 #define META_LAST(lsc) ((lsc)->candidate == META_LAST_CONN)
57 struct slap_conn *conn;
58 struct rewrite_info *rwinfo;
61 * means that the connection is bound;
62 * of course only one target actually is ...
65 #define META_BOUND_NONE -1
66 #define META_BOUND_ALL -2
67 /* supersedes the connection stuff */
68 struct metasingleconn *conns;
73 struct berval psuffix; /* pretty suffix */
74 struct berval suffix; /* normalized suffix */
78 struct berval pseudorootdn;
79 struct berval pseudorootpw;
82 struct rewrite_info *rwinfo;
84 struct ldapmap oc_map;
85 struct ldapmap at_map;
87 struct ldaprwmap rwmap;
91 ldap_pvt_thread_mutex_t mutex;
94 #define META_DNCACHE_DISABLED 0
95 #define META_DNCACHE_FOREVER -1
96 long int ttl; /* seconds; 0: no cache, -1: no expiry */
103 #define META_DEFAULT_TARGET_NONE -1
104 struct metatarget **targets;
106 struct rewrite_info *rwinfo;
109 struct metadncache cache;
111 ldap_pvt_thread_mutex_t conn_mutex;
117 #define META_OP_ALLOW_MULTIPLE 0x00
118 #define META_OP_REQUIRE_SINGLE 0x01
119 #define META_OP_REQUIRE_ALL 0x02
120 extern struct metaconn *
149 back_meta_LTX_init_module(
170 meta_back_is_candidate(
171 struct berval *nsuffix,
176 meta_back_count_candidates(
182 meta_back_is_candidate_unique(
188 meta_back_select_unique_candidate(
194 meta_clear_unused_candidates(
202 meta_clear_one_candidate(
203 struct metasingleconn *lc,
208 * Dn cache stuff (experimental)
223 meta_dncache_get_target(
224 struct metadncache *cache,
229 meta_dncache_update_entry(
230 struct metadncache *cache,
236 meta_dncache_delete_entry(
237 struct metadncache *cache,
248 #endif /* SLAPD_META_H */