fmd_api.h revision 24db46411fd54f70c35b94bb952eb7ba040e43b4
/*
* 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 _FMD_API_H
#define _FMD_API_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libnvpair.h>
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Fault Management Daemon Client Interfaces
*
* Note: The contents of this file are private to the implementation of the
* Solaris system and FMD subsystem and are subject to change at any time
* without notice. Applications and drivers using these interfaces will fail
* to run on future releases. These interfaces should not be used for any
* purpose until they are publicly documented for use outside of Sun.
*/
#define FMD_API_VERSION_1 1
#define FMD_API_VERSION_2 2
#define FMD_API_VERSION_3 3
#define FMD_API_VERSION_4 4
#define FMD_API_VERSION FMD_API_VERSION_4
typedef struct fmd_event fmd_event_t;
typedef struct fmd_case fmd_case_t;
typedef struct fmd_xprt fmd_xprt_t;
struct topo_hdl;
#define FMD_B_FALSE 0 /* false value for booleans as int */
#ifndef MIN
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#endif
#ifndef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
#define FMD_TYPE_BOOL 0 /* int */
typedef struct fmd_prop {
const char *fmdp_name; /* property name */
const char *fmdp_defv; /* default value */
} fmd_prop_t;
typedef struct fmd_stat {
union {
int bool; /* FMD_TYPE_BOOL */
char *str; /* FMD_TYPE_STRING */
} fmds_value;
} fmd_stat_t;
typedef struct fmd_hdl_ops {
void (*fmdo_stats)(fmd_hdl_t *);
#define FMD_SEND_SUCCESS 0 /* fmdo_send queued event */
typedef struct fmd_hdl_info {
const char *fmdi_desc; /* fmd client description string */
const char *fmdi_vers; /* fmd client version string */
extern void fmd_hdl_unregister(fmd_hdl_t *);
extern void fmd_hdl_subscribe(fmd_hdl_t *, const char *);
extern void fmd_hdl_unsubscribe(fmd_hdl_t *, const char *);
extern void fmd_hdl_setspecific(fmd_hdl_t *, void *);
extern void *fmd_hdl_getspecific(fmd_hdl_t *);
extern void fmd_hdl_opendict(fmd_hdl_t *, const char *);
extern char *fmd_hdl_strdup(fmd_hdl_t *, const char *, int);
extern void fmd_hdl_strfree(fmd_hdl_t *, char *);
extern void fmd_hdl_error(fmd_hdl_t *, const char *, ...);
extern void fmd_hdl_debug(fmd_hdl_t *, const char *, ...);
extern char *fmd_prop_get_string(fmd_hdl_t *, const char *);
extern void fmd_prop_free_string(fmd_hdl_t *, char *);
extern void fmd_case_uuclose(fmd_hdl_t *, const char *);
extern int fmd_case_uuclosed(fmd_hdl_t *, const char *);
const char *, void *, size_t);
const char *, const void *, size_t);
extern void fmd_serd_destroy(fmd_hdl_t *, const char *);
extern int fmd_serd_exists(fmd_hdl_t *, const char *);
extern void fmd_serd_reset(fmd_hdl_t *, const char *);
extern int fmd_serd_fired(fmd_hdl_t *, const char *);
extern int fmd_serd_empty(fmd_hdl_t *, const char *);
#ifdef __cplusplus
}
#endif
#endif /* _FMD_API_H */