s3:idmap_ad: add support for ADS_AUTH_SASL_{STARTTLS,LDAPS}
[Samba.git] / source3 / passdb / pdb_ldap.h
blob755574a35d03b2165d599af1f3f12765ba8a2cb7
1 /*
2 Unix SMB/CIFS implementation.
3 LDAP protocol helper functions for SAMBA
4 Copyright (C) Jean François Micouleau 1998
5 Copyright (C) Gerald Carter 2001-2003
6 Copyright (C) Shahms King 2001
7 Copyright (C) Andrew Bartlett 2002-2003
8 Copyright (C) Stefan (metze) Metzmacher 2002-2003
9 Copyright (C) Simo Sorce 2006
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #ifndef _PASSDB_PDB_LDAP_H_
27 #define _PASSDB_PDB_LDAP_H_
29 /* struct used by both pdb_ldap.c and pdb_nds.c */
31 struct ldapsam_privates {
32 struct smbldap_state *smbldap_state;
34 /* Former statistics */
35 LDAPMessage *result;
36 LDAPMessage *entry;
37 int index;
39 const char *domain_name;
40 struct dom_sid domain_sid;
42 /* configuration items */
43 int schema_ver;
45 char *domain_dn;
47 /* Is this NDS ldap? */
48 int is_nds_ldap;
50 /* ldap server location parameter */
51 char *location;
53 struct {
54 char *filter;
55 LDAPMessage *result;
56 } search_cache;
59 /* The following definitions come from passdb/pdb_ldap.c */
61 const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver );
62 NTSTATUS pdb_ldapsam_init_common(struct pdb_methods **pdb_method, const char *location);
63 NTSTATUS pdb_ldapsam_init(TALLOC_CTX *);
64 int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state,
65 const char *user,
66 LDAPMessage ** result,
67 const char **attr);
68 const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver );
69 LDAP *priv2ld(struct ldapsam_privates *priv);
71 #endif /* _PASSDB_PDB_LDAP_H_ */