r20986: Commit the prototype of the nss_info plugin interface.
[Samba.git] / source3 / include / nss_info.h
blobf442bf0db59b84349d0830aa69721c288eebf9db
1 /*
2 Unix SMB/CIFS implementation.
3 Idmap NSS headers
5 Copyright (C) Gerald Carter 2006
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.
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.
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.
23 #ifndef _IDMAP_NSS_H
24 #define _IDMAP_NSS_H
26 /* The interface version specifier */
28 #define SMB_NSS_INFO_INTERFACE_VERSION 1
30 /* List of available backends. All backends must
31 register themselves */
33 struct nss_function_entry {
34 struct nss_function_entry *prev, *next;
36 const char *name;
37 struct nss_info_methods *methods;
40 /* List of configured domains. Each domain points
41 back to its configured backend. */
43 struct nss_domain_entry {
44 struct nss_domain_entry *prev, *next;
46 const char *domain;
48 NTSTATUS init_status;
49 struct nss_function_entry *backend;
51 /* hold state on a per domain basis */
53 void *state;
56 /* API */
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 );
68 #endif /* _IDMAP_NSS_H_ */