ldmsvcs_utils.h revision c3b50bc594edb4e967f0156a09c6e64b845dd8ea
/*
* 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
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LDMSVCS_UTILS_H
#define _LDMSVCS_UTILS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Service Information
*/
typedef struct fds_svc {
char *name;
} fds_svc_t;
/*
* table of registered services
*/
typedef struct fds_reg_svcs {
typedef enum {
CHANNEL_UNINITIALIZED, /* status of channel unknown */
CHANNEL_CLOSED, /* port structure not in use */
CHANNEL_OPEN, /* open but not initialized/reset */
CHANNEL_READY, /* init/reset done */
CHANNEL_UNUSABLE, /* cannot be used (possibly busy) */
CHANNEL_EXIT /* normal exit */
typedef struct fds_channel {
int fd; /* FD for this channel */
/*
* FMA services
*/
typedef struct {
/*
* definition of fma_pri_resp_t is not shown here. for more details,
* see ldmsvcs_utils.c:ldmsvcs_get_core_md().
*/
#define FMA_CPU_REQ_STATUS 0
#define FMA_CPU_REQ_OFFLINE 1
#define FMA_CPU_REQ_ONLINE 2
#define FMA_CPU_RESP_OK 0
#define FMA_CPU_RESP_FAILURE 1
#define FMA_CPU_STAT_ONLINE 0
#define FMA_CPU_STAT_OFFLINE 1
#define FMA_CPU_STAT_ILLEGAL 2
typedef struct {
typedef struct {
#define FMA_MEM_REQ_STATUS 0
#define FMA_MEM_REQ_RETIRE 1
#define FMA_MEM_REQ_RESURRECT 2
#define FMA_MEM_RESP_OK 0
#define FMA_MEM_RESP_FAILURE 1
#define FMA_MEM_STAT_NOTRETIRED 0
#define FMA_MEM_STAT_RETIRED 1
#define FMA_MEM_STAT_ILLEGAL 2
typedef struct {
typedef struct {
struct ldom_hdl {
int major_version;
int service_ldom;
struct ldmsvcs_info *lsinfo;
};
/*
* so that higher levels in the software stack (ex: diagnosis engines)
* are not excessively delayed by ldmd's absence. both timeouts are tunable
* via SMF properties in ldmd's service manifest, and expected to be set
* thusly to appropriate values when ldmd is installed.
*
* timeouts are in seconds. init is the initial timeout; running is
* for subsequent timeouts.
*/
#define LDM_INIT_WAIT_TIME 2
#define LDM_RUNNING_WAIT_TIME 2
#define LDM_SVC_NM "svc:/ldoms/ldmd:default"
#define LDM_PROP_GROUP_NM "fmd_config"
#define LDM_INIT_TO_PROP_NM "fmd_to_ldmd_init_timeout"
#define LDM_RUNNING_TO_PROP_NM "fmd_to_ldmd_running_timeout"
extern int ldmsvcs_check_channel(void);
#ifdef __cplusplus
}
#endif
#endif /* _LDMSVCS_UTILS_H */