1 /* back-ldap.h - ldap backend header file */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1999-2003 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
17 * This work was initially developed by the Howard Chu for inclusion
18 * in OpenLDAP Software and subsequently enhanced by Pierangelo
21 /* This is an altered version */
23 * Copyright 1999, Howard Chu, All rights reserved. <hyc@highlandsun.com>
25 * Permission is granted to anyone to use this software for any purpose
26 * on any computer system, and to alter it and redistribute it, subject
27 * to the following restrictions:
29 * 1. The author is not responsible for the consequences of use of this
30 * software, no matter how awful, even if they arise from flaws in it.
32 * 2. The origin of this software must not be misrepresented, either by
33 * explicit claim or by omission. Since few users ever read sources,
34 * credits should appear in the documentation.
36 * 3. Altered versions must be plainly marked as such, and must not be
37 * misrepresented as being the original software. Since few users
38 * ever read sources, credits should appear in the documentation.
40 * 4. This notice may not be removed or altered.
44 * Copyright 2000, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
46 * This software is being modified by Pierangelo Masarati.
47 * The previously reported conditions apply to the modified code as well.
48 * Changes in the original code are highlighted where required.
49 * Credits for the original code go to the author, Howard Chu.
57 /* String rewrite library */
60 #endif /* ENABLE_REWRITE */
66 struct slap_backend_db;
69 struct slap_conn *conn;
72 struct berval bound_dn;
73 struct berval local_dn;
75 ldap_pvt_thread_mutex_t lc_mutex;
95 struct rewrite_info *rwm_rw;
96 #else /* !ENABLE_REWRITE */
97 /* some time the suffix massaging without librewrite
99 BerVarray rwm_suffix_massage;
100 #endif /* !ENABLE_REWRITE */
103 * Attribute/objectClass mapping
105 struct ldapmap rwm_oc;
106 struct ldapmap rwm_at;
110 struct slap_backend_db *be;
112 struct berval binddn;
113 struct berval bindpw;
114 ldap_pvt_thread_mutex_t conn_mutex;
119 #ifdef ENABLE_REWRITE
120 struct rewrite_info *rwinfo;
121 #else /* !ENABLE_REWRITE */
122 BerVarray suffix_massage;
123 #endif /* !ENABLE_REWRITE */
125 struct ldapmap oc_map;
126 struct ldapmap at_map;
129 struct ldaprwmap rwmap;
132 /* Whatever context ldap_back_dn_massage needs... */
133 typedef struct dncookie {
134 struct ldaprwmap *rwmap;
136 #ifdef ENABLE_REWRITE
146 struct ldapconn *ldap_back_getconn(struct slap_op *op, struct slap_rep *rs);
147 int ldap_back_dobind(struct ldapconn *lc, Operation *op, SlapReply *rs);
148 int ldap_back_map_result(SlapReply *rs);
149 int ldap_back_op_result(struct ldapconn *lc, Operation *op, SlapReply *rs,
150 ber_int_t msgid, int sendok);
151 int back_ldap_LTX_init_module(int argc, char *argv[]);
153 int ldap_back_dn_massage(dncookie *dc, struct berval *dn,
156 extern int ldap_back_conn_cmp( const void *c1, const void *c2);
157 extern int ldap_back_conn_dup( void *c1, void *c2 );
158 extern void ldap_back_conn_free( void *c );
160 /* attributeType/objectClass mapping */
161 int mapping_cmp (const void *, const void *);
162 int mapping_dup (void *, void *);
164 void ldap_back_map_init ( struct ldapmap *lm, struct ldapmapping ** );
165 void ldap_back_map ( struct ldapmap *map, struct berval *s, struct berval *m,
167 #define BACKLDAP_MAP 0
168 #define BACKLDAP_REMAP 1
170 ldap_back_map_filter(
171 struct ldapmap *at_map,
172 struct ldapmap *oc_map,
179 struct ldapmap *at_map,
185 extern void mapping_free ( void *mapping );
187 extern int ldap_back_map_config(
188 struct ldapmap *oc_map,
189 struct ldapmap *at_map,
196 ldap_back_filter_map_rewrite(
202 /* suffix massaging by means of librewrite */
203 #ifdef ENABLE_REWRITE
204 extern int suffix_massage_config( struct rewrite_info *info,
205 struct berval *pvnc, struct berval *nvnc,
206 struct berval *prnc, struct berval *nrnc);
207 #endif /* ENABLE_REWRITE */
208 extern int ldap_dnattr_rewrite( dncookie *dc, BerVarray a_vals );
209 extern int ldap_dnattr_result_rewrite( dncookie *dc, BerVarray a_vals );
211 extern int ldap_chain_setup();
215 #endif /* SLAPD_LDAP_H */