r22715: When our primary domain does on or offline, make sure to send a msg
[Samba.git] / source / include / nss_info.h
blob50e5e8182a1bb835413a57335c8e9a44dfdcc6dc
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 #ifndef HAVE_LDAP
27 # ifndef LDAPMessage
28 # define LDAPMessage void
29 # endif
30 #endif
32 /* The interface version specifier */
34 #define SMB_NSS_INFO_INTERFACE_VERSION 1
36 /* List of available backends. All backends must
37 register themselves */
39 struct nss_function_entry {
40 struct nss_function_entry *prev, *next;
42 const char *name;
43 struct nss_info_methods *methods;
46 /* List of configured domains. Each domain points
47 back to its configured backend. */
49 struct nss_domain_entry {
50 struct nss_domain_entry *prev, *next;
52 const char *domain;
54 NTSTATUS init_status;
55 struct nss_function_entry *backend;
57 /* hold state on a per domain basis */
59 void *state;
62 /* API */
64 struct nss_info_methods {
65 NTSTATUS (*init)( struct nss_domain_entry *e );
66 NTSTATUS (*get_nss_info)( struct nss_domain_entry *e,
67 const DOM_SID *sid,
68 TALLOC_CTX *ctx,
69 ADS_STRUCT *ads, LDAPMessage *msg,
70 char **homedir, char **shell, char **gecos, gid_t *p_gid);
71 NTSTATUS (*close_fn)( void );
75 /* The following definitions come from nsswitch/nss_info.c */
77 NTSTATUS smb_register_idmap_nss(int version,
78 const char *name,
79 struct nss_info_methods *methods);
81 NTSTATUS nss_init( const char **nss_list );
83 NTSTATUS nss_get_info( const char *domain, const DOM_SID *user_sid,
84 TALLOC_CTX *ctx,
85 ADS_STRUCT *ads, LDAPMessage *msg,
86 char **homedir, char **shell, char **gecos,
87 gid_t *p_gid);
89 NTSTATUS nss_close( const char *parameters );
91 #endif /* _IDMAP_NSS_H_ */