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
10 
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.
15 
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.
20 
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/>.
23 
24 */
25 
26 #ifndef _PASSDB_PDB_LDAP_H_
27 #define _PASSDB_PDB_LDAP_H_
28 
29 /* struct used by both pdb_ldap.c and pdb_nds.c */
30 
31 struct ldapsam_privates {
32 	struct smbldap_state *smbldap_state;
33 
34 	/* Former statics */
35 	LDAPMessage *result;
36 	LDAPMessage *entry;
37 	int index;
38 
39 	const char *domain_name;
40 	struct dom_sid domain_sid;
41 
42 	/* configuration items */
43 	int schema_ver;
44 
45 	char *domain_dn;
46 
47 	/* Is this NDS ldap? */
48 	int is_nds_ldap;
49 
50 	/* ldap server location parameter */
51 	char *location;
52 
53 	struct {
54 		char *filter;
55 		LDAPMessage *result;
56 	} search_cache;
57 };
58 
59 /* The following definitions come from passdb/pdb_ldap.c  */
60 
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);
70 
71 #endif /* _PASSDB_PDB_LDAP_H_ */
72