xref: /onnv-gate/usr/src/cmd/fm/fmd/common/fmd_protocol.h (revision 10928:eb060666c73f)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
53323Scindi  * Common Development and Distribution License (the "License").
63323Scindi  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
211193Smws 
220Sstevel@tonic-gate /*
239120SStephen.Hanson@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	_FMD_PROTOCOL_H
280Sstevel@tonic-gate #define	_FMD_PROTOCOL_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #include <sys/fm/protocol.h>
310Sstevel@tonic-gate #include <libnvpair.h>
320Sstevel@tonic-gate #include <stdarg.h>
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #ifdef	__cplusplus
350Sstevel@tonic-gate extern "C" {
360Sstevel@tonic-gate #endif
370Sstevel@tonic-gate 
381193Smws #define	FMD_RSRC_CLASS		FM_RSRC_CLASS ".fm."
391193Smws #define	FMD_CTL_CLASS		FMD_RSRC_CLASS "fmd."
407171Seschrock #define	SYSEVENT_RSRC_CLASS	FM_RSRC_CLASS ".sysevent."
411193Smws 
420Sstevel@tonic-gate #define	FMD_RSRC_CLASS_LEN	(sizeof (FMD_RSRC_CLASS) - 1)
431193Smws #define	FMD_CTL_CLASS_LEN	(sizeof (FMD_CTL_CLASS) - 1)
447171Seschrock #define	SYSEVENT_RSRC_CLASS_LEN	(sizeof (SYSEVENT_RSRC_CLASS) - 1)
450Sstevel@tonic-gate 
461193Smws #define	FMD_CTL_ADDHRT		FMD_CTL_CLASS "clock.addhrtime"
471193Smws #define	FMD_CTL_ADDHRT_VERS1	1
481193Smws #define	FMD_CTL_ADDHRT_DELTA	"delta"
490Sstevel@tonic-gate 
501193Smws /*
511193Smws  * The FMD_FLT_* events still use defect.sunos.* for now: a future registry
521193Smws  * putback should define all fmd events and convert these to defect.fm.fmd.*
531193Smws  */
541193Smws #define	FMD_FLT_NOSUB		"defect.sunos.fmd.nosub"
551193Smws #define	FMD_FLT_NODC		"defect.sunos.fmd.nodiagcode"
561193Smws #define	FMD_FLT_MOD		"defect.sunos.fmd.module"
571193Smws #define	FMD_FLT_CONF		"defect.sunos.fmd.config"
580Sstevel@tonic-gate 
591193Smws #define	FMD_ERR_CLASS		"ereport.fm.fmd."
601193Smws #define	FMD_ERR_CLASS_LEN	(sizeof (FMD_ERR_CLASS) - 1)
610Sstevel@tonic-gate 
620Sstevel@tonic-gate #define	FMD_ERR_MOD_MSG		"msg"
630Sstevel@tonic-gate #define	FMD_ERR_MOD_ERRNO	"errno"
640Sstevel@tonic-gate #define	FMD_ERR_MOD_ERRCLASS	"errclass"
650Sstevel@tonic-gate 
660Sstevel@tonic-gate struct fmd_module;			/* see <fmd_module.h> */
670Sstevel@tonic-gate 
680Sstevel@tonic-gate extern nvlist_t *fmd_protocol_authority(void);
690Sstevel@tonic-gate extern nvlist_t *fmd_protocol_fmri_module(struct fmd_module *);
700Sstevel@tonic-gate extern nvlist_t *fmd_protocol_fault(const char *,
713323Scindi     uint8_t, nvlist_t *, nvlist_t *, nvlist_t *, const char *);
721193Smws extern nvlist_t *fmd_protocol_list(const char *, nvlist_t *,
735255Sstephh     const char *, const char *, uint_t, nvlist_t **, uint8_t *, int,
74*10928SStephen.Hanson@Sun.COM     struct timeval *, int);
751193Smws extern nvlist_t *fmd_protocol_rsrc_asru(const char *, nvlist_t *,
765255Sstephh     const char *, const char *, boolean_t, boolean_t, boolean_t, nvlist_t *,
77*10928SStephen.Hanson@Sun.COM     struct timeval *m, boolean_t, boolean_t, boolean_t, boolean_t, nvlist_t *,
78*10928SStephen.Hanson@Sun.COM     boolean_t);
790Sstevel@tonic-gate extern nvlist_t *fmd_protocol_fmderror(int, const char *, va_list);
800Sstevel@tonic-gate extern nvlist_t *fmd_protocol_moderror(struct fmd_module *, int, const char *);
811193Smws extern nvlist_t *fmd_protocol_xprt_ctl(struct fmd_module *,
821193Smws     const char *, uint8_t);
831193Smws extern nvlist_t *fmd_protocol_xprt_sub(struct fmd_module *,
841193Smws     const char *, uint8_t, const char *);
851193Smws extern nvlist_t *fmd_protocol_xprt_uuclose(struct fmd_module *,
861193Smws     const char *, uint8_t, const char *);
879120SStephen.Hanson@Sun.COM extern nvlist_t *fmd_protocol_xprt_uuresolved(struct fmd_module *,
889120SStephen.Hanson@Sun.COM     const char *, uint8_t, const char *);
899120SStephen.Hanson@Sun.COM extern nvlist_t *fmd_protocol_xprt_updated(struct fmd_module *,
909120SStephen.Hanson@Sun.COM     const char *, uint8_t, const char *, uint8_t *, uint8_t *, uint_t);
910Sstevel@tonic-gate 
920Sstevel@tonic-gate #ifdef	__cplusplus
930Sstevel@tonic-gate }
940Sstevel@tonic-gate #endif
950Sstevel@tonic-gate 
960Sstevel@tonic-gate #endif	/* _FMD_PROTOCOL_H */
97