2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _FMD_ADM_H
2N/A#define _FMD_ADM_H
2N/A
2N/A#include <fm/fmd_api.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * Fault Management Daemon Administrative Interfaces
2N/A *
2N/A * Note: The contents of this file are private to the implementation of the
2N/A * Solaris system and FMD subsystem and are subject to change at any time
2N/A * without notice. Applications and drivers using these interfaces will fail
2N/A * to run on future releases. These interfaces should not be used for any
2N/A * purpose until they are publicly documented for use outside of Sun.
2N/A */
2N/A
2N/A#define FMD_ADM_VERSION 1 /* library ABI interface version */
2N/A#define FMD_ADM_PROGRAM 0 /* connect library to system fmd */
2N/A
2N/Atypedef struct fmd_adm fmd_adm_t;
2N/A
2N/Aextern fmd_adm_t *fmd_adm_open(const char *, uint32_t, int);
2N/Aextern void fmd_adm_close(fmd_adm_t *);
2N/Aextern const char *fmd_adm_errmsg(fmd_adm_t *);
2N/A
2N/Atypedef struct fmd_adm_stats {
2N/A fmd_stat_t *ams_buf; /* statistics data array */
2N/A uint_t ams_len; /* length of data array */
2N/A} fmd_adm_stats_t;
2N/A
2N/Aextern int fmd_adm_stats_read(fmd_adm_t *, const char *, fmd_adm_stats_t *);
2N/Aextern int fmd_adm_stats_free(fmd_adm_t *, fmd_adm_stats_t *);
2N/A
2N/Atypedef struct fmd_adm_modinfo {
2N/A const char *ami_name; /* string name of module */
2N/A const char *ami_desc; /* module description */
2N/A const char *ami_vers; /* module version */
2N/A uint_t ami_flags; /* flags (see below) */
2N/A} fmd_adm_modinfo_t;
2N/A
2N/A#define FMD_ADM_MOD_FAILED 0x1 /* module has failed */
2N/A
2N/Atypedef int fmd_adm_module_f(const fmd_adm_modinfo_t *, void *);
2N/A
2N/Aextern int fmd_adm_module_iter(fmd_adm_t *, fmd_adm_module_f *, void *);
2N/Aextern int fmd_adm_module_load(fmd_adm_t *, const char *);
2N/Aextern int fmd_adm_module_unload(fmd_adm_t *, const char *);
2N/Aextern int fmd_adm_module_reset(fmd_adm_t *, const char *);
2N/Aextern int fmd_adm_module_stats(fmd_adm_t *, const char *, fmd_adm_stats_t *);
2N/Aextern int fmd_adm_module_gc(fmd_adm_t *, const char *);
2N/A
2N/Atypedef struct fmd_adm_rsrcinfo {
2N/A const char *ari_fmri; /* fmri name of resource */
2N/A const char *ari_uuid; /* uuid name of resource */
2N/A const char *ari_case; /* uuid of case associated w/ state */
2N/A uint_t ari_flags; /* flags (see below) */
2N/A} fmd_adm_rsrcinfo_t;
2N/A
2N/A#define FMD_ADM_RSRC_FAULTY 0x1 /* resource is faulty */
2N/A#define FMD_ADM_RSRC_UNUSABLE 0x2 /* resource is unusable */
2N/A#define FMD_ADM_RSRC_INVISIBLE 0x4 /* resource is not directly visible */
2N/A
2N/Atypedef struct fmd_adm_caseinfo {
2N/A const char *aci_uuid;
2N/A const char *aci_code;
2N/A const char *aci_url;
2N/A nvlist_t *aci_event;
2N/A} fmd_adm_caseinfo_t;
2N/A
2N/Atypedef int fmd_adm_rsrc_f(const fmd_adm_rsrcinfo_t *, void *);
2N/Atypedef int fmd_adm_case_f(const fmd_adm_caseinfo_t *, void *);
2N/A
2N/Aextern int fmd_adm_rsrc_count(fmd_adm_t *, int, uint32_t *);
2N/Aextern int fmd_adm_rsrc_iter(fmd_adm_t *, int, fmd_adm_rsrc_f *, void *);
2N/Aextern int fmd_adm_rsrc_flush(fmd_adm_t *, const char *);
2N/Aextern int fmd_adm_rsrc_repaired(fmd_adm_t *, const char *);
2N/Aextern int fmd_adm_rsrc_replaced(fmd_adm_t *, const char *);
2N/Aextern int fmd_adm_rsrc_acquit(fmd_adm_t *, const char *, const char *);
2N/Aextern int fmd_adm_case_repair(fmd_adm_t *, const char *);
2N/Aextern int fmd_adm_case_acquit(fmd_adm_t *, const char *);
2N/Aextern int fmd_adm_case_iter(fmd_adm_t *, const char *, fmd_adm_case_f *,
2N/A void *);
2N/A
2N/Atypedef struct fmd_adm_serdinfo {
2N/A const char *asi_name; /* name of serd engine */
2N/A uint64_t asi_delta; /* nsecs from oldest event to now */
2N/A uint64_t asi_n; /* N parameter (event count) */
2N/A uint64_t asi_t; /* T parameter (nanoseconds) */
2N/A uint_t asi_count; /* number of events in engine */
2N/A uint_t asi_flags; /* flags (see below) */
2N/A} fmd_adm_serdinfo_t;
2N/A
2N/A#define FMD_ADM_SERD_FIRED 0x1 /* serd engine has fired */
2N/A
2N/Atypedef int fmd_adm_serd_f(const fmd_adm_serdinfo_t *, void *);
2N/A
2N/Aextern int fmd_adm_serd_iter(fmd_adm_t *, const char *,
2N/A fmd_adm_serd_f *, void *);
2N/Aextern int fmd_adm_serd_reset(fmd_adm_t *, const char *, const char *);
2N/A
2N/Atypedef int fmd_adm_xprt_f(id_t, void *);
2N/A
2N/Aextern int fmd_adm_xprt_iter(fmd_adm_t *, fmd_adm_xprt_f *, void *);
2N/Aextern int fmd_adm_xprt_stats(fmd_adm_t *, id_t, fmd_adm_stats_t *);
2N/A
2N/Aextern int fmd_adm_log_rotate(fmd_adm_t *, const char *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _FMD_ADM_H */