usr/src/cmd/allocate/allocate.h
changeset 1676 37f4a3e2bd99
parent 1269 f33c74eed274
child 4514 0ba804e879d8
equal deleted inserted replaced
1675:5791e75682d0 1676:37f4a3e2bd99
     1 /*
     1 /*
     2  * CDDL HEADER START
     2  * CDDL HEADER START
     3  *
     3  *
     4  * The contents of this file are subject to the terms of the
     4  * The contents of this file are subject to the terms of the
     5  * Common Development and Distribution License, Version 1.0 only
     5  * Common Development and Distribution License (the "License").
     6  * (the "License").  You may not use this file except in compliance
     6  * You may not use this file except in compliance with the License.
     7  * with the License.
       
     8  *
     7  *
     9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
    10  * or http://www.opensolaris.org/os/licensing.
     9  * or http://www.opensolaris.org/os/licensing.
    11  * See the License for the specific language governing permissions
    10  * See the License for the specific language governing permissions
    12  * and limitations under the License.
    11  * and limitations under the License.
    17  * fields enclosed by brackets "[]" replaced with your own identifying
    16  * fields enclosed by brackets "[]" replaced with your own identifying
    18  * information: Portions Copyright [yyyy] [name of copyright owner]
    17  * information: Portions Copyright [yyyy] [name of copyright owner]
    19  *
    18  *
    20  * CDDL HEADER END
    19  * CDDL HEADER END
    21  */
    20  */
       
    21 
    22 /*
    22 /*
    23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    24  * Use is subject to license terms.
    24  * Use is subject to license terms.
    25  */
    25  */
    26 
    26 
    32 #ifdef	__cplusplus
    32 #ifdef	__cplusplus
    33 extern "C" {
    33 extern "C" {
    34 #endif
    34 #endif
    35 
    35 
    36 /* Option Flags */
    36 /* Option Flags */
    37 #define	SILENT		0001	/* -s */
    37 #define	LISTATTRS	0x00000001	/* -a */
    38 #define	USERID		0002	/* -U <uid> for list_devices(1) */
    38 #define	LISTDEFS	0x00000002	/* -d */
    39 #define	LIST		0004	/* -l */
    39 #define	TYPE		0x00000004	/* -g */
    40 #define	FREE		0010	/* -n */
    40 #define	LISTALL		0x00000008	/* -l */
    41 #define	CURRENT 	0020	/* -u */
    41 #define	LISTFREE	0x00000010	/* -n */
    42 #define	FORCE		0040	/* -F */
    42 #define	SILENT		0x00000020	/* -s */
    43 #define	FORCE_ALL 	0100	/* -I */
    43 #define	LISTALLOC 	0x00000040	/* -u */
    44 #define	TYPE		0200	/* -g */
    44 #define	WINDOWING	0x00000080	/* -w */
    45 #define	USERNAME	0400	/* -U <username> for allocate(1) */
    45 #define	ZONENAME	0x00000100	/* -z */
       
    46 #define	BOOT		0x00000200	/* -B */
       
    47 #define	FORCE		0x00000400	/* -F */
       
    48 #define	FORCE_ALL 	0x00000800	/* -I */
       
    49 #define	USERID		0x00001000	/* -U for list_devices */
       
    50 #define	USERNAME	0x00002000	/* -U for allocate */
    46 
    51 
    47 /* Misc. */
    52 /* Misc. */
    48 
    53 
    49 #define	ALL	-1
    54 #define	CLEAN_MOUNT		11	/* Also defined in disk_clean.sh */
    50 
    55 
    51 /* Error returns start at 4 */
    56 #define	ALLOCUERR		1
    52 #define	SYSERROR	4
    57 #define	CHOWNERR		2
    53 #define	DACLCK		5
    58 #define	CLEANERR		3
    54 #define	DACACC		6
    59 #define	CNTDEXECERR		4
    55 #define	DEVLST		7
    60 #define	CNTFRCERR		5
    56 #define	NALLOCU		8
    61 #define	DACACCERR		6
    57 #define	NOTAUTH		9
    62 #define	DAOFFERR		7
    58 #define	CNTFRC		10
    63 #define	DAUTHERR		8
    59 #define	CNTDEXEC	11
    64 #define	DEFATTRSERR		9
    60 #define	NO_DEVICE	12
    65 #define	DEVLKERR		10
    61 #define	DSPMISS		13
    66 #define	DEVLONGERR		11
    62 #define	ALLOCERR	14
    67 #define	DEVNALLOCERR		12
    63 #define	IMPORT_ERR	15
    68 #define	DEVNAMEERR		13
    64 #define	NODAENT		16
    69 #define	DEVSTATEERR		14
    65 #define	NODMAPENT	17
    70 #define	DEVZONEERR		15
    66 #define	SETACL_PERR	18
    71 #define	DSPMISSERR		16
    67 #define	CHOWN_PERR	19
    72 #define	GLOBALERR		17
    68 #define	ALLOC		20
    73 #define	LABELRNGERR		18
    69 #define	ALLOC_OTHER	21
    74 #define	LOGINDEVPERMERR		19
    70 #define	NALLOC		22
    75 #define	NODAERR			20
    71 #define	AUTHERR		23
    76 #define	NODMAPERR		21
    72 #define	CLEAN_ERR	24
    77 #define	PREALLOCERR		22
    73 #define	DEVNAME_ERR	25
    78 #define	SETACLERR		23
    74 #define	DEVNAME_TOOLONG	26
    79 #define	UAUTHERR		24
       
    80 #define	ZONEERR			25
    75 
    81 
    76 /* Tunable Parameters */
       
    77 #define	DEV_DIR		"/dev"
       
    78 #define	DAC_DIR		"/etc/security/dev"
       
    79 #define	SECLIB		"/etc/security/lib"
       
    80 #define	ALLOC_MODE	0600
       
    81 #define	DEALLOC_MODE    0000
       
    82 #define	ALLOC_ERR_MODE  0100
    82 #define	ALLOC_ERR_MODE  0100
    83 #define	ALLOC_UID	(uid_t)0	/* root */
    83 #define	ALLOC_INVALID	0700
    84 #define	ALLOC_GID	(gid_t)1	/* other */
       
    85 
    84 
    86 /* Functions */
    85 /* Functions */
    87 extern int allocate(int optflg, uid_t uid, char *device);
    86 extern int allocate(int optflg, uid_t uid, char *device, char *zonename);
    88 extern int deallocate(int optflg, uid_t uid, char *device);
    87 extern int deallocate(int optflg, uid_t uid, char *device, char *zonename);
    89 extern int list_devices(int optflg, uid_t uid, char *device);
    88 extern int list_devices(int optflg, uid_t uid, char *device, char *zonename);
    90 
    89 
    91 #ifdef	__cplusplus
    90 #ifdef	__cplusplus
    92 }
    91 }
    93 #endif
    92 #endif
    94 
    93