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
5555afedfScarlsonj  * Common Development and Distribution License (the "License").
6555afedfScarlsonj  * 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  */
217c478bd9Sstevel@tonic-gate /*
22555afedfScarlsonj  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
24*a28480feSAndy Fiddaman  *
25*a28480feSAndy Fiddaman  * Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate #ifndef _ZONECFG_IMPL_H
297c478bd9Sstevel@tonic-gate #define	_ZONECFG_IMPL_H
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #include <zone.h>
36555afedfScarlsonj #include <sys/uuid.h>
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate #if !defined(TEXT_DOMAIN)		/* should be defined by cc -D */
397c478bd9Sstevel@tonic-gate #define	TEXT_DOMAIN	"SYS_TEST"	/* Use this only if it wasn't */
407c478bd9Sstevel@tonic-gate #endif
417c478bd9Sstevel@tonic-gate 
42*a28480feSAndy Fiddaman #define	ZONEADMD_PATH	"/usr/sbin:/usr/bin"
43*a28480feSAndy Fiddaman 
447c478bd9Sstevel@tonic-gate typedef enum {
457c478bd9Sstevel@tonic-gate 	PZE_MODIFY = -1,
467c478bd9Sstevel@tonic-gate 	PZE_REMOVE = 0,
477c478bd9Sstevel@tonic-gate 	PZE_ADD = 1
487c478bd9Sstevel@tonic-gate } zoneent_op_t;
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_CONFIGURED	"configured"
517c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_INCOMPLETE	"incomplete"
527c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_INSTALLED	"installed"
537c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_READY		"ready"
54108322fbScarlsonj #define	ZONE_STATE_STR_MOUNTED		"mounted"
557c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_RUNNING		"running"
567c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_SHUTTING_DOWN	"shutting_down"
577c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_DOWN		"down"
587c478bd9Sstevel@tonic-gate 
59108322fbScarlsonj /*
60108322fbScarlsonj  * ":::\n" => 4, no need to count '\0' as ZONENAME_MAX covers that.
61108322fbScarlsonj  *
62555afedfScarlsonj  * Note that ZONE_STATE_MAXSTRLEN, MAXPATHLEN, and UUID_PRINTABLE_STRING_LENGTH
63555afedfScarlsonj  * all include a NUL byte, and this extra count of 2 bytes covers the quotes
64555afedfScarlsonj  * that may be placed around the path plus one more.
65108322fbScarlsonj  */
66108322fbScarlsonj #define	MAX_INDEX_LEN	(ZONENAME_MAX + ZONE_STATE_MAXSTRLEN + MAXPATHLEN + \
67555afedfScarlsonj 			UUID_PRINTABLE_STRING_LENGTH + 3)
687c478bd9Sstevel@tonic-gate 
69108322fbScarlsonj #define	ZONE_INDEX_LOCK_DIR	ZONE_SNAPSHOT_ROOT
70108322fbScarlsonj #define	ZONE_INDEX_LOCK_FILE	"/index.lock"
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate #define	ZONE_SNAPSHOT_ROOT	ZONES_TMPDIR
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate extern int putzoneent(struct zoneent *, zoneent_op_t);
75108322fbScarlsonj extern char *zonecfg_root;
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
787c478bd9Sstevel@tonic-gate }
797c478bd9Sstevel@tonic-gate #endif
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate #endif	/* _ZONECFG_IMPL_H */
82