Fix bug #7528 - Solaris with NIS autohome.
[Samba.git] / source3 / include / idmap.h
blob672e3731082ed11d45a84e6d5219dd5fe9df8a3c
1 #ifndef _IDMAP_H_
2 #define _IDMAP_H_
3 /*
4 Unix SMB/CIFS implementation.
6 Idmap headers
8 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
9 Copyright (C) Simo Sorce 2003
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Lesser General Public
13 License as published by the Free Software Foundation; either
14 version 3 of the License, or (at your option) any later version.
16 This library 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 GNU
19 Library General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
25 /* The interface version specifier.
26 Updated to 3 for enum types by JRA. */
28 /* Updated to 4, completely new interface, SSS */
29 /* Updated to 5, simplified interface by Volker */
31 #define SMB_IDMAP_INTERFACE_VERSION 5
33 struct idmap_domain {
34 const char *name;
35 struct idmap_methods *methods;
36 void *private_data;
39 /* Filled out by IDMAP backends */
40 struct idmap_methods {
42 /* Called when backend is first loaded */
43 NTSTATUS (*init)(struct idmap_domain *dom, const char *params);
45 /* Map an array of uids/gids to SIDs. The caller specifies
46 the uid/gid and type. Gets back the SID. */
47 NTSTATUS (*unixids_to_sids)(struct idmap_domain *dom, struct id_map **ids);
49 /* Map an arry of SIDs to uids/gids. The caller sets the SID
50 and type and gets back a uid or gid. */
51 NTSTATUS (*sids_to_unixids)(struct idmap_domain *dom, struct id_map **ids);
53 NTSTATUS (*set_mapping)(struct idmap_domain *dom, const struct id_map *map);
54 NTSTATUS (*remove_mapping)(struct idmap_domain *dom, const struct id_map *map);
56 /* Called to dump backends data */
57 /* NOTE: caller must use talloc_free to free maps when done */
58 NTSTATUS (*dump_data)(struct idmap_domain *dom, struct id_map **maps, int *num_maps);
60 /* Called when backend is unloaded */
61 NTSTATUS (*close_fn)(struct idmap_domain *dom);
64 struct idmap_alloc_methods {
66 /* Called when backend is first loaded */
67 NTSTATUS (*init)(const char *compat_params);
69 NTSTATUS (*allocate_id)(struct unixid *id);
70 NTSTATUS (*get_id_hwm)(struct unixid *id);
71 NTSTATUS (*set_id_hwm)(struct unixid *id);
73 /* Called when backend is unloaded */
74 NTSTATUS (*close_fn)(void);
77 #endif /* _IDMAP_H_ */