xref: /titanic_52/usr/src/cmd/fm/fmd/common/fmd_protocol.h (revision 9512fe850e98fdd448c638ca63fdd92a8a510255)
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 /*
24  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
25  * Use is subject to license terms.
26  */
27 
28 #ifndef	_FMD_PROTOCOL_H
29 #define	_FMD_PROTOCOL_H
30 
31 #pragma ident	"%Z%%M%	%I%	%E% SMI"
32 
33 #include <sys/fm/protocol.h>
34 #include <libnvpair.h>
35 #include <stdarg.h>
36 
37 #ifdef	__cplusplus
38 extern "C" {
39 #endif
40 
41 #define	FMD_RSRC_CLASS		FM_RSRC_CLASS ".fm."
42 #define	FMD_CTL_CLASS		FMD_RSRC_CLASS "fmd."
43 
44 #define	FMD_RSRC_CLASS_LEN	(sizeof (FMD_RSRC_CLASS) - 1)
45 #define	FMD_CTL_CLASS_LEN	(sizeof (FMD_CTL_CLASS) - 1)
46 
47 #define	FMD_CTL_ADDHRT		FMD_CTL_CLASS "clock.addhrtime"
48 #define	FMD_CTL_ADDHRT_VERS1	1
49 #define	FMD_CTL_ADDHRT_DELTA	"delta"
50 
51 /*
52  * The FMD_FLT_* events still use defect.sunos.* for now: a future registry
53  * putback should define all fmd events and convert these to defect.fm.fmd.*
54  */
55 #define	FMD_FLT_NOSUB		"defect.sunos.fmd.nosub"
56 #define	FMD_FLT_NODC		"defect.sunos.fmd.nodiagcode"
57 #define	FMD_FLT_MOD		"defect.sunos.fmd.module"
58 #define	FMD_FLT_CONF		"defect.sunos.fmd.config"
59 
60 #define	FMD_ERR_CLASS		"ereport.fm.fmd."
61 #define	FMD_ERR_CLASS_LEN	(sizeof (FMD_ERR_CLASS) - 1)
62 
63 #define	FMD_ERR_MOD_MSG		"msg"
64 #define	FMD_ERR_MOD_ERRNO	"errno"
65 #define	FMD_ERR_MOD_ERRCLASS	"errclass"
66 
67 struct fmd_module;			/* see <fmd_module.h> */
68 
69 extern nvlist_t *fmd_protocol_authority(void);
70 extern nvlist_t *fmd_protocol_fmri_module(struct fmd_module *);
71 extern nvlist_t *fmd_protocol_fault(const char *,
72     uint8_t, nvlist_t *, nvlist_t *, nvlist_t *);
73 extern nvlist_t *fmd_protocol_list(const char *, nvlist_t *,
74     const char *, const char *, uint_t, nvlist_t **, uint8_t *, int);
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 extern nvlist_t *fmd_protocol_fmderror(int, const char *, va_list);
78 extern nvlist_t *fmd_protocol_moderror(struct fmd_module *, int, const char *);
79 extern nvlist_t *fmd_protocol_xprt_ctl(struct fmd_module *,
80     const char *, uint8_t);
81 extern nvlist_t *fmd_protocol_xprt_sub(struct fmd_module *,
82     const char *, uint8_t, const char *);
83 extern nvlist_t *fmd_protocol_xprt_uuclose(struct fmd_module *,
84     const char *, uint8_t, const char *);
85 
86 #ifdef	__cplusplus
87 }
88 #endif
89 
90 #endif	/* _FMD_PROTOCOL_H */
91