1 /* back-ldap.h - ldap backend header file */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1999-2004 The OpenLDAP Foundation.
6 * Portions Copyright 2000-2003 Pierangelo Masarati.
7 * Portions Copyright 1999-2003 Howard Chu.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted only as authorized by the OpenLDAP
14 * A copy of this license is available in the file LICENSE in the
15 * top-level directory of the distribution or, alternatively, at
16 * <http://www.OpenLDAP.org/license.html>.
19 * This work was initially developed by the Howard Chu for inclusion
20 * in OpenLDAP Software and subsequently enhanced by Pierangelo
29 /* String rewrite library */
32 #endif /* ENABLE_REWRITE */
38 struct slap_backend_db;
41 struct slap_conn *conn;
44 struct berval bound_dn;
45 struct berval local_dn;
47 ldap_pvt_thread_mutex_t lc_mutex;
67 struct rewrite_info *rwm_rw;
68 #else /* !ENABLE_REWRITE */
69 /* some time the suffix massaging without librewrite
71 BerVarray rwm_suffix_massage;
72 #endif /* !ENABLE_REWRITE */
75 * Attribute/objectClass mapping
77 struct ldapmap rwm_oc;
78 struct ldapmap rwm_at;
82 struct slap_backend_db *be;
87 #ifdef LDAP_BACK_PROXY_AUTHZ
88 struct berval proxyauthzdn;
89 struct berval proxyauthzpw;
90 #endif /* LDAP_BACK_PROXY_AUTHZ */
91 ldap_pvt_thread_mutex_t conn_mutex;
97 struct rewrite_info *rwinfo;
98 #else /* !ENABLE_REWRITE */
99 BerVarray suffix_massage;
100 #endif /* !ENABLE_REWRITE */
102 struct ldapmap oc_map;
103 struct ldapmap at_map;
106 struct ldaprwmap rwmap;
109 /* Whatever context ldap_back_dn_massage needs... */
110 typedef struct dncookie {
111 struct ldaprwmap *rwmap;
113 #ifdef ENABLE_REWRITE
123 struct ldapconn *ldap_back_getconn(struct slap_op *op, struct slap_rep *rs);
124 int ldap_back_dobind(struct ldapconn *lc, Operation *op, SlapReply *rs);
125 int ldap_back_map_result(SlapReply *rs);
126 int ldap_back_op_result(struct ldapconn *lc, Operation *op, SlapReply *rs,
127 ber_int_t msgid, int sendok);
128 int back_ldap_LTX_init_module(int argc, char *argv[]);
130 int ldap_back_dn_massage(dncookie *dc, struct berval *dn,
133 extern int ldap_back_conn_cmp( const void *c1, const void *c2);
134 extern int ldap_back_conn_dup( void *c1, void *c2 );
135 extern void ldap_back_conn_free( void *c );
137 /* attributeType/objectClass mapping */
138 int mapping_cmp (const void *, const void *);
139 int mapping_dup (void *, void *);
141 void ldap_back_map_init ( struct ldapmap *lm, struct ldapmapping ** );
142 void ldap_back_map ( struct ldapmap *map, struct berval *s, struct berval *m,
144 #define BACKLDAP_MAP 0
145 #define BACKLDAP_REMAP 1
147 ldap_back_map_filter(
148 struct ldapmap *at_map,
149 struct ldapmap *oc_map,
156 struct ldapmap *at_map,
162 extern void mapping_free ( void *mapping );
164 extern int ldap_back_map_config(
165 struct ldapmap *oc_map,
166 struct ldapmap *at_map,
173 ldap_back_filter_map_rewrite(
179 /* suffix massaging by means of librewrite */
180 #ifdef ENABLE_REWRITE
181 extern int suffix_massage_config( struct rewrite_info *info,
182 struct berval *pvnc, struct berval *nvnc,
183 struct berval *prnc, struct berval *nrnc);
184 #endif /* ENABLE_REWRITE */
185 extern int ldap_dnattr_rewrite( dncookie *dc, BerVarray a_vals );
186 extern int ldap_dnattr_result_rewrite( dncookie *dc, BerVarray a_vals );
188 #ifdef LDAP_BACK_PROXY_AUTHZ
190 ldap_back_proxy_authz_ctrl(
194 LDAPControl ***pctrls );
195 #endif /* LDAP_BACK_PROXY_AUTHZ */
199 #endif /* SLAPD_LDAP_H */