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.
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;
86 #ifdef LDAP_BACK_PROXY_AUTHZ
87 struct berval proxyauthzdn;
88 struct berval proxyauthzpw;
89 #endif /* LDAP_BACK_PROXY_AUTHZ */
90 ldap_pvt_thread_mutex_t conn_mutex;
96 struct rewrite_info *rwinfo;
97 #else /* !ENABLE_REWRITE */
98 BerVarray suffix_massage;
99 #endif /* !ENABLE_REWRITE */
101 struct ldapmap oc_map;
102 struct ldapmap at_map;
105 struct ldaprwmap rwmap;
108 /* Whatever context ldap_back_dn_massage needs... */
109 typedef struct dncookie {
110 struct ldaprwmap *rwmap;
112 #ifdef ENABLE_REWRITE
122 struct ldapconn *ldap_back_getconn(struct slap_op *op, struct slap_rep *rs);
123 int ldap_back_dobind(struct ldapconn *lc, Operation *op, SlapReply *rs);
124 int ldap_back_map_result(SlapReply *rs);
125 int ldap_back_op_result(struct ldapconn *lc, Operation *op, SlapReply *rs,
126 ber_int_t msgid, int sendok);
127 int back_ldap_LTX_init_module(int argc, char *argv[]);
129 int ldap_back_dn_massage(dncookie *dc, struct berval *dn,
132 extern int ldap_back_conn_cmp( const void *c1, const void *c2);
133 extern int ldap_back_conn_dup( void *c1, void *c2 );
134 extern void ldap_back_conn_free( void *c );
136 /* attributeType/objectClass mapping */
137 int mapping_cmp (const void *, const void *);
138 int mapping_dup (void *, void *);
140 void ldap_back_map_init ( struct ldapmap *lm, struct ldapmapping ** );
141 void ldap_back_map ( struct ldapmap *map, struct berval *s, struct berval *m,
143 #define BACKLDAP_MAP 0
144 #define BACKLDAP_REMAP 1
146 ldap_back_map_filter(
147 struct ldapmap *at_map,
148 struct ldapmap *oc_map,
155 struct ldapmap *at_map,
161 extern void mapping_free ( void *mapping );
163 extern int ldap_back_map_config(
164 struct ldapmap *oc_map,
165 struct ldapmap *at_map,
172 ldap_back_filter_map_rewrite(
178 /* suffix massaging by means of librewrite */
179 #ifdef ENABLE_REWRITE
180 extern int suffix_massage_config( struct rewrite_info *info,
181 struct berval *pvnc, struct berval *nvnc,
182 struct berval *prnc, struct berval *nrnc);
183 #endif /* ENABLE_REWRITE */
184 extern int ldap_dnattr_rewrite( dncookie *dc, BerVarray a_vals );
185 extern int ldap_dnattr_result_rewrite( dncookie *dc, BerVarray a_vals );
187 extern int ldap_chain_setup();
189 #ifdef LDAP_BACK_PROXY_AUTHZ
191 ldap_back_proxy_authz_ctrl(
195 LDAPControl ***pctrls );
196 #endif /* LDAP_BACK_PROXY_AUTHZ */
200 #endif /* SLAPD_LDAP_H */