1c5c4113nw/*
2c5c4113nw * CDDL HEADER START
3c5c4113nw *
4c5c4113nw * The contents of this file are subject to the terms of the
5c5c4113nw * Common Development and Distribution License (the "License").
6c5c4113nw * You may not use this file except in compliance with the License.
7c5c4113nw *
8c5c4113nw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9c5c4113nw * or http://www.opensolaris.org/os/licensing.
10c5c4113nw * See the License for the specific language governing permissions
11c5c4113nw * and limitations under the License.
12c5c4113nw *
13c5c4113nw * When distributing Covered Code, include this CDDL HEADER in each
14c5c4113nw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15c5c4113nw * If applicable, add the following below this CDDL HEADER, with the
16c5c4113nw * fields enclosed by brackets "[]" replaced with your own identifying
17c5c4113nw * information: Portions Copyright [yyyy] [name of copyright owner]
18c5c4113nw *
19c5c4113nw * CDDL HEADER END
20c5c4113nw */
21c5c4113nw
22c5c4113nw/*
23f7b4b2fjp * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24c5c4113nw * Use is subject to license terms.
25c5c4113nw */
26c5c4113nw
27c5c4113nw/*
28c5c4113nw * Windows to Solaris Identity Mapping kernel API
29c5c4113nw * This header file contains private definitions.
30c5c4113nw */
31c5c4113nw
32c5c4113nw#ifndef _KIDMAP_PRIV_H
33c5c4113nw#define	_KIDMAP_PRIV_H
34c5c4113nw
35c5c4113nw#include <sys/avl.h>
36c5c4113nw
37c5c4113nw#ifdef	__cplusplus
38c5c4113nwextern "C" {
39c5c4113nw#endif
40c5c4113nw
4132ff2b3Julian Pullentypedef struct sid2pid {
4232ff2b3Julian Pullen	avl_node_t	avl_link;
4332ff2b3Julian Pullen	struct sid2pid	*flink;
4432ff2b3Julian Pullen	struct sid2pid	*blink;
4532ff2b3Julian Pullen	const char 	*sid_prefix;
4632ff2b3Julian Pullen	uint32_t	rid;
4732ff2b3Julian Pullen	uid_t		uid;
4832ff2b3Julian Pullen	time_t		uid_ttl;
4932ff2b3Julian Pullen	gid_t		gid;
5032ff2b3Julian Pullen	time_t		gid_ttl;
5132ff2b3Julian Pullen	int		is_user;
5232ff2b3Julian Pullen} sid2pid_t;
5332ff2b3Julian Pullen
5432ff2b3Julian Pullen
5532ff2b3Julian Pullentypedef struct pid2sid {
5632ff2b3Julian Pullen	avl_node_t	avl_link;
5732ff2b3Julian Pullen	struct pid2sid	*flink;
5832ff2b3Julian Pullen	struct pid2sid	*blink;
5932ff2b3Julian Pullen	const char 	*sid_prefix;
6032ff2b3Julian Pullen	uint32_t	rid;
6132ff2b3Julian Pullen	uid_t		pid;
6232ff2b3Julian Pullen	time_t		ttl;
6332ff2b3Julian Pullen} pid2sid_t;
6432ff2b3Julian Pullen
65c5c4113nw
66d15447bjp
67d15447bjptypedef struct idmap_sid2pid_cache {
68d15447bjp	avl_tree_t		tree;
69d15447bjp	kmutex_t		mutex;
7032ff2b3Julian Pullen	struct sid2pid		head;
71d15447bjp	time_t			purge_time;
72d15447bjp	int			uid_num;
73d15447bjp	int			gid_num;
74d15447bjp	int			pid_num;
75d15447bjp} idmap_sid2pid_cache_t;
76d15447bjp
77d15447bjp
78d15447bjptypedef struct idmap_pid2sid_cache {
79c5c4113nw	avl_tree_t		tree;
80c5c4113nw	kmutex_t		mutex;
8132ff2b3Julian Pullen	struct pid2sid		head;
82