/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _INSTZONES_LIB_H
#define _INSTZONES_LIB_H
/*
* Module: instzones_lib.h
* Group: libinstzones
* Description: This module contains the libinstzones internal data structures,
* constants, and function prototypes. This include should not be
* needed by any external code (consumers of this library).
*/
/*
* required includes
*/
/* System includes */
#include <zone.h>
#include <libzonecfg.h>
#include <libcontract.h>
#include <instzones_api.h>
/*
* C++ prefix
*/
#ifdef __cplusplus
extern "C" {
#endif
/* constants */
/* macros */
/*
* argument array processing type
*/
/*
* This is the "argument array" definition that is returned by _z_new_args
* and is used by _z_add_args, _z_free_args, etc.
*/
struct _argArray_t {
};
/*
* lock objects
*/
/*
* this allows a root path to be prepended to a lock object; e.g.
*/
/* this locks all zones */
/* this locks all packages, in all zones */
/* this locks all patches, in all zones */
/* paths to commands executed by this module */
/* max message size for program output functions (echo, echo debug, progerr) */
/* maximum number of retries when waiting for lock */
/* delay (in seconds) between retries when waiting for lock */
/* Size of buffer increments when reading from pipe */
/*
* These dynamic libraries are required in order to use the zones
* functionality - if these libraries are not available at runtime,
* then zones are assumed to NOT be available, and it is assumed that
* the program is running in the global zone with no non-global zones.
*/
#if defined(LIBZONECFG_PATH)
#else /* defined(LIBZONECFG_PATH) */
#endif /* defined(LIBZONECFG_PATH) */
/*
* Environment values used when running commands within a non-global zone
*/
/* SHELL= */
/* PATH= */
/* error codes */
/*
* zone brand list structure
*/
struct _zoneBrandList {
char *string_ptr;
};
/*
* zone status structure - used to retrieve and hold status of zones
*/
struct _zoneListElement_t {
char *_zlName;
char *_zlPath;
char *_zlScratchName;
};
/*
* User-specified list of zones.
*/
typedef struct zone_spec_s {
} zone_spec_t;
/*
* The global data structure used to hold all of the global (extern) data
* used by this library.
*
* --> THESE DEFINITIONS ARE ORDER DEPENDENT BASED <--
* --> ON THE ORDER OF THE STRUCTURE INITIALIZERS! <--
*/
struct _z_global_data_t {
};
/*
* When _INSTZONES_LIB_Z_DEFINE_GLOBAL_DATA is defined,
* instzones_lib.h will define the z_global_data structure.
* Otherwise an extern to the structure is inserted.
*
* --> THESE DEFINITIONS ARE ORDER DEPENDENT BASED ON <--
* --> THE ORDER OF THE _z_global_data_t STRUCTURE!!! <--
*/
#if defined(_INSTZONES_LIB_Z_DEFINE_GLOBAL_DATA)
/* define and initialize structure */
NULL, /* *_z_ObjectLocks */
"", /* *_z_root_dir */
0, /* _z_SigReceived */
-1, /* _z_ChildProcessId */
NULL, /* *_zone_spec */
NULL, /* _z_echo */
NULL, /* _z_echo_debug */
NULL /* _z_progerr */
};
#else /* !defined(_INSTZONES_LIB__Z_DEFINE_GLOBAL_DATA) */
/* define structure extern */
extern z_global_data_t _z_global_data;
#endif /* defined(_INSTZONES_LIB_Z_DEFINE_GLOBAL_DATA) */
/* function prototypes */
/*
* The following functions can be used by other libs, but not
* by applications.
*/
/* ---> zones_utils.c */
/*PRINTFLIKE1*/
void _z_program_error(char *fmt, ...);
/*PRINTFLIKE1*/
/*PRINTFLIKE1*/
void _z_echoDebug(char *a_fmt, ...);
int _z_is_directory(char *path);
void _z_sig_trap(int a_signo);
/* ---> zones_locks.c */
char *a_lockObject);
char *a_zoneName, char *a_lockObject,
char *a_busyMsg);
char *a_zoneName, char *a_lockObject,
char *a_errMsg);
/* ---> zones_args.c */
/*PRINTFLIKE2*/
/* ---> zones_str.c */
char *a_separators);
int a_index, char *a_separators);
void _z_strRemoveLeadingWhitespace(char **a_str);
int a_bufLen);
char a_separator);
char *a_separators, int a_index);
/*PRINTFLIKE3*/
char *a_format, ...);
/*PRINTFLIKE1*/
char *_z_strPrintf(char *a_format, ...);
/* ---> zones_exec.c */
int *a_fds);
int _zexec(const char *a_zoneName,
int _zexec_init_template(void);
char **_zexec_prep_env();
/*
* C++ postfix
*/
#ifdef __cplusplus
}
#endif
#endif /* _INSTZONES_LIB_H */