some more code
[Samba.git] / source3 / include / idmap.h
blob5a1f4fafc3050da5f9681665165f28a55ef09bc7
1 /*
2 Unix SMB/CIFS implementation.
4 Idmap headers
6 Copyright (C) Anthony Liguori 2003
7 Copyright (C) Simo Sorce 2003
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details.
19 You should have received a copy of the GNU Library General Public
20 License along with this library; if not, write to the
21 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.
25 #define ID_EMPTY 0
26 #define ID_USERID 1
27 #define ID_GROUPID 2
28 #define ID_OTHER 3
30 typedef union id_t {
31 uid_t uid;
32 gid_t gid;
33 } id_t;
35 /* Filled out by IDMAP backends */
36 struct idmap_methods {
38 /* Called when backend is first loaded */
39 NTSTATUS (*init)(void);
41 NTSTATUS (*get_sid_from_id)(DOM_SID *sid, id_t id, int id_type);
42 NTSTATUS (*get_id_from_sid)(id_t *id, int *id_type, DOM_SID *sid);
44 /* Called when backend is unloaded */
45 NTSTATUS (*close)(void);
47 /* Called to dump backend status */
48 void (*status)(void);