1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27/*
28 * Windows to Solaris Identity Mapping
29 * This header file contains cache definitions.
30 */
31
32#ifndef _IDMAP_CACHE_H
33#define	_IDMAP_CACHE_H
34
35
36#include <sys/avl.h>
37#include "idmap.h"
38
39#ifdef	__cplusplus
40extern "C" {
41#endif
42
43void
44idmap_cache_create();
45
46void
47idmap_cache_purge();
48
49
50idmap_stat
51idmap_cache_lookup_uidbysid(const char *sid_prefix, idmap_rid_t rid,
52			uid_t *uid);
53
54idmap_stat
55idmap_cache_lookup_gidbysid(const char *sid_prefix, idmap_rid_t rid,
56			gid_t *gid);
57
58idmap_stat
59idmap_cache_lookup_pidbysid(const char *sid_prefix, idmap_rid_t rid,
60			uid_t *pid, int *is_user);
61
62idmap_stat
63idmap_cache_lookup_sidbyuid(char **sid_prefix, idmap_rid_t *rid,
64			uid_t uid);
65
66idmap_stat
67idmap_cache_lookup_sidbygid(char **sid_prefix, idmap_rid_t *rid,
68			gid_t gid);
69
70idmap_stat
71idmap_cache_lookup_winnamebyuid(char **winname, char **windomain, uid_t uid);
72
73idmap_stat
74idmap_cache_lookup_winnamebygid(char **winname, char **windomain, gid_t gid);
75
76idmap_stat
77idmap_cache_lookup_uidbywinname(const char *winname, const char *windomain,
78			uid_t *uid);
79
80idmap_stat
81idmap_cache_lookup_gidbywinname(const char *winname, const char *windomain,
82			gid_t *gid);
83
84void
85idmap_cache_add_sid2uid(const char *sid_prefix, idmap_rid_t rid, uid_t uid,
86			int direction);
87
88void
89idmap_cache_add_sid2gid(const char *sid_prefix, idmap_rid_t rid, gid_t gid,
90			int direction);
91
92void
93idmap_cache_add_sid2pid(const char *sid_prefix, idmap_rid_t rid, uid_t pid,
94			int is_user, int direction);
95
96void
97idmap_cache_add_winname2uid(const char *winname, const char *windomain,
98			uid_t uid, int direction);
99
100void
101idmap_cache_add_winname2gid(const char *winname, const char *windomain,
102			gid_t gid, int direction);
103
104void
105idmap_cache_get_data(size_t *uidbysid, size_t *gidbysid, size_t *pidbysid,
106			size_t *sidbyuid, size_t *sidbygid,
107			size_t *winnamebyuid, size_t *winnamebygid,
108			size_t *uidbywinname, size_t *gidbywinname);
109
110
111#ifdef	__cplusplus
112}
113#endif
114
115#endif	/* _IDMAP_CACHE_H */
116