xref: /titanic_52/usr/src/cmd/fm/modules/common/eversholt/fme.h (revision 930176a00b697a09f5256ff3d4b1550f8e73c3a6)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  *
26  * fme.h -- public definitions for fme module
27  *
28  * this module supports the management of a "fault management exercise".
29  */
30 
31 #ifndef	_EFT_FME_H
32 #define	_EFT_FME_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 #include <fm/fmd_api.h>
37 
38 #ifdef	__cplusplus
39 extern "C" {
40 #endif
41 
42 #define	UNDIAGNOSABLE_DEFECT	"defect.sunos.eft.undiagnosable_problem"
43 #define	UNDIAG_REASON		"reason"
44 
45 /* Undiagnosable reason strings */
46 #define	UD_MISSINGPATH	"bad or missing path in persisted observation"
47 #define	UD_MISSINGINFO	"buffer persisting case info is AWOL"
48 #define	UD_MISSINGZERO	"buffer persisting principal ereport is AWOL"
49 #define	UD_CFGMISMATCH	"persisted config buffer size != actual size"
50 #define	UD_MISSINGOBS	"buffer persisting an observation is AWOL"
51 #define	UD_BADEVENTF	"ereport event not found in fault tree"
52 #define	UD_BADEVENTI	"ereport zero not found in instance tree"
53 #define	UD_INSTFAIL	"creation of instance tree failed"
54 #define	UD_UNSOLVD	"all hypotheses disproved"
55 #define	UD_BADOBS	"persisted observation not found in instance tree"
56 #define	UD_NOPATH	"no path to component found in ereport"
57 #define	UD_NOCONF	"no configuration information to build instance tree"
58 #define	UD_MAXFME	"reached the maximum number of open FMEs (maxfme)"
59 
60 #define	WOBUF_CFGLEN	"rawcfglen"
61 #define	WOBUF_POSTD	"posted"
62 #define	WOBUF_NOBS	"observations"
63 #define	WOBUF_PULL	"timewaited"
64 #define	WOBUF_CFG	"rawcfgdata"
65 #define	WOBUF_ID	"fmeid"
66 #define	WOBUF_ISTATS	"istats"
67 
68 struct lut *Istats;	/* instanced stats a la "count=" */
69 
70 struct fme;
71 
72 void fme_receive_external_report(fmd_hdl_t *hdl, fmd_event_t *ffep,
73     nvlist_t *nvl, const char *eventstring);
74 void fme_restart(fmd_hdl_t *hdl, fmd_case_t *inprogress);
75 void fme_istat_load(fmd_hdl_t *hdl);
76 void fme_close_case(fmd_hdl_t *hdl, fmd_case_t *fmcase);
77 void fme_timer_fired(struct fme *, id_t);
78 void fme_status(int flags);
79 void fme_fini(void);
80 void istat_fini(void);
81 
82 struct istat_entry {
83 	const char *ename;
84 	const struct ipath *ipath;
85 };
86 int istat_cmp(struct istat_entry *ent1, struct istat_entry *ent2);
87 
88 #ifdef	__cplusplus
89 }
90 #endif
91 
92 #endif	/* _EFT_FME_H */
93