sid.h revision f48205be61a214698b763ff550ab9e657525104c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SID_H
#define _SYS_SID_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Kernel SID data structure and functions.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* sidsys subcodes */
#define SIDSYS_ALLOC_IDS 0
/* Flags for ALLOC_IDS */
#define SID_EXTEND_RANGE 0
#define SID_NEW_RANGE 1
#define SIDSYS_IDMAP_REG 1
#define SIDSYS_IDMAP_UNREG 2
#define SIDSYS_SID2ID 0
#define SIDSYS_ID2SID 1
typedef struct domsid {
char ds_dom[1];
} domsid_t;
typedef struct sidmap_call {
int sc_type;
union sc_val_u {
} sc_val;
#ifdef _KERNEL
/* Domains are stored in AVL trees so we can share them among SIDs */
typedef struct ksiddomain {
char *kd_name; /* Domain part of SID */
} ksiddomain_t;
typedef struct ksid {
} ksid_t;
typedef enum ksid_index {
KSID_COUNT /* Must be last */
} ksid_index_t;
/*
* As no memory may be allocated for credentials while holding p_crlock,
* all sub data structures need to be ref counted.
*/
typedef struct ksidlist {
} ksidlist_t;
typedef struct credsid {
} credsid_t;
const char *ksid_getdomain(ksid_t *);
credsid_t *kcrsid_alloc(void);
void kcrsid_rele(credsid_t *);
void kcrsid_hold(credsid_t *);
void ksiddomain_rele(ksiddomain_t *);
void ksiddomain_hold(ksiddomain_t *);
void ksidlist_rele(ksidlist_t *);
void ksidlist_hold(ksidlist_t *);
ksiddomain_t *ksid_lookupdomain(const char *);
#else
int idmap_reg(int);
int idmap_unreg(int);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SID_H */