1e1c679faSaf /*
2e1c679faSaf  * CDDL HEADER START
3e1c679faSaf  *
4e1c679faSaf  * The contents of this file are subject to the terms of the
5e1c679faSaf  * Common Development and Distribution License (the "License").
6e1c679faSaf  * You may not use this file except in compliance with the License.
7e1c679faSaf  *
8e1c679faSaf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e1c679faSaf  * or http://www.opensolaris.org/os/licensing.
10e1c679faSaf  * See the License for the specific language governing permissions
11e1c679faSaf  * and limitations under the License.
12e1c679faSaf  *
13e1c679faSaf  * When distributing Covered Code, include this CDDL HEADER in each
14e1c679faSaf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15e1c679faSaf  * If applicable, add the following below this CDDL HEADER, with the
16e1c679faSaf  * fields enclosed by brackets "[]" replaced with your own identifying
17e1c679faSaf  * information: Portions Copyright [yyyy] [name of copyright owner]
18e1c679faSaf  *
19e1c679faSaf  * CDDL HEADER END
20e1c679faSaf  */
21b6955755SRobert Johnston 
22e1c679faSaf /*
23*f6e214c7SGavin Maltby  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24e1c679faSaf  */
25e1c679faSaf 
26e1c679faSaf #ifndef	_FMD_MSG_H
27e1c679faSaf #define	_FMD_MSG_H
28e1c679faSaf 
29b6955755SRobert Johnston #include <sys/types.h>
30b6955755SRobert Johnston #include <sys/nvpair.h>
31e1c679faSaf 
32e1c679faSaf #ifdef	__cplusplus
33e1c679faSaf extern "C" {
34e1c679faSaf #endif
35e1c679faSaf 
36e1c679faSaf /*
37e1c679faSaf  * Fault Management Daemon msg File Interfaces
38e1c679faSaf  *
39e1c679faSaf  * Note: The contents of this file are private to the implementation of the
40e1c679faSaf  * Solaris system and FMD subsystem and are subject to change at any time
41e1c679faSaf  * without notice.  Applications and drivers using these interfaces will fail
42e1c679faSaf  * to run on future releases.  These interfaces should not be used for any
43e1c679faSaf  * purpose until they are publicly documented for use outside of Sun.
44e1c679faSaf  */
45e1c679faSaf 
46b6955755SRobert Johnston #define	FMD_MSG_VERSION	1	/* libary ABI interface version */
47b6955755SRobert Johnston 
48b6955755SRobert Johnston typedef struct fmd_msg_hdl fmd_msg_hdl_t;
49b6955755SRobert Johnston 
50b6955755SRobert Johnston typedef enum {
51b6955755SRobert Johnston 	FMD_MSG_ITEM_TYPE,
52b6955755SRobert Johnston 	FMD_MSG_ITEM_SEVERITY,
53b6955755SRobert Johnston 	FMD_MSG_ITEM_DESC,
54b6955755SRobert Johnston 	FMD_MSG_ITEM_RESPONSE,
55b6955755SRobert Johnston 	FMD_MSG_ITEM_IMPACT,
56b6955755SRobert Johnston 	FMD_MSG_ITEM_ACTION,
57b6955755SRobert Johnston 	FMD_MSG_ITEM_URL,
58b6955755SRobert Johnston 	FMD_MSG_ITEM_MAX
59b6955755SRobert Johnston } fmd_msg_item_t;
60b6955755SRobert Johnston 
61e1c679faSaf extern void fmd_msg_lock(void);
62e1c679faSaf extern void fmd_msg_unlock(void);
63e1c679faSaf 
64b6955755SRobert Johnston fmd_msg_hdl_t *fmd_msg_init(const char *, int);
65b6955755SRobert Johnston void fmd_msg_fini(fmd_msg_hdl_t *);
66b6955755SRobert Johnston 
67b6955755SRobert Johnston extern int fmd_msg_locale_set(fmd_msg_hdl_t *, const char *);
68b6955755SRobert Johnston extern const char *fmd_msg_locale_get(fmd_msg_hdl_t *);
69b6955755SRobert Johnston 
70b6955755SRobert Johnston extern int fmd_msg_url_set(fmd_msg_hdl_t *, const char *);
71b6955755SRobert Johnston extern const char *fmd_msg_url_get(fmd_msg_hdl_t *);
72b6955755SRobert Johnston 
73b6955755SRobert Johnston extern char *fmd_msg_gettext_nv(fmd_msg_hdl_t *, const char *, nvlist_t *);
74b6955755SRobert Johnston extern char *fmd_msg_gettext_id(fmd_msg_hdl_t *, const char *, const char *);
75*f6e214c7SGavin Maltby extern char *fmd_msg_gettext_key(fmd_msg_hdl_t *, const char *, const char *,
76*f6e214c7SGavin Maltby     const char *);
77*f6e214c7SGavin Maltby extern char *fmd_msg_decode_tokens(nvlist_t *, const char *, const char *);
78b6955755SRobert Johnston extern char *fmd_msg_getitem_nv(fmd_msg_hdl_t *,
79b6955755SRobert Johnston     const char *, nvlist_t *, fmd_msg_item_t);
80b6955755SRobert Johnston 
81b6955755SRobert Johnston extern char *fmd_msg_getitem_id(fmd_msg_hdl_t *,
82b6955755SRobert Johnston     const char *, const char *, fmd_msg_item_t);
83b6955755SRobert Johnston 
84e1c679faSaf #ifdef	__cplusplus
85e1c679faSaf }
86e1c679faSaf #endif
87e1c679faSaf 
88e1c679faSaf #endif	/* _FMD_MSG_H */
89