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