Merge commit 'a058d1cc571af5fbcfe7f1d719df1abbfdb722f3' into merges
[unleashed.git] / usr / src / cmd / allocate / allocate.h
blob904ecc7eb40e8dc86d38954f322a40dea6c86553
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _ALLOCATE_H
28 #define _ALLOCATE_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
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 */
53 /* Device clean program exit codes */
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
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 LOGINDEVPERMERR 19
80 #define NODAERR 20
81 #define NODMAPERR 21
82 #define PREALLOCERR 22
83 #define SETACLERR 23
84 #define UAUTHERR 24
85 #define ZONEERR 25
86 #define CLEANERR 26
88 #define ALLOC_ERRID (uid_t)2 /* bin */
89 #define ALLOC_ERR_MODE 0100
91 /* Functions */
92 extern int allocate(int optflg, uid_t uid, char *device, char *zonename);
93 extern int deallocate(int optflg, uid_t uid, char *device, char *zonename);
94 extern int list_devices(int optflg, uid_t uid, char *device, char *zonename);
96 #ifdef __cplusplus
98 #endif
100 #endif /* _ALLOCATE_H */