xref: /onnv-gate/usr/src/lib/fm/libfmd_msg/common/fmd_msg.h (revision 12967:ab9ae749152f)
13723Saf /*
23723Saf  * CDDL HEADER START
33723Saf  *
43723Saf  * The contents of this file are subject to the terms of the
53723Saf  * Common Development and Distribution License (the "License").
63723Saf  * You may not use this file except in compliance with the License.
73723Saf  *
83723Saf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93723Saf  * or http://www.opensolaris.org/os/licensing.
103723Saf  * See the License for the specific language governing permissions
113723Saf  * and limitations under the License.
123723Saf  *
133723Saf  * When distributing Covered Code, include this CDDL HEADER in each
143723Saf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153723Saf  * If applicable, add the following below this CDDL HEADER, with the
163723Saf  * fields enclosed by brackets "[]" replaced with your own identifying
173723Saf  * information: Portions Copyright [yyyy] [name of copyright owner]
183723Saf  *
193723Saf  * CDDL HEADER END
203723Saf  */
219501SRobert.Johnston@Sun.COM 
223723Saf /*
23*12967Sgavin.maltby@oracle.com  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
243723Saf  */
253723Saf 
263723Saf #ifndef	_FMD_MSG_H
273723Saf #define	_FMD_MSG_H
283723Saf 
299501SRobert.Johnston@Sun.COM #include <sys/types.h>
309501SRobert.Johnston@Sun.COM #include <sys/nvpair.h>
313723Saf 
323723Saf #ifdef	__cplusplus
333723Saf extern "C" {
343723Saf #endif
353723Saf 
363723Saf /*
373723Saf  * Fault Management Daemon msg File Interfaces
383723Saf  *
393723Saf  * Note: The contents of this file are private to the implementation of the
403723Saf  * Solaris system and FMD subsystem and are subject to change at any time
413723Saf  * without notice.  Applications and drivers using these interfaces will fail
423723Saf  * to run on future releases.  These interfaces should not be used for any
433723Saf  * purpose until they are publicly documented for use outside of Sun.
443723Saf  */
453723Saf 
469501SRobert.Johnston@Sun.COM #define	FMD_MSG_VERSION	1	/* libary ABI interface version */
479501SRobert.Johnston@Sun.COM 
489501SRobert.Johnston@Sun.COM typedef struct fmd_msg_hdl fmd_msg_hdl_t;
499501SRobert.Johnston@Sun.COM 
509501SRobert.Johnston@Sun.COM typedef enum {
519501SRobert.Johnston@Sun.COM 	FMD_MSG_ITEM_TYPE,
529501SRobert.Johnston@Sun.COM 	FMD_MSG_ITEM_SEVERITY,
539501SRobert.Johnston@Sun.COM 	FMD_MSG_ITEM_DESC,
549501SRobert.Johnston@Sun.COM 	FMD_MSG_ITEM_RESPONSE,
559501SRobert.Johnston@Sun.COM 	FMD_MSG_ITEM_IMPACT,
569501SRobert.Johnston@Sun.COM 	FMD_MSG_ITEM_ACTION,
579501SRobert.Johnston@Sun.COM 	FMD_MSG_ITEM_URL,
589501SRobert.Johnston@Sun.COM 	FMD_MSG_ITEM_MAX
599501SRobert.Johnston@Sun.COM } fmd_msg_item_t;
609501SRobert.Johnston@Sun.COM 
613723Saf extern void fmd_msg_lock(void);
623723Saf extern void fmd_msg_unlock(void);
633723Saf 
649501SRobert.Johnston@Sun.COM fmd_msg_hdl_t *fmd_msg_init(const char *, int);
659501SRobert.Johnston@Sun.COM void fmd_msg_fini(fmd_msg_hdl_t *);
669501SRobert.Johnston@Sun.COM 
679501SRobert.Johnston@Sun.COM extern int fmd_msg_locale_set(fmd_msg_hdl_t *, const char *);
689501SRobert.Johnston@Sun.COM extern const char *fmd_msg_locale_get(fmd_msg_hdl_t *);
699501SRobert.Johnston@Sun.COM 
709501SRobert.Johnston@Sun.COM extern int fmd_msg_url_set(fmd_msg_hdl_t *, const char *);
719501SRobert.Johnston@Sun.COM extern const char *fmd_msg_url_get(fmd_msg_hdl_t *);
729501SRobert.Johnston@Sun.COM 
739501SRobert.Johnston@Sun.COM extern char *fmd_msg_gettext_nv(fmd_msg_hdl_t *, const char *, nvlist_t *);
749501SRobert.Johnston@Sun.COM extern char *fmd_msg_gettext_id(fmd_msg_hdl_t *, const char *, const char *);
75*12967Sgavin.maltby@oracle.com extern char *fmd_msg_gettext_key(fmd_msg_hdl_t *, const char *, const char *,
76*12967Sgavin.maltby@oracle.com     const char *);
77*12967Sgavin.maltby@oracle.com extern char *fmd_msg_decode_tokens(nvlist_t *, const char *, const char *);
789501SRobert.Johnston@Sun.COM extern char *fmd_msg_getitem_nv(fmd_msg_hdl_t *,
799501SRobert.Johnston@Sun.COM     const char *, nvlist_t *, fmd_msg_item_t);
809501SRobert.Johnston@Sun.COM 
819501SRobert.Johnston@Sun.COM extern char *fmd_msg_getitem_id(fmd_msg_hdl_t *,
829501SRobert.Johnston@Sun.COM     const char *, const char *, fmd_msg_item_t);
839501SRobert.Johnston@Sun.COM 
843723Saf #ifdef	__cplusplus
853723Saf }
863723Saf #endif
873723Saf 
883723Saf #endif	/* _FMD_MSG_H */
89