sss_idmap
1.9.2
Main Page
Modules
Data Structures
Files
File List
src
lib
idmap
sss_idmap.h
1
/*
2
SSSD
3
4
ID-mapping library
5
6
Authors:
7
Sumit Bose <sbose@redhat.com>
8
9
Copyright (C) 2012 Red Hat
10
11
This program is free software; you can redistribute it and/or modify
12
it under the terms of the GNU General Public License as published by
13
the Free Software Foundation; either version 3 of the License, or
14
(at your option) any later version.
15
16
This program 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
19
GNU General Public License for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with this program. If not, see <http://www.gnu.org/licenses/>.
23
*/
24
25
#ifndef SSS_IDMAP_H_
26
#define SSS_IDMAP_H_
27
28
#include <stdlib.h>
29
#include <stdint.h>
30
#include <stdbool.h>
31
32
#define DOM_SID_PREFIX "S-1-5-21-"
33
#define DOM_SID_PREFIX_LEN (sizeof(DOM_SID_PREFIX) - 1)
34
45
enum
idmap_error_code
{
47
IDMAP_SUCCESS
= 0,
48
50
IDMAP_NOT_IMPLEMENTED
,
51
53
IDMAP_ERROR
,
54
56
IDMAP_OUT_OF_MEMORY
,
57
59
IDMAP_NO_DOMAIN
,
60
62
IDMAP_CONTEXT_INVALID
,
63
65
IDMAP_SID_INVALID
,
66
68
IDMAP_SID_UNKNOWN
,
69
71
IDMAP_NO_RANGE
72
};
73
77
typedef
void
*(
idmap_alloc_func
)(
size_t
size,
void
*pvt);
78
typedef
void (idmap_free_func)(
void
*ptr,
void
*pvt);
79
85
struct
sss_idmap_range
{
86
uint32_t min;
87
uint32_t max;
88
};
89
93
struct
sss_dom_sid;
94
98
struct
sss_idmap_ctx;
99
105
struct
dom_sid;
106
120
enum
idmap_error_code
sss_idmap_init
(
idmap_alloc_func
*alloc_func,
121
void
*alloc_pvt,
122
idmap_free_func *free_func,
123
struct
sss_idmap_ctx **ctx);
124
141
enum
idmap_error_code
sss_idmap_add_domain
(
struct
sss_idmap_ctx *ctx,
142
const
char
*domain_name,
143
const
char
*domain_sid,
144
struct
sss_idmap_range
*range);
145
159
enum
idmap_error_code
sss_idmap_sid_to_unix
(
struct
sss_idmap_ctx *ctx,
160
const
char
*sid,
161
uint32_t *
id
);
162
176
enum
idmap_error_code
sss_idmap_dom_sid_to_unix
(
struct
sss_idmap_ctx *ctx,
177
struct
sss_dom_sid *dom_sid,
178
uint32_t *
id
);
179
194
enum
idmap_error_code
sss_idmap_bin_sid_to_unix
(
struct
sss_idmap_ctx *ctx,
195
uint8_t *bin_sid,
196
size_t
length,
197
uint32_t *
id
);
198
212
enum
idmap_error_code
sss_idmap_unix_to_sid
(
struct
sss_idmap_ctx *ctx,
213
uint32_t
id
,
214
char
**sid);
215
228
enum
idmap_error_code
sss_idmap_unix_to_dom_sid
(
struct
sss_idmap_ctx *ctx,
229
uint32_t
id
,
230
struct
sss_dom_sid **dom_sid);
231
246
enum
idmap_error_code
sss_idmap_unix_to_bin_sid
(
struct
sss_idmap_ctx *ctx,
247
uint32_t
id
,
248
uint8_t **bin_sid,
249
size_t
*length);
250
259
enum
idmap_error_code
sss_idmap_free
(
struct
sss_idmap_ctx *ctx);
260
269
const
char
*
idmap_error_string
(
enum
idmap_error_code
err);
270
280
bool
is_domain_sid
(
const
char
*str);
281
295
enum
idmap_error_code
sss_idmap_bin_sid_to_dom_sid
(
struct
sss_idmap_ctx *ctx,
296
const
uint8_t *bin_sid,
297
size_t
length,
298
struct
sss_dom_sid **dom_sid);
299
313
enum
idmap_error_code
sss_idmap_bin_sid_to_sid
(
struct
sss_idmap_ctx *ctx,
314
const
uint8_t *bin_sid,
315
size_t
length,
316
char
**sid);
317
331
enum
idmap_error_code
sss_idmap_dom_sid_to_bin_sid
(
struct
sss_idmap_ctx *ctx,
332
struct
sss_dom_sid *dom_sid,
333
uint8_t **bin_sid,
334
size_t
*length);
335
349
enum
idmap_error_code
sss_idmap_sid_to_bin_sid
(
struct
sss_idmap_ctx *ctx,
350
const
char
*sid,
351
uint8_t **bin_sid,
352
size_t
*length);
353
366
enum
idmap_error_code
sss_idmap_dom_sid_to_sid
(
struct
sss_idmap_ctx *ctx,
367
struct
sss_dom_sid *dom_sid,
368
char
**sid);
369
382
enum
idmap_error_code
sss_idmap_sid_to_dom_sid
(
struct
sss_idmap_ctx *ctx,
383
const
char
*sid,
384
struct
sss_dom_sid **dom_sid);
385
398
enum
idmap_error_code
sss_idmap_sid_to_smb_sid
(
struct
sss_idmap_ctx *ctx,
399
const
char
*sid,
400
struct
dom_sid **smb_sid);
401
414
enum
idmap_error_code
sss_idmap_smb_sid_to_sid
(
struct
sss_idmap_ctx *ctx,
415
struct
dom_sid *smb_sid,
416
char
**sid);
417
430
enum
idmap_error_code
sss_idmap_dom_sid_to_smb_sid
(
struct
sss_idmap_ctx *ctx,
431
struct
sss_dom_sid *dom_sid,
432
struct
dom_sid **smb_sid);
433
446
enum
idmap_error_code
sss_idmap_smb_sid_to_dom_sid
(
struct
sss_idmap_ctx *ctx,
447
struct
dom_sid *smb_sid,
448
struct
sss_dom_sid **dom_sid);
449
463
enum
idmap_error_code
sss_idmap_bin_sid_to_smb_sid
(
struct
sss_idmap_ctx *ctx,
464
const
uint8_t *bin_sid,
465
size_t
length,
466
struct
dom_sid **smb_sid);
467
481
enum
idmap_error_code
sss_idmap_smb_sid_to_bin_sid
(
struct
sss_idmap_ctx *ctx,
482
struct
dom_sid *smb_sid,
483
uint8_t **bin_sid,
484
size_t
*length);
488
#endif
/* SSS_IDMAP_H_ */
Generated by
1.8.1.2