f442bf0db59b84349d0830aa69721c288eebf9db
[kai/samba.git] / source3 / include / nss_info.h
1 /* 
2    Unix SMB/CIFS implementation.
3    Idmap NSS headers
4
5    Copyright (C) Gerald Carter             2006
6
7    This library is free software; you can redistribute it and/or
8    modify it under the terms of the GNU Library General Public
9    License as published by the Free Software Foundation; either
10    version 2 of the License, or (at your option) any later version.
11    
12    This library is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    Library General Public License for more details.
16    
17    You should have received a copy of the GNU Library General Public
18    License along with this library; if not, write to the
19    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20    Boston, MA  02111-1307, USA.   
21 */
22
23 #ifndef _IDMAP_NSS_H
24 #define _IDMAP_NSS_H
25
26 /* The interface version specifier */
27
28 #define SMB_NSS_INFO_INTERFACE_VERSION    1
29
30 /* List of available backends.  All backends must 
31    register themselves */
32
33 struct nss_function_entry {
34         struct nss_function_entry *prev, *next;
35         
36         const char *name;
37         struct nss_info_methods *methods;
38 };
39
40 /* List of configured domains.  Each domain points 
41    back to its configured backend. */
42
43 struct nss_domain_entry {
44         struct nss_domain_entry *prev, *next;
45
46         const char *domain;
47
48         NTSTATUS init_status;   
49         struct nss_function_entry *backend;
50
51         /* hold state on a per domain basis */
52
53         void *state;
54 };
55
56 /* API */
57
58 struct nss_info_methods {
59         NTSTATUS (*init)( struct nss_domain_entry *e );
60         NTSTATUS (*get_nss_info)( struct nss_domain_entry *e, 
61                                   const DOM_SID *sid, 
62                                   TALLOC_CTX *ctx, 
63                                   ADS_STRUCT *ads, LDAPMessage *msg,
64                                   char **homedir, char **shell, char **gecos, gid_t *p_gid);
65         NTSTATUS (*close_fn)( void );
66 };
67
68 #endif /* _IDMAP_NSS_H_ */