fmd.h revision 93136fe2d5021b7255af0cb18c382f9e93445eb1
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FMD_H
#define _FMD_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libnvpair.h>
#include <pthread.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <fmd_list.h>
#include <fmd_time.h>
#include <fmd_api.h>
struct fmd_conf; /* see <fmd_conf.h> */
struct fmd_dispq; /* see <fmd_dispq.h> */
struct fmd_timerq; /* see <fmd_timerq.h> */
struct fmd_asru_hash; /* see <fmd_asru.h> */
struct fmd_scheme_hash; /* see <fmd_fmri.h> */
struct fmd_case_hash; /* see <fmd_case.h> */
struct fmd_modhash; /* see <fmd_module.h> */
struct fmd_module; /* see <fmd_module.h> */
struct fmd_idspace; /* see <fmd_idspace.h> */
typedef struct fmd_statistics {
typedef struct fmd {
const char *d_pname; /* basename to use for messages */
volatile int d_signal; /* signal indicating we should quit */
volatile int d_running; /* flag set when fmd_run() succeeds */
volatile int d_booted; /* flag set when fmd_run() completes */
char *volatile d_panicstr; /* pointer to formatted panic message */
void *d_clockptr; /* system clock private data */
void (*d_thr_trace)(); /* thread trace buffer function */
const char *d_rootdir; /* root directory path */
const char *d_platform; /* platform name (uname -i) */
const char *d_machine; /* machine class name (uname -m) */
const char *d_isaname; /* processor ISA name (uname -p) */
} fmd_t;
/*
* Exit status values used for the few places within fmd where we exit(2) or
* return from main(). fmd only exits if a fatal error occurs during startup;
* if anything else happens errors are reported and we just keep trucking.
*/
#define FMD_EXIT_SUCCESS 0 /* successful execution of daemon */
/*
* Values associated with fmd's client.error property, stored as a uint32_t.
* By default, we unload bad clients; other values are for use by developers.
*/
#define FMD_CERROR_UNLOAD 0 /* unload module on error (default) */
/*
* Values associated with any *dbout (debug output sink) property, stored as
* a uint32_t. Currently we permit syslog output and stderr output.
*/
extern const char _fmd_version[];
extern void fmd_door_server(void *);
extern void fmd_create(fmd_t *, const char *, const char *, const char *);
extern void fmd_destroy(fmd_t *);
#ifdef __cplusplus
}
#endif
#endif /* _FMD_H */