| 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 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.
|
|---|
| 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 Lesser General Public License
|
|---|
| 22 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 23 | */
|
|---|
| 24 |
|
|---|
| 25 | /* The interface version specifier.
|
|---|
| 26 | Updated to 3 for enum types by JRA. */
|
|---|
| 27 |
|
|---|
| 28 | /* Updated to 4, completely new interface, SSS */
|
|---|
| 29 | /* Updated to 5, simplified interface by Volker */
|
|---|
| 30 |
|
|---|
| 31 | #define SMB_IDMAP_INTERFACE_VERSION 5
|
|---|
| 32 |
|
|---|
| 33 | #include "librpc/gen_ndr/idmap.h"
|
|---|
| 34 |
|
|---|
| 35 | struct idmap_domain {
|
|---|
| 36 | const char *name;
|
|---|
| 37 | struct idmap_methods *methods;
|
|---|
| 38 | uint32_t low_id;
|
|---|
| 39 | uint32_t high_id;
|
|---|
| 40 | bool read_only;
|
|---|
| 41 | void *private_data;
|
|---|
| 42 | };
|
|---|
| 43 |
|
|---|
| 44 | /* Filled out by IDMAP backends */
|
|---|
| 45 | struct idmap_methods {
|
|---|
| 46 |
|
|---|
| 47 | /* Called when backend is first loaded */
|
|---|
| 48 | NTSTATUS (*init)(struct idmap_domain *dom);
|
|---|
| 49 |
|
|---|
| 50 | /* Map an array of uids/gids to SIDs. The caller specifies
|
|---|
| 51 | the uid/gid and type. Gets back the SID. */
|
|---|
| 52 | NTSTATUS (*unixids_to_sids)(struct idmap_domain *dom, struct id_map **ids);
|
|---|
| 53 |
|
|---|
| 54 | /* Map an arry of SIDs to uids/gids. The caller sets the SID
|
|---|
| 55 | and type and gets back a uid or gid. */
|
|---|
| 56 | NTSTATUS (*sids_to_unixids)(struct idmap_domain *dom, struct id_map **ids);
|
|---|
| 57 |
|
|---|
| 58 | /* Allocate a Unix-ID. */
|
|---|
| 59 | NTSTATUS (*allocate_id)(struct idmap_domain *dom, struct unixid *id);
|
|---|
| 60 | };
|
|---|
| 61 |
|
|---|
| 62 | #include "winbindd/idmap_proto.h"
|
|---|
| 63 |
|
|---|
| 64 | #endif /* _IDMAP_H_ */
|
|---|