1 /* back-ldap.h - ldap backend header file */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1999-2005 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
27 #include "proto-ldap.h"
30 #define LDAP_BACK_PROXY_AUTHZ
37 struct slap_backend_db;
40 struct slap_conn *lc_conn;
42 struct berval lc_cred;
43 struct berval lc_bound_ndn;
44 struct berval lc_local_ndn;
46 ldap_pvt_thread_mutex_t lc_mutex;
50 struct berval la_authcID;
51 struct berval la_authcDN;
52 struct berval la_passwd;
54 struct berval la_authzID;
58 struct berval la_sasl_mech;
59 struct berval la_sasl_realm;
61 #define LDAP_BACK_AUTH_NONE 0x00U
62 #define LDAP_BACK_AUTH_NATIVE_AUTHZ 0x01U
63 #define LDAP_BACK_AUTH_OVERRIDE 0x02U
70 struct ldapauth acl_la;
71 #define acl_authcDN acl_la.la_authcDN
72 #define acl_passwd acl_la.la_passwd
74 #ifdef LDAP_BACK_PROXY_AUTHZ
77 #define LDAP_BACK_IDASSERT_LEGACY 0
78 #define LDAP_BACK_IDASSERT_NOASSERT 1
79 #define LDAP_BACK_IDASSERT_ANONYMOUS 2
80 #define LDAP_BACK_IDASSERT_SELF 3
81 #define LDAP_BACK_IDASSERT_OTHERDN 4
82 #define LDAP_BACK_IDASSERT_OTHERID 5
84 struct ldapauth idassert_la;
85 #define idassert_authcID idassert_la.la_authcID
86 #define idassert_authcDN idassert_la.la_authcDN
87 #define idassert_passwd idassert_la.la_passwd
88 #define idassert_authzID idassert_la.la_authzID
89 #define idassert_authmethod idassert_la.la_authmethod
90 #define idassert_sasl_flags idassert_la.la_sasl_flags
91 #define idassert_sasl_mech idassert_la.la_sasl_mech
92 #define idassert_sasl_realm idassert_la.la_sasl_realm
93 #define idassert_flags idassert_la.la_flags
94 BerVarray idassert_authz;
97 /* end of ID assert stuff */
98 #endif /* LDAP_BACK_PROXY_AUTHZ */
100 ldap_pvt_thread_mutex_t conn_mutex;
107 int ldap_back_freeconn( Operation *op, struct ldapconn *lc );
108 struct ldapconn *ldap_back_getconn(struct slap_op *op, struct slap_rep *rs);
109 int ldap_back_dobind(struct ldapconn *lc, Operation *op, SlapReply *rs);
110 int ldap_back_retry(struct ldapconn *lc, Operation *op, SlapReply *rs);
111 int ldap_back_map_result(SlapReply *rs);
112 int ldap_back_op_result(struct ldapconn *lc, Operation *op, SlapReply *rs,
113 ber_int_t msgid, int sendok);
114 int back_ldap_LTX_init_module(int argc, char *argv[]);
116 extern int ldap_back_conn_cmp( const void *c1, const void *c2);
117 extern int ldap_back_conn_dup( void *c1, void *c2 );
118 extern void ldap_back_conn_free( void *c );
120 #ifdef LDAP_BACK_PROXY_AUTHZ
122 ldap_back_proxy_authz_ctrl(
126 LDAPControl ***pctrls );
129 ldap_back_proxy_authz_ctrl_free(
131 LDAPControl ***pctrls );
132 #endif /* LDAP_BACK_PROXY_AUTHZ */
136 #endif /* SLAPD_LDAP_H */