xref: /illumos-gate/usr/src/uts/common/sys/tl.h (revision dd72704bd9e794056c558153663c739e2012d721)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_TL_H
28 #define	_SYS_TL_H
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  * These are Sun private declarations. Not to be used by any
36  * external applications/code.
37  */
38 
39 /*
40  * Protocol level for option header - (hex for ascii "TL")
41  * (Hopefully unique!)
42  */
43 #define	TL_PROT_LEVEL 0x544c
44 
45 /*
46  * Option and data structures used for sending credentials
47  */
48 #define	TL_OPT_PEER_CRED 10
49 typedef struct tl_credopt {
50 	uid_t	tc_uid;		/* Effective user id */
51 	gid_t	tc_gid;		/* Effective group id */
52 	uid_t	tc_ruid;	/* Real user id */
53 	gid_t	tc_rgid;	/* Real group id */
54 	uid_t	tc_suid;	/* Saved user id (from exec) */
55 	gid_t	tc_sgid;	/* Saved group id (from exec) */
56 	uint_t	tc_ngroups;	/* number of supplementary groups */
57 } tl_credopt_t;
58 
59 #define	TL_OPT_PEER_UCRED 11	/* data structure is ucred */
60 
61 /*
62  * Ioctl's for the 'tl' driver
63  */
64 #define	TL_IOC		(('T' << 16)|('L' << 8))
65 #define	TL_IOC_CREDOPT	(TL_IOC|001)
66 /* unused		(TL_IOC|002) */
67 #define	TL_IOC_UCREDOPT	(TL_IOC|003)
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif /* _SYS_TL_H */
74