xref: /titanic_52/usr/src/cmd/fm/fmd/common/fmd_builtin.h (revision 494f7e12a62129ef191a15f9dfde6b7abe3bf510)
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 /*
23  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24  */
25 
26 #ifndef	_FMD_BUILTIN_H
27 #define	_FMD_BUILTIN_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 #include <fmd_module.h>
34 #include <fmd_api.h>
35 
36 /*
37  * fmd_builtin.h
38  *
39  * This header file provides prototypes for any built-in diagnosis engines and
40  * agents that are compiled directly into fmd.  Prototypes for their init and
41  * fini routines can be added here and corresponding linkage information to
42  * these functions should be added to the table found in fmd_builtin.c.
43  */
44 
45 typedef struct fmd_builtin {
46 	const char *bltin_name;
47 	void (*bltin_init)(fmd_hdl_t *);
48 	void (*bltin_fini)(fmd_hdl_t *);
49 	int bltin_ctxts;
50 } fmd_builtin_t;
51 
52 #define	FMD_BUILTIN_CTXT_GLOBALZONE	0x1
53 #define	FMD_BUILTIN_CTXT_NONGLOBALZONE	0x2
54 
55 #define	FMD_BUILTIN_ALLCTXT \
56 	(FMD_BUILTIN_CTXT_GLOBALZONE | FMD_BUILTIN_CTXT_NONGLOBALZONE)
57 
58 extern int fmd_builtin_loadall(fmd_modhash_t *);
59 
60 extern void self_init(fmd_hdl_t *);	/* see fmd_self.c */
61 extern void self_fini(fmd_hdl_t *);	/* see fmd_self.c */
62 
63 extern void sysev_init(fmd_hdl_t *);	/* see fmd_transport.c */
64 extern void sysev_fini(fmd_hdl_t *);	/* see fmd_transport.c */
65 
66 #ifdef	__cplusplus
67 }
68 #endif
69 
70 #endif	/* _FMD_BUILTIN_H */
71