xref: /illumos-gate/usr/src/cmd/allocate/allocate.h (revision 2a8bcb4e)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
545916cd2Sjpk  * Common Development and Distribution License (the "License").
645916cd2Sjpk  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
2145916cd2Sjpk 
227c478bd9Sstevel@tonic-gate /*
23*10ddde3aSaj  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_ALLOCATE_H
287c478bd9Sstevel@tonic-gate #define	_ALLOCATE_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
317c478bd9Sstevel@tonic-gate extern "C" {
327c478bd9Sstevel@tonic-gate #endif
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate /* Option Flags */
3545916cd2Sjpk #define	LISTATTRS	0x00000001	/* -a */
36*10ddde3aSaj #define	CLASS		0x00000002	/* -c */
37*10ddde3aSaj #define	LISTDEFS	0x00000004	/* -d */
38*10ddde3aSaj #define	TYPE		0x00000008	/* -g */
39*10ddde3aSaj #define	LISTALL		0x00000010	/* -l */
40*10ddde3aSaj #define	LISTFREE	0x00000020	/* -n */
41*10ddde3aSaj #define	SILENT		0x00000040	/* -s */
42*10ddde3aSaj #define	LISTALLOC 	0x00000080	/* -u */
43*10ddde3aSaj #define	WINDOWING	0x00000100	/* -w */
44*10ddde3aSaj #define	ZONENAME	0x00000200	/* -z */
45*10ddde3aSaj #define	BOOT		0x00000400	/* -B */
46*10ddde3aSaj #define	FORCE		0x00000800	/* -F */
47*10ddde3aSaj #define	FORCE_ALL 	0x00001000	/* -I */
48*10ddde3aSaj #define	USERID		0x00002000	/* -U for list_devices */
49*10ddde3aSaj #define	USERNAME	0x00004000	/* -U for allocate */
507c478bd9Sstevel@tonic-gate 
51*10ddde3aSaj /* Device clean program exit codes */
527c478bd9Sstevel@tonic-gate 
53*10ddde3aSaj #define	DEVCLEAN_OK		0
54*10ddde3aSaj #define	DEVCLEAN_ERROR		1
55*10ddde3aSaj #define	DEVCLEAN_SYSERR		2
56*10ddde3aSaj #define	DEVCLEAN_BADMOUNT	3
57*10ddde3aSaj #define	DEVCLEAN_MOUNTOK	4
587c478bd9Sstevel@tonic-gate 
59*10ddde3aSaj /* Error/Exit codes */
6045916cd2Sjpk #define	ALLOCUERR		1
6145916cd2Sjpk #define	CHOWNERR		2
62*10ddde3aSaj /* Skip 3 to avoid conflict with DEVCLEAN_BADMOUNT */
6345916cd2Sjpk #define	CNTDEXECERR		4
6445916cd2Sjpk #define	CNTFRCERR		5
6545916cd2Sjpk #define	DACACCERR		6
6645916cd2Sjpk #define	DAOFFERR		7
6745916cd2Sjpk #define	DAUTHERR		8
6845916cd2Sjpk #define	DEFATTRSERR		9
6945916cd2Sjpk #define	DEVLKERR		10
7045916cd2Sjpk #define	DEVLONGERR		11
7145916cd2Sjpk #define	DEVNALLOCERR		12
7245916cd2Sjpk #define	DEVNAMEERR		13
7345916cd2Sjpk #define	DEVSTATEERR		14
7445916cd2Sjpk #define	DEVZONEERR		15
7545916cd2Sjpk #define	DSPMISSERR		16
7645916cd2Sjpk #define	GLOBALERR		17
7745916cd2Sjpk #define	LABELRNGERR		18
7845916cd2Sjpk #define	LOGINDEVPERMERR		19
7945916cd2Sjpk #define	NODAERR			20
8045916cd2Sjpk #define	NODMAPERR		21
8145916cd2Sjpk #define	PREALLOCERR		22
8245916cd2Sjpk #define	SETACLERR		23
8345916cd2Sjpk #define	UAUTHERR		24
8445916cd2Sjpk #define	ZONEERR			25
85*10ddde3aSaj #define	CLEANERR		26
867c478bd9Sstevel@tonic-gate 
87*10ddde3aSaj #define	ALLOC_ERRID		(uid_t)2	/* bin */
88*10ddde3aSaj #define	ALLOC_ERR_MODE		0100
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate /* Functions */
9145916cd2Sjpk extern int allocate(int optflg, uid_t uid, char *device, char *zonename);
9245916cd2Sjpk extern int deallocate(int optflg, uid_t uid, char *device, char *zonename);
9345916cd2Sjpk extern int list_devices(int optflg, uid_t uid, char *device, char *zonename);
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
967c478bd9Sstevel@tonic-gate }
977c478bd9Sstevel@tonic-gate #endif
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate #endif	/* _ALLOCATE_H */
100