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
31 struct slap_backend_db;
34 struct slap_conn *lc_conn;
36 struct berval lc_cred;
37 struct berval lc_bound_ndn;
38 struct berval lc_local_ndn;
41 ldap_pvt_thread_mutex_t lc_mutex;
45 * identity assertion modes
48 LDAP_BACK_IDASSERT_LEGACY,
49 LDAP_BACK_IDASSERT_NOASSERT,
50 LDAP_BACK_IDASSERT_ANONYMOUS,
51 LDAP_BACK_IDASSERT_SELF,
52 LDAP_BACK_IDASSERT_OTHERDN,
53 LDAP_BACK_IDASSERT_OTHERID
61 #define acl_authcID acl_la.sb_authcId
62 #define acl_authcDN acl_la.sb_binddn
63 #define acl_passwd acl_la.sb_cred
64 #define acl_authzID acl_la.sb_authzId
65 #define acl_authmethod acl_la.sb_method
66 #define acl_sasl_mech acl_la.sb_saslmech
67 #define acl_sasl_realm acl_la.sb_realm
72 slap_bindconf idassert_la;
73 #define idassert_authcID idassert_la.sb_authcId
74 #define idassert_authcDN idassert_la.sb_binddn
75 #define idassert_passwd idassert_la.sb_cred
76 #define idassert_authzID idassert_la.sb_authzId
77 #define idassert_authmethod idassert_la.sb_method
78 #define idassert_sasl_mech idassert_la.sb_saslmech
79 #define idassert_sasl_realm idassert_la.sb_realm
81 unsigned idassert_flags;
82 #define LDAP_BACK_AUTH_NONE 0x00U
83 #define LDAP_BACK_AUTH_NATIVE_AUTHZ 0x01U
84 #define LDAP_BACK_AUTH_OVERRIDE 0x02U
86 BerVarray idassert_authz;
87 /* end of ID assert stuff */
89 ldap_pvt_thread_mutex_t conn_mutex;
91 #define LDAP_BACK_F_NONE 0x00U
92 #define LDAP_BACK_F_SAVECRED 0x01U
93 #define LDAP_BACK_F_USE_TLS 0x02U
94 #define LDAP_BACK_F_PROPAGATE_TLS 0x04U
95 #define LDAP_BACK_F_TLS_CRITICAL 0x08U
96 #define LDAP_BACK_F_TLS_MASK (LDAP_BACK_F_USE_TLS|LDAP_BACK_F_PROPAGATE_TLS|LDAP_BACK_F_TLS_CRITICAL)
97 #define LDAP_BACK_F_CHASE_REFERRALS 0x10U
99 #define LDAP_BACK_F_SUPPORT_T_F 0x80U
100 #define LDAP_BACK_F_SUPPORT_T_F_DISCOVER 0x40U
102 #define LDAP_BACK_SAVECRED(li) ( (li)->flags & LDAP_BACK_F_SAVECRED )
103 #define LDAP_BACK_USE_TLS(li) ( (li)->flags & LDAP_BACK_F_USE_TLS )
104 #define LDAP_BACK_PROPAGATE_TLS(li) ( (li)->flags & LDAP_BACK_F_PROPAGATE_TLS )
105 #define LDAP_BACK_TLS_CRITICAL(li) ( (li)->flags & LDAP_BACK_F_TLS_CRITICAL )
106 #define LDAP_BACK_CHASE_REFERRALS(li) ( (li)->flags & LDAP_BACK_F_CHASE_REFERRALS )
115 typedef enum ldap_back_send_t {
116 LDAP_BACK_DONTSEND = 0x00,
117 LDAP_BACK_SENDOK = 0x01,
118 LDAP_BACK_SENDERR = 0x02,
119 LDAP_BACK_SENDRESULT = (LDAP_BACK_SENDOK|LDAP_BACK_SENDERR)
122 /* define to use asynchronous StartTLS */
123 #define SLAP_STARTTLS_ASYNCHRONOUS
127 #include "proto-ldap.h"
129 #endif /* SLAPD_LDAP_H */