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 2009 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _FMD_MSG_H 28 #define _FMD_MSG_H 29 30 #include <sys/types.h> 31 #include <sys/nvpair.h> 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 /* 38 * Fault Management Daemon msg File Interfaces 39 * 40 * Note: The contents of this file are private to the implementation of the 41 * Solaris system and FMD subsystem and are subject to change at any time 42 * without notice. Applications and drivers using these interfaces will fail 43 * to run on future releases. These interfaces should not be used for any 44 * purpose until they are publicly documented for use outside of Sun. 45 */ 46 47 #define FMD_MSG_VERSION 1 /* libary ABI interface version */ 48 49 typedef struct fmd_msg_hdl fmd_msg_hdl_t; 50 51 typedef enum { 52 FMD_MSG_ITEM_TYPE, 53 FMD_MSG_ITEM_SEVERITY, 54 FMD_MSG_ITEM_DESC, 55 FMD_MSG_ITEM_RESPONSE, 56 FMD_MSG_ITEM_IMPACT, 57 FMD_MSG_ITEM_ACTION, 58 FMD_MSG_ITEM_URL, 59 FMD_MSG_ITEM_MAX 60 } fmd_msg_item_t; 61 62 extern void fmd_msg_lock(void); 63 extern void fmd_msg_unlock(void); 64 65 fmd_msg_hdl_t *fmd_msg_init(const char *, int); 66 void fmd_msg_fini(fmd_msg_hdl_t *); 67 68 extern int fmd_msg_locale_set(fmd_msg_hdl_t *, const char *); 69 extern const char *fmd_msg_locale_get(fmd_msg_hdl_t *); 70 71 extern int fmd_msg_url_set(fmd_msg_hdl_t *, const char *); 72 extern const char *fmd_msg_url_get(fmd_msg_hdl_t *); 73 74 extern char *fmd_msg_gettext_nv(fmd_msg_hdl_t *, const char *, nvlist_t *); 75 extern char *fmd_msg_gettext_id(fmd_msg_hdl_t *, const char *, const char *); 76 77 extern char *fmd_msg_getitem_nv(fmd_msg_hdl_t *, 78 const char *, nvlist_t *, fmd_msg_item_t); 79 80 extern char *fmd_msg_getitem_id(fmd_msg_hdl_t *, 81 const char *, const char *, fmd_msg_item_t); 82 83 #ifdef __cplusplus 84 } 85 #endif 86 87 #endif /* _FMD_MSG_H */ 88