xref: /titanic_52/usr/src/cmd/fm/fmd/common/fmd_protocol.h (revision b6c3f7863936abeae522e48a13887dddeb691a45)
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 2007 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		FM_RSRC_CLASS ".fm."
41 #define	FMD_CTL_CLASS		FMD_RSRC_CLASS "fmd."
42 
43 #define	FMD_RSRC_CLASS_LEN	(sizeof (FMD_RSRC_CLASS) - 1)
44 #define	FMD_CTL_CLASS_LEN	(sizeof (FMD_CTL_CLASS) - 1)
45 
46 #define	FMD_CTL_ADDHRT		FMD_CTL_CLASS "clock.addhrtime"
47 #define	FMD_CTL_ADDHRT_VERS1	1
48 #define	FMD_CTL_ADDHRT_DELTA	"delta"
49 
50 /*
51  * The FMD_FLT_* events still use defect.sunos.* for now: a future registry
52  * putback should define all fmd events and convert these to defect.fm.fmd.*
53  */
54 #define	FMD_FLT_NOSUB		"defect.sunos.fmd.nosub"
55 #define	FMD_FLT_NODC		"defect.sunos.fmd.nodiagcode"
56 #define	FMD_FLT_MOD		"defect.sunos.fmd.module"
57 #define	FMD_FLT_CONF		"defect.sunos.fmd.config"
58 
59 #define	FMD_ERR_CLASS		"ereport.fm.fmd."
60 #define	FMD_ERR_CLASS_LEN	(sizeof (FMD_ERR_CLASS) - 1)
61 
62 #define	FMD_ERR_MOD_MSG		"msg"
63 #define	FMD_ERR_MOD_ERRNO	"errno"
64 #define	FMD_ERR_MOD_ERRCLASS	"errclass"
65 
66 struct fmd_module;			/* see <fmd_module.h> */
67 
68 extern nvlist_t *fmd_protocol_authority(void);
69 extern nvlist_t *fmd_protocol_fmri_module(struct fmd_module *);
70 extern nvlist_t *fmd_protocol_fault(const char *,
71     uint8_t, nvlist_t *, nvlist_t *, nvlist_t *, const char *);
72 extern nvlist_t *fmd_protocol_list(const char *, nvlist_t *,
73     const char *, const char *, uint_t, nvlist_t **, uint8_t *, int,
74     struct timeval *);
75 extern nvlist_t *fmd_protocol_rsrc_asru(const char *, nvlist_t *,
76     const char *, const char *, boolean_t, boolean_t, boolean_t, nvlist_t *,
77     struct timeval *);
78 extern nvlist_t *fmd_protocol_fmderror(int, const char *, va_list);
79 extern nvlist_t *fmd_protocol_moderror(struct fmd_module *, int, const char *);
80 extern nvlist_t *fmd_protocol_xprt_ctl(struct fmd_module *,
81     const char *, uint8_t);
82 extern nvlist_t *fmd_protocol_xprt_sub(struct fmd_module *,
83     const char *, uint8_t, const char *);
84 extern nvlist_t *fmd_protocol_xprt_uuclose(struct fmd_module *,
85     const char *, uint8_t, const char *);
86 
87 #ifdef	__cplusplus
88 }
89 #endif
90 
91 #endif	/* _FMD_PROTOCOL_H */
92