xref: /titanic_44/usr/src/cmd/allocate/allocate.h (revision b7f45089ccbe01bab3d7c7377b49d80d2ae18a69)
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 1992-2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_ALLOCATE_H
28 #define	_ALLOCATE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /* Option Flags */
37 #define	SILENT		0001	/* -s */
38 #define	USERID		0002	/* -U */
39 #define	LIST		0004	/* -l */
40 #define	FREE		0010	/* -n */
41 #define	CURRENT 	0020	/* -u */
42 #define	FORCE		0040	/* -F */
43 #define	FORCE_ALL 	0100	/* -I */
44 #define	TYPE		0200	/* -g */
45 
46 #define	ALLOC_OPTS	(SILENT | USERID | FORCE | TYPE)
47 #define	DEALLOC_OPTS	(SILENT | FORCE | FORCE_ALL)
48 #define	LIST_OPTS	(SILENT | USERID | LIST | FREE | CURRENT)
49 
50 /* Misc. */
51 
52 #define	ALL	-1
53 
54 /* Error returns start at 4 */
55 #define	SYSERROR	4
56 #define	DACLCK		5
57 #define	DACACC		6
58 #define	DEVLST		7
59 #define	NALLOCU		8
60 #define	NOTAUTH		9
61 #define	CNTFRC		10
62 #define	CNTDEXEC	11
63 #define	NO_DEVICE	12
64 #define	DSPMISS		13
65 #define	ALLOCERR	14
66 #define	IMPORT_ERR	15
67 #define	NODAENT		16
68 #define	NODMAPENT	17
69 #define	SETACL_PERR	18
70 #define	CHOWN_PERR	19
71 #define	ALLOC		20
72 #define	ALLOC_OTHER	21
73 #define	NALLOC		22
74 #define	AUTHERR		23
75 #define	CLEAN_ERR	24
76 #define	DEVNAME_ERR	25
77 #define	DEVNAME_TOOLONG	26
78 
79 /* Tunable Parameters */
80 #define	DEV_DIR		"/dev"
81 #define	DAC_DIR		"/etc/security/dev"
82 #define	SECLIB		"/etc/security/lib"
83 #define	ALLOC_MODE	0600
84 #define	DEALLOC_MODE    0000
85 #define	ALLOC_ERR_MODE  0100
86 #define	ALLOC_UID	(uid_t)0	/* root */
87 #define	ALLOC_GID	(gid_t)1	/* other */
88 
89 /* Functions */
90 extern int allocate(int optflg, uid_t uid, char *device);
91 extern int deallocate(int optflg, uid_t uid, char *device);
92 extern int list_devices(int optflg, uid_t uid, char *device);
93 
94 #ifdef	__cplusplus
95 }
96 #endif
97 
98 #endif	/* _ALLOCATE_H */
99