10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*2303Scarlsonj * Common Development and Distribution License (the "License"). 6*2303Scarlsonj * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*2303Scarlsonj * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _ZONECFG_IMPL_H 270Sstevel@tonic-gate #define _ZONECFG_IMPL_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #ifdef __cplusplus 320Sstevel@tonic-gate extern "C" { 330Sstevel@tonic-gate #endif 340Sstevel@tonic-gate 350Sstevel@tonic-gate #include <zone.h> 36*2303Scarlsonj #include <sys/uuid.h> 370Sstevel@tonic-gate 380Sstevel@tonic-gate #if !defined(TEXT_DOMAIN) /* should be defined by cc -D */ 390Sstevel@tonic-gate #define TEXT_DOMAIN "SYS_TEST" /* Use this only if it wasn't */ 400Sstevel@tonic-gate #endif 410Sstevel@tonic-gate 420Sstevel@tonic-gate typedef enum { 430Sstevel@tonic-gate PZE_MODIFY = -1, 440Sstevel@tonic-gate PZE_REMOVE = 0, 450Sstevel@tonic-gate PZE_ADD = 1 460Sstevel@tonic-gate } zoneent_op_t; 470Sstevel@tonic-gate 480Sstevel@tonic-gate #define ZONE_STATE_STR_CONFIGURED "configured" 490Sstevel@tonic-gate #define ZONE_STATE_STR_INCOMPLETE "incomplete" 500Sstevel@tonic-gate #define ZONE_STATE_STR_INSTALLED "installed" 510Sstevel@tonic-gate #define ZONE_STATE_STR_READY "ready" 52766Scarlsonj #define ZONE_STATE_STR_MOUNTED "mounted" 530Sstevel@tonic-gate #define ZONE_STATE_STR_RUNNING "running" 540Sstevel@tonic-gate #define ZONE_STATE_STR_SHUTTING_DOWN "shutting_down" 550Sstevel@tonic-gate #define ZONE_STATE_STR_DOWN "down" 560Sstevel@tonic-gate 57766Scarlsonj /* 58766Scarlsonj * ":::\n" => 4, no need to count '\0' as ZONENAME_MAX covers that. 59766Scarlsonj * 60*2303Scarlsonj * Note that ZONE_STATE_MAXSTRLEN, MAXPATHLEN, and UUID_PRINTABLE_STRING_LENGTH 61*2303Scarlsonj * all include a NUL byte, and this extra count of 2 bytes covers the quotes 62*2303Scarlsonj * that may be placed around the path plus one more. 63766Scarlsonj */ 64766Scarlsonj #define MAX_INDEX_LEN (ZONENAME_MAX + ZONE_STATE_MAXSTRLEN + MAXPATHLEN + \ 65*2303Scarlsonj UUID_PRINTABLE_STRING_LENGTH + 3) 660Sstevel@tonic-gate 67766Scarlsonj #define ZONE_INDEX_LOCK_DIR ZONE_SNAPSHOT_ROOT 68766Scarlsonj #define ZONE_INDEX_LOCK_FILE "/index.lock" 690Sstevel@tonic-gate 700Sstevel@tonic-gate #define ZONE_SNAPSHOT_ROOT ZONES_TMPDIR 710Sstevel@tonic-gate 720Sstevel@tonic-gate extern int putzoneent(struct zoneent *, zoneent_op_t); 73766Scarlsonj extern char *zonecfg_root; 740Sstevel@tonic-gate 750Sstevel@tonic-gate #ifdef __cplusplus 760Sstevel@tonic-gate } 770Sstevel@tonic-gate #endif 780Sstevel@tonic-gate 790Sstevel@tonic-gate #endif /* _ZONECFG_IMPL_H */ 80