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 = 1,
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_sb.sb_authcId
62 #define acl_authcDN acl_sb.sb_binddn
63 #define acl_passwd acl_sb.sb_cred
64 #define acl_authzID acl_sb.sb_authzId
65 #define acl_authmethod acl_sb.sb_method
66 #define acl_sasl_mech acl_sb.sb_saslmech
67 #define acl_sasl_realm acl_sb.sb_realm
68 #define acl_secprops acl_sb.sb_secprops
73 slap_bindconf idassert_sb;
74 #define idassert_authcID idassert_sb.sb_authcId
75 #define idassert_authcDN idassert_sb.sb_binddn
76 #define idassert_passwd idassert_sb.sb_cred
77 #define idassert_authzID idassert_sb.sb_authzId
78 #define idassert_authmethod idassert_sb.sb_method
79 #define idassert_sasl_mech idassert_sb.sb_saslmech
80 #define idassert_sasl_realm idassert_sb.sb_realm
81 #define idassert_secprops idassert_sb.sb_secprops
83 unsigned idassert_flags;
84 #define LDAP_BACK_AUTH_NONE 0x00U
85 #define LDAP_BACK_AUTH_NATIVE_AUTHZ 0x01U
86 #define LDAP_BACK_AUTH_OVERRIDE 0x02U
88 BerVarray idassert_authz;
89 /* end of ID assert stuff */
91 ldap_pvt_thread_mutex_t conn_mutex;
93 #define LDAP_BACK_F_NONE 0x00U
94 #define LDAP_BACK_F_SAVECRED 0x01U
95 #define LDAP_BACK_F_USE_TLS 0x02U
96 #define LDAP_BACK_F_PROPAGATE_TLS 0x04U
97 #define LDAP_BACK_F_TLS_CRITICAL 0x08U
98 #define LDAP_BACK_F_TLS_USE_MASK (LDAP_BACK_F_USE_TLS|LDAP_BACK_F_TLS_CRITICAL)
99 #define LDAP_BACK_F_TLS_PROPAGATE_MASK (LDAP_BACK_F_PROPAGATE_TLS|LDAP_BACK_F_TLS_CRITICAL)
100 #define LDAP_BACK_F_TLS_MASK (LDAP_BACK_F_TLS_USE_MASK|LDAP_BACK_F_TLS_PROPAGATE_MASK)
101 #define LDAP_BACK_F_CHASE_REFERRALS 0x10U
102 #define LDAP_BACK_F_PROXY_WHOAMI 0x20U
104 #define LDAP_BACK_F_SUPPORT_T_F 0x80U
105 #define LDAP_BACK_F_SUPPORT_T_F_DISCOVER 0x40U
106 #define LDAP_BACK_F_SUPPORT_T_F_MASK (LDAP_BACK_F_SUPPORT_T_F|LDAP_BACK_F_SUPPORT_T_F_DISCOVER)
108 #define LDAP_BACK_SAVECRED(li) ( (li)->flags & LDAP_BACK_F_SAVECRED )
109 #define LDAP_BACK_USE_TLS(li) ( (li)->flags & LDAP_BACK_F_USE_TLS )
110 #define LDAP_BACK_PROPAGATE_TLS(li) ( (li)->flags & LDAP_BACK_F_PROPAGATE_TLS )
111 #define LDAP_BACK_TLS_CRITICAL(li) ( (li)->flags & LDAP_BACK_F_TLS_CRITICAL )
112 #define LDAP_BACK_CHASE_REFERRALS(li) ( (li)->flags & LDAP_BACK_F_CHASE_REFERRALS )
121 typedef enum ldap_back_send_t {
122 LDAP_BACK_DONTSEND = 0x00,
123 LDAP_BACK_SENDOK = 0x01,
124 LDAP_BACK_SENDERR = 0x02,
125 LDAP_BACK_SENDRESULT = (LDAP_BACK_SENDOK|LDAP_BACK_SENDERR)
128 /* define to use asynchronous StartTLS */
129 #define SLAP_STARTTLS_ASYNCHRONOUS
133 #include "proto-ldap.h"
135 #endif /* SLAPD_LDAP_H */