xref: /titanic_41/usr/src/cmd/fm/fmd/common/fmd_protocol.h (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_FMD_PROTOCOL_H
28 #define	_FMD_PROTOCOL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/fm/protocol.h>
33 #include <libnvpair.h>
34 #include <stdarg.h>
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #define	FMD_RSRC_CLASS		"resource.sunos.fmd."
41 #define	FMD_RSRC_CLASS_LEN	(sizeof (FMD_RSRC_CLASS) - 1)
42 #define	FMD_RSRC_ADDHRT		FMD_RSRC_CLASS "clock.addhrtime"
43 
44 #define	FMD_RSRC_ADDHRT_VERS1	1
45 #define	FMD_RSRC_ADDHRT_DELTA	"delta"
46 
47 #define	FMD_FLT_NOSUB	"defect.sunos.fmd.nosub"
48 #define	FMD_FLT_NODC	"defect.sunos.fmd.nodiagcode"
49 #define	FMD_FLT_MOD	"defect.sunos.fmd.module"
50 #define	FMD_FLT_CONF	"defect.sunos.fmd.config"
51 
52 #define	FMD_ERR_CLASS	"ereport.sunos.fmd."
53 
54 #define	FMD_ERR_MOD_MSG		"msg"
55 #define	FMD_ERR_MOD_ERRNO	"errno"
56 #define	FMD_ERR_MOD_ERRCLASS	"errclass"
57 
58 struct fmd_module;			/* see <fmd_module.h> */
59 
60 extern nvlist_t *fmd_protocol_authority(void);
61 extern nvlist_t *fmd_protocol_fmri_module(struct fmd_module *);
62 extern nvlist_t *fmd_protocol_fault(const char *,
63     uint8_t, nvlist_t *, nvlist_t *, nvlist_t *);
64 extern nvlist_t *fmd_protocol_suspects(nvlist_t *,
65     const char *, const char *, uint_t, nvlist_t **, int);
66 extern nvlist_t *fmd_protocol_resource(const char *,
67     nvlist_t *, const char *, boolean_t, boolean_t, boolean_t, nvlist_t *);
68 extern nvlist_t *fmd_protocol_fmderror(int, const char *, va_list);
69 extern nvlist_t *fmd_protocol_moderror(struct fmd_module *, int, const char *);
70 
71 #ifdef	__cplusplus
72 }
73 #endif
74 
75 #endif	/* _FMD_PROTOCOL_H */
76