~vcs-imports/samba/main

« back to all changes in this revision

Viewing changes to source/include/idmap.h

  • Committer: jerry
  • Date: 2006-07-14 21:48:39 UTC
  • Revision ID: vcs-imports@canonical.com-20060714214839-586d8c489a8fcead
gutting trunk to move to svn:externals

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _IDMAP_H_
2
 
#define _IDMAP_H_
3
 
/* 
4
 
   Unix SMB/CIFS implementation.
5
 
 
6
 
   Idmap headers
7
 
 
8
 
   Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
9
 
   Copyright (C) Simo Sorce 2003
10
 
   
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.
15
 
   
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.
20
 
   
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.   
25
 
*/
26
 
 
27
 
/* idmap version determines auto-conversion - this is the database
28
 
   structure version specifier. */
29
 
 
30
 
#define IDMAP_VERSION 2
31
 
 
32
 
/* The interface version specifier. 
33
 
   Updated to 3 for enum types by JRA. */
34
 
 
35
 
#define SMB_IDMAP_INTERFACE_VERSION     3
36
 
 
37
 
enum idmap_type { ID_USERID, ID_GROUPID };
38
 
 
39
 
#define IDMAP_FLAG_NONE         0x0
40
 
#define IDMAP_FLAG_QUERY_ONLY   0x1     /* Don't ever allocate, just query. */
41
 
#define IDMAP_FLAG_CACHE_ONLY   0x2     /* Only look in our local cache, not remote. */
42
 
 
43
 
/* Filled out by IDMAP backends */
44
 
struct idmap_methods {
45
 
 
46
 
        /* Called when backend is first loaded */
47
 
        NTSTATUS (*init)( const char *params );
48
 
 
49
 
        NTSTATUS (*allocate_id)(unid_t *id, enum idmap_type id_type);
50
 
        NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, enum idmap_type id_type, int flags);
51
 
        NTSTATUS (*get_id_from_sid)(unid_t *id, enum idmap_type *id_type, const DOM_SID *sid, int flags);
52
 
        NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, enum idmap_type id_type);
53
 
 
54
 
        /* Called when backend is unloaded */
55
 
        NTSTATUS (*close_fn)(void);
56
 
 
57
 
        /* Called to dump backend status */
58
 
        void (*status)(void);
59
 
};
60
 
#endif /* _IDMAP_H_ */