r13326: fix bad path in RHEL spec file; going to have to rebuild Fedora packages
[Samba/gbeck.git] / source / include / idmap.h
blob474982f2926eacfa88cbdf0050d13596d54863c4
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 Library General Public
13 License as published by the Free Software Foundation; either
14 version 2 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 Library General Public
22 License along with this library; if not, write to the
23 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA.
27 /* idmap version determines auto-conversion */
28 #define IDMAP_VERSION 2
30 #define SMB_IDMAP_INTERFACE_VERSION 2
33 #define ID_EMPTY 0x00
34 #define ID_USERID 0x01
35 #define ID_GROUPID 0x02
36 #define ID_OTHER 0x04
38 #define ID_TYPEMASK 0x0f
40 #define ID_QUERY_ONLY 0x10
41 #define ID_CACHE_ONLY 0x20
43 /* Filled out by IDMAP backends */
44 struct idmap_methods {
46 /* Called when backend is first loaded */
47 NTSTATUS (*init)( char *params );
49 NTSTATUS (*allocate_id)(unid_t *id, int id_type);
50 NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type);
51 NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid);
52 NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, int id_type);
54 /* Called when backend is unloaded */
55 NTSTATUS (*close_fn)(void);
57 /* Called to dump backend status */
58 void (*status)(void);
60 #endif /* _IDMAP_H_ */