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