xref: /titanic_44/usr/src/lib/libzonecfg/common/zonecfg_impl.h (revision 555afedfc38adf0cc5fbc1de696dc811973eaaca)
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
5*555afedfScarlsonj  * Common Development and Distribution License (the "License").
6*555afedfScarlsonj  * 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 /*
22*555afedfScarlsonj  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef _ZONECFG_IMPL_H
277c478bd9Sstevel@tonic-gate #define	_ZONECFG_IMPL_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
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>
36*555afedfScarlsonj #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 
427c478bd9Sstevel@tonic-gate typedef enum {
437c478bd9Sstevel@tonic-gate 	PZE_MODIFY = -1,
447c478bd9Sstevel@tonic-gate 	PZE_REMOVE = 0,
457c478bd9Sstevel@tonic-gate 	PZE_ADD = 1
467c478bd9Sstevel@tonic-gate } zoneent_op_t;
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_CONFIGURED	"configured"
497c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_INCOMPLETE	"incomplete"
507c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_INSTALLED	"installed"
517c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_READY		"ready"
52108322fbScarlsonj #define	ZONE_STATE_STR_MOUNTED		"mounted"
537c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_RUNNING		"running"
547c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_SHUTTING_DOWN	"shutting_down"
557c478bd9Sstevel@tonic-gate #define	ZONE_STATE_STR_DOWN		"down"
567c478bd9Sstevel@tonic-gate 
57108322fbScarlsonj /*
58108322fbScarlsonj  * ":::\n" => 4, no need to count '\0' as ZONENAME_MAX covers that.
59108322fbScarlsonj  *
60*555afedfScarlsonj  * Note that ZONE_STATE_MAXSTRLEN, MAXPATHLEN, and UUID_PRINTABLE_STRING_LENGTH
61*555afedfScarlsonj  * all include a NUL byte, and this extra count of 2 bytes covers the quotes
62*555afedfScarlsonj  * that may be placed around the path plus one more.
63108322fbScarlsonj  */
64108322fbScarlsonj #define	MAX_INDEX_LEN	(ZONENAME_MAX + ZONE_STATE_MAXSTRLEN + MAXPATHLEN + \
65*555afedfScarlsonj 			UUID_PRINTABLE_STRING_LENGTH + 3)
667c478bd9Sstevel@tonic-gate 
67108322fbScarlsonj #define	ZONE_INDEX_LOCK_DIR	ZONE_SNAPSHOT_ROOT
68108322fbScarlsonj #define	ZONE_INDEX_LOCK_FILE	"/index.lock"
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate #define	ZONE_SNAPSHOT_ROOT	ZONES_TMPDIR
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate extern int putzoneent(struct zoneent *, zoneent_op_t);
73108322fbScarlsonj extern char *zonecfg_root;
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
767c478bd9Sstevel@tonic-gate }
777c478bd9Sstevel@tonic-gate #endif
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate #endif	/* _ZONECFG_IMPL_H */
80