xref: /titanic_50/usr/src/cmd/allocate/allocate.h (revision bfed486ad8de8b8ebc6345a8e10accae08bf2f45)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2007 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	LISTATTRS	0x00000001	/* -a */
38 #define	CLASS		0x00000002	/* -c */
39 #define	LISTDEFS	0x00000004	/* -d */
40 #define	TYPE		0x00000008	/* -g */
41 #define	LISTALL		0x00000010	/* -l */
42 #define	LISTFREE	0x00000020	/* -n */
43 #define	SILENT		0x00000040	/* -s */
44 #define	LISTALLOC 	0x00000080	/* -u */
45 #define	WINDOWING	0x00000100	/* -w */
46 #define	ZONENAME	0x00000200	/* -z */
47 #define	BOOT		0x00000400	/* -B */
48 #define	FORCE		0x00000800	/* -F */
49 #define	FORCE_ALL 	0x00001000	/* -I */
50 #define	USERID		0x00002000	/* -U for list_devices */
51 #define	USERNAME	0x00004000	/* -U for allocate */
52 
53 /* Device clean program exit codes */
54 
55 #define	DEVCLEAN_OK		0
56 #define	DEVCLEAN_ERROR		1
57 #define	DEVCLEAN_SYSERR		2
58 #define	DEVCLEAN_BADMOUNT	3
59 #define	DEVCLEAN_MOUNTOK	4
60 
61 /* Error/Exit codes */
62 #define	ALLOCUERR		1
63 #define	CHOWNERR		2
64 /* Skip 3 to avoid conflict with DEVCLEAN_BADMOUNT */
65 #define	CNTDEXECERR		4
66 #define	CNTFRCERR		5
67 #define	DACACCERR		6
68 #define	DAOFFERR		7
69 #define	DAUTHERR		8
70 #define	DEFATTRSERR		9
71 #define	DEVLKERR		10
72 #define	DEVLONGERR		11
73 #define	DEVNALLOCERR		12
74 #define	DEVNAMEERR		13
75 #define	DEVSTATEERR		14
76 #define	DEVZONEERR		15
77 #define	DSPMISSERR		16
78 #define	GLOBALERR		17
79 #define	LABELRNGERR		18
80 #define	LOGINDEVPERMERR		19
81 #define	NODAERR			20
82 #define	NODMAPERR		21
83 #define	PREALLOCERR		22
84 #define	SETACLERR		23
85 #define	UAUTHERR		24
86 #define	ZONEERR			25
87 #define	CLEANERR		26
88 
89 #define	ALLOC_ERRID		(uid_t)2	/* bin */
90 #define	ALLOC_ERR_MODE		0100
91 
92 /* Functions */
93 extern int allocate(int optflg, uid_t uid, char *device, char *zonename);
94 extern int deallocate(int optflg, uid_t uid, char *device, char *zonename);
95 extern int list_devices(int optflg, uid_t uid, char *device, char *zonename);
96 
97 #ifdef	__cplusplus
98 }
99 #endif
100 
101 #endif	/* _ALLOCATE_H */
102