e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf/*
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * CDDL HEADER START
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf *
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * The contents of this file are subject to the terms of the
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * Common Development and Distribution License (the "License").
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * You may not use this file except in compliance with the License.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf *
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * or http://www.opensolaris.org/os/licensing.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * See the License for the specific language governing permissions
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * and limitations under the License.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf *
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * When distributing Covered Code, include this CDDL HEADER in each
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * If applicable, add the following below this CDDL HEADER, with the
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * fields enclosed by brackets "[]" replaced with your own identifying
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * information: Portions Copyright [yyyy] [name of copyright owner]
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf *
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * CDDL HEADER END
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf */
b695575577bae0337af339d76949713bfe1c9013Robert Johnston
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf/*
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf */
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf#ifndef _FMD_MSG_H
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf#define _FMD_MSG_H
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf
b695575577bae0337af339d76949713bfe1c9013Robert Johnston#include <sys/types.h>
b695575577bae0337af339d76949713bfe1c9013Robert Johnston#include <sys/nvpair.h>
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf#ifdef __cplusplus
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027fafextern "C" {
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf#endif
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf/*
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * Fault Management Daemon msg File Interfaces
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf *
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * Note: The contents of this file are private to the implementation of the
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * Solaris system and FMD subsystem and are subject to change at any time
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * without notice. Applications and drivers using these interfaces will fail
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * to run on future releases. These interfaces should not be used for any
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf * purpose until they are publicly documented for use outside of Sun.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf */
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf
b695575577bae0337af339d76949713bfe1c9013Robert Johnston#define FMD_MSG_VERSION 1 /* libary ABI interface version */
b695575577bae0337af339d76949713bfe1c9013Robert Johnston
b695575577bae0337af339d76949713bfe1c9013Robert Johnstontypedef struct fmd_msg_hdl fmd_msg_hdl_t;
b695575577bae0337af339d76949713bfe1c9013Robert Johnston
b695575577bae0337af339d76949713bfe1c9013Robert Johnstontypedef enum {
b695575577bae0337af339d76949713bfe1c9013Robert Johnston FMD_MSG_ITEM_TYPE,
b695575577bae0337af339d76949713bfe1c9013Robert Johnston FMD_MSG_ITEM_SEVERITY,
b695575577bae0337af339d76949713bfe1c9013Robert Johnston FMD_MSG_ITEM_DESC,
b695575577bae0337af339d76949713bfe1c9013Robert Johnston FMD_MSG_ITEM_RESPONSE,
b695575577bae0337af339d76949713bfe1c9013Robert Johnston FMD_MSG_ITEM_IMPACT,
b695575577bae0337af339d76949713bfe1c9013Robert Johnston FMD_MSG_ITEM_ACTION,
b695575577bae0337af339d76949713bfe1c9013Robert Johnston FMD_MSG_ITEM_URL,
b695575577bae0337af339d76949713bfe1c9013Robert Johnston FMD_MSG_ITEM_MAX
b695575577bae0337af339d76949713bfe1c9013Robert Johnston} fmd_msg_item_t;
b695575577bae0337af339d76949713bfe1c9013Robert Johnston
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027fafextern void fmd_msg_lock(void);
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027fafextern void fmd_msg_unlock(void);
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonfmd_msg_hdl_t *fmd_msg_init(const char *, int);
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonvoid fmd_msg_fini(fmd_msg_hdl_t *);
b695575577bae0337af339d76949713bfe1c9013Robert Johnston
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonextern int fmd_msg_locale_set(fmd_msg_hdl_t *, const char *);
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonextern const char *fmd_msg_locale_get(fmd_msg_hdl_t *);
b695575577bae0337af339d76949713bfe1c9013Robert Johnston
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonextern int fmd_msg_url_set(fmd_msg_hdl_t *, const char *);
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonextern const char *fmd_msg_url_get(fmd_msg_hdl_t *);
b695575577bae0337af339d76949713bfe1c9013Robert Johnston
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonextern char *fmd_msg_gettext_nv(fmd_msg_hdl_t *, const char *, nvlist_t *);
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonextern char *fmd_msg_gettext_id(fmd_msg_hdl_t *, const char *, const char *);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyextern char *fmd_msg_gettext_key(fmd_msg_hdl_t *, const char *, const char *,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby const char *);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltbyextern char *fmd_msg_decode_tokens(nvlist_t *, const char *, const char *);
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonextern char *fmd_msg_getitem_nv(fmd_msg_hdl_t *,
b695575577bae0337af339d76949713bfe1c9013Robert Johnston const char *, nvlist_t *, fmd_msg_item_t);
b695575577bae0337af339d76949713bfe1c9013Robert Johnston
b695575577bae0337af339d76949713bfe1c9013Robert Johnstonextern char *fmd_msg_getitem_id(fmd_msg_hdl_t *,
b695575577bae0337af339d76949713bfe1c9013Robert Johnston const char *, const char *, fmd_msg_item_t);
b695575577bae0337af339d76949713bfe1c9013Robert Johnston
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf#ifdef __cplusplus
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf}
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf#endif
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf#endif /* _FMD_MSG_H */