/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
*/
/*
* Copyright (c) 2000-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _RCM_SCRIPT_IMPL_H
#define _RCM_SCRIPT_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define FALSE 0
/* Minimum and maximum rcm scripting API version supported. */
/*
* Default maximum time (in seconds) allocated for an rcm command
* before SIGABRT is sent.
*/
/*
* Maximum time (in seconds) allocated after sending SIGABRT before
* the script is killed.
*/
/*
* Maximum time (in seconds) for which the rcm daemon checks whether
* a script is killed or not after the rcm daemon kills the script.
*/
/* Maximum number of command line parameters passed to a script */
/* Maximum number of environment parameters passed to a script */
/* exit codes */
typedef enum {
/* This structure is used to maintain a list of current dr'ed resources */
typedef struct {
char *resource_name;
} drreq_t;
/*
* Main data structure for rcm scripting. There will be one instance of
* this structure for every rcm script. A pointer to this structure is
* kept in module structure.
*/
typedef struct script_info {
/*
* Used to maintain a queue of script_info structures
* Global variable script_info_q is the head of the queue.
*/
/*
* file descriptors used to communicate with the script
* pipe1 is used to capture script's stdout
* pipe2 is used to capture script's stderr
*/
/*
* Lock to protect the fileds in this structure and also to protect
* the communication channel to the script.
*/
/* time stamp of the script when it was last run */
char *func_info_buf;
char *func_info_buf_curptr;
int func_info_buf_len;
char *resource_usage_info_buf;
char *failure_reason_buf;
char *failure_reason_buf_curptr;
/*
* script_info_t:flags
*/
#define PARENT_END_OF_PIPE 0
typedef struct state_element {
/* followed by actual state element */
/*
* state_element_t:flags
* The following flag when set indicates that the state element is
* currently in use. When not set indicates that the state element is free.
*/
/*
* This structure defines the layout of state file used by rcm scripting
*/
typedef struct state_file {
/* followed by an array of state elements of type state_element_t */
} state_file_t;
typedef struct state_file_descr {
/*
* number of state elements to allocate at a time when the state file
* grows.
*/
int chunk_size;
/*
* index into the state element array where the next search will
* begin for an empty slot.
*/
int index;
/* pointer to mmapped state file */
/* round up to n byte boundary. n must be power of 2 for this macro to work */
typedef struct ps_state_element {
/* maximum number of additional env variables for capacity specific stuff */
typedef struct capacity_descr {
char *resource_name;
int match_type;
struct {
char *nvname;
char *envname;
/* capacity_descr_t:match_type */
#define MATCH_INVALID 0
#ifdef __cplusplus
}
#endif
#endif /* _RCM_SCRIPT_IMPL_H */