1 /* back-ldap.h - ldap backend header file */
4 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 /* This is an altered version */
9 * Copyright 1999, Howard Chu, All rights reserved. <hyc@highlandsun.com>
11 * Permission is granted to anyone to use this software for any purpose
12 * on any computer system, and to alter it and redistribute it, subject
13 * to the following restrictions:
15 * 1. The author is not responsible for the consequences of use of this
16 * software, no matter how awful, even if they arise from flaws in it.
18 * 2. The origin of this software must not be misrepresented, either by
19 * explicit claim or by omission. Since few users ever read sources,
20 * credits should appear in the documentation.
22 * 3. Altered versions must be plainly marked as such, and must not be
23 * misrepresented as being the original software. Since few users
24 * ever read sources, credits should appear in the documentation.
26 * 4. This notice may not be removed or altered.
30 * Copyright 2000, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
32 * This software is being modified by Pierangelo Masarati.
33 * The previously reported conditions apply to the modified code as well.
34 * Changes in the original code are highlighted where required.
35 * Credits for the original code go to the author, Howard Chu.
45 /* String rewrite library */
48 #endif /* ENABLE_REWRITE */
54 struct slap_backend_db;
57 struct slap_conn *conn;
60 struct berval bound_dn;
61 struct berval local_dn;
63 ldap_pvt_thread_mutex_t lc_mutex;
83 struct rewrite_info *rwm_rw;
84 #else /* !ENABLE_REWRITE */
85 /* some time the suffix massaging without librewrite
87 BerVarray rwm_suffix_massage;
88 #endif /* !ENABLE_REWRITE */
91 * Attribute/objectClass mapping
93 struct ldapmap rwm_oc;
94 struct ldapmap rwm_at;
98 struct slap_backend_db *be;
100 struct berval binddn;
101 struct berval bindpw;
102 ldap_pvt_thread_mutex_t conn_mutex;
107 #ifdef ENABLE_REWRITE
108 struct rewrite_info *rwinfo;
109 #else /* !ENABLE_REWRITE */
110 BerVarray suffix_massage;
111 #endif /* !ENABLE_REWRITE */
113 struct ldapmap oc_map;
114 struct ldapmap at_map;
117 struct ldaprwmap rwmap;
120 /* Whatever context ldap_back_dn_massage needs... */
121 typedef struct dncookie {
122 struct ldaprwmap *rwmap;
124 #ifdef ENABLE_REWRITE
134 struct ldapconn *ldap_back_getconn(struct slap_op *op, struct slap_rep *rs);
135 int ldap_back_dobind(struct ldapconn *lc, Operation *op, SlapReply *rs);
136 int ldap_back_map_result(SlapReply *rs);
137 int ldap_back_op_result(struct ldapconn *lc, Operation *op, SlapReply *rs,
138 ber_int_t msgid, int sendok);
139 int back_ldap_LTX_init_module(int argc, char *argv[]);
141 int ldap_back_dn_massage(dncookie *dc, struct berval *dn,
144 extern int ldap_back_conn_cmp( const void *c1, const void *c2);
145 extern int ldap_back_conn_dup( void *c1, void *c2 );
146 extern void ldap_back_conn_free( void *c );
148 /* attributeType/objectClass mapping */
149 int mapping_cmp (const void *, const void *);
150 int mapping_dup (void *, void *);
152 void ldap_back_map_init ( struct ldapmap *lm, struct ldapmapping ** );
153 void ldap_back_map ( struct ldapmap *map, struct berval *s, struct berval *m,
155 #define BACKLDAP_MAP 0
156 #define BACKLDAP_REMAP 1
158 ldap_back_map_filter(
159 struct ldapmap *at_map,
160 struct ldapmap *oc_map,
167 struct ldapmap *at_map,
173 extern void mapping_free ( void *mapping );
175 extern int ldap_back_map_config(
176 struct ldapmap *oc_map,
177 struct ldapmap *at_map,
184 ldap_back_filter_map_rewrite(
190 /* suffix massaging by means of librewrite */
191 #ifdef ENABLE_REWRITE
192 extern int suffix_massage_config( struct rewrite_info *info,
193 struct berval *pvnc, struct berval *nvnc,
194 struct berval *prnc, struct berval *nrnc);
195 #endif /* ENABLE_REWRITE */
196 extern int ldap_dnattr_rewrite( dncookie *dc, BerVarray a_vals );
197 extern int ldap_dnattr_result_rewrite( dncookie *dc, BerVarray a_vals );
201 #endif /* SLAPD_LDAP_H */