xref: /onnv-gate/usr/src/cmd/fm/fmd/common/fmd_error.h (revision 1414:b4126407ac5b)
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
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
221193Smws 
230Sstevel@tonic-gate /*
24*1414Scindi  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
250Sstevel@tonic-gate  * Use is subject to license terms.
260Sstevel@tonic-gate  */
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #ifndef	_FMD_ERROR_H
290Sstevel@tonic-gate #define	_FMD_ERROR_H
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <errno.h>
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #ifdef	__cplusplus
360Sstevel@tonic-gate extern "C" {
370Sstevel@tonic-gate #endif
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /*
400Sstevel@tonic-gate  * This enum definition is used to define a set of error tags associated with
410Sstevel@tonic-gate  * the fmd daemon's various error conditions.  The shell script mkerror.sh is
420Sstevel@tonic-gate  * used to parse this file and create a corresponding fmd_error.c source file.
430Sstevel@tonic-gate  * If you do something other than add a new error tag here, you may need to
440Sstevel@tonic-gate  * update the mkerror shell script as it is based upon simple regexps.
450Sstevel@tonic-gate  */
460Sstevel@tonic-gate typedef enum fmd_errno {
470Sstevel@tonic-gate     EFMD_UNKNOWN = 1000, /* unknown fault management daemon error */
480Sstevel@tonic-gate     EFMD_PANIC,		/* unrecoverable fatal error in daemon occurred */
490Sstevel@tonic-gate     EFMD_EXIT,		/* failed to initialize fault management daemon */
500Sstevel@tonic-gate     EFMD_MODULE,	/* fmd module detected or caused an error */
510Sstevel@tonic-gate     EFMD_CONF_OPEN,	/* failed to open configuration file */
520Sstevel@tonic-gate     EFMD_CONF_KEYWORD,	/* invalid configuration file keyword */
530Sstevel@tonic-gate     EFMD_CONF_NOPROP,	/* invalid configuration file parameter name */
541193Smws     EFMD_CONF_NODEFER,	/* deferred properties not permitted in this file */
550Sstevel@tonic-gate     EFMD_CONF_PROPDUP,	/* duplicate configuration file parameter name */
560Sstevel@tonic-gate     EFMD_CONF_INVAL,	/* invalid value for configuration file property */
570Sstevel@tonic-gate     EFMD_CONF_OVERFLOW,	/* configuration value too large for data type */
580Sstevel@tonic-gate     EFMD_CONF_USAGE,	/* syntax error in configuration file directive */
590Sstevel@tonic-gate     EFMD_CONF_DEFAULT,	/* invalid default value for configuration property */
600Sstevel@tonic-gate     EFMD_CONF_ERRS,	/* error(s) detected in configuration file */
610Sstevel@tonic-gate     EFMD_CONF_IO,	/* i/o error prevented configuration file processing */
620Sstevel@tonic-gate     EFMD_CONF_PROPNAME,	/* configuration property name is not an identifier */
630Sstevel@tonic-gate     EFMD_CONF_RDONLY,	/* configuration property is read-only */
641193Smws     EFMD_CONF_DEFER,	/* invalid deferred configuration file property */
65*1414Scindi     EFMD_CONF_UNDEF,	/* configuration property is not defined */
660Sstevel@tonic-gate     EFMD_MOD_INIT,	/* failed to initialize module */
670Sstevel@tonic-gate     EFMD_MOD_FINI,	/* failed to uninitialize module */
680Sstevel@tonic-gate     EFMD_MOD_THR,	/* failed to create processing thread for module */
690Sstevel@tonic-gate     EFMD_MOD_JOIN,	/* failed to join processing thread for module */
700Sstevel@tonic-gate     EFMD_MOD_CONF,	/* error(s) detected in module configuration file */
710Sstevel@tonic-gate     EFMD_MOD_DICT,	/* failed to open module's event code dictionary */
720Sstevel@tonic-gate     EFMD_MOD_LOADED,	/* specified module is already loaded */
730Sstevel@tonic-gate     EFMD_MOD_NOMOD,	/* specified module is not loaded */
740Sstevel@tonic-gate     EFMD_MOD_FAIL,	/* module failed due to preceding error */
75*1414Scindi     EFMD_MOD_TOPO,	/* failed to obtain topology handle */
760Sstevel@tonic-gate     EFMD_RTLD_OPEN,	/* rtld failed to open shared library plug-in */
770Sstevel@tonic-gate     EFMD_RTLD_INIT,	/* shared library plug-in does not define _fmd_init */
780Sstevel@tonic-gate     EFMD_BLTIN_NAME,	/* built-in plug-in name not found in definition list */
790Sstevel@tonic-gate     EFMD_BLTIN_INIT,	/* built-in plug-in does not define init function */
801193Smws     EFMD_EVENT_INVAL,	/* event interface programming error */
811193Smws     EFMD_XPRT_INVAL,	/* transport interface programming error */
821193Smws     EFMD_XPRT_PAYLOAD,	/* transport event has invalid payload */
831193Smws     EFMD_XPRT_OWNER,	/* transport can only be manipulated by owner */
841193Smws     EFMD_XPRT_THR,	/* failed to create thread for transport */
851193Smws     EFMD_XPRT_LIMIT,	/* limit on number of open transports exceeded */
860Sstevel@tonic-gate     EFMD_TIME_GETTOD,	/* failed to get current time-of-day */
870Sstevel@tonic-gate     EFMD_LOG_OPEN,	/* failed to open and initialize log file */
880Sstevel@tonic-gate     EFMD_LOG_CLOSE,	/* failed to close log file */
890Sstevel@tonic-gate     EFMD_LOG_EXACCT,	/* failed to perform log exacct operation */
900Sstevel@tonic-gate     EFMD_LOG_APPEND,	/* failed to append event to log */
910Sstevel@tonic-gate     EFMD_LOG_MINFREE,	/* insufficient min fs space to append event to log */
920Sstevel@tonic-gate     EFMD_LOG_COMMIT,	/* failed to commit event to log */
930Sstevel@tonic-gate     EFMD_LOG_INVAL,	/* invalid log header information */
940Sstevel@tonic-gate     EFMD_LOG_VERSION,	/* invalid log version information */
950Sstevel@tonic-gate     EFMD_LOG_UNPACK,	/* failed to unpack data in log */
960Sstevel@tonic-gate     EFMD_LOG_REPLAY,	/* failed to replay log content */
970Sstevel@tonic-gate     EFMD_LOG_UPDATE,	/* failed to update log toc */
980Sstevel@tonic-gate     EFMD_LOG_ROTATE,	/* failed to rotate log file */
990Sstevel@tonic-gate     EFMD_LOG_ROTBUSY,	/* failed to rotate log file due to pending events */
1000Sstevel@tonic-gate     EFMD_ASRU_NODIR,	/* failed to open asru cache directory */
1010Sstevel@tonic-gate     EFMD_ASRU_EVENT,	/* failed to process asru event log */
1020Sstevel@tonic-gate     EFMD_ASRU_FMRI,	/* failed to convert asru fmri to string */
1030Sstevel@tonic-gate     EFMD_ASRU_NOENT,	/* failed to locate specified asru entry */
1040Sstevel@tonic-gate     EFMD_ASRU_UNLINK,	/* failed to delete asru cache entry */
1050Sstevel@tonic-gate     EFMD_ASRU_DUP,	/* asru log is a duplicate of an existing asru */
1060Sstevel@tonic-gate     EFMD_FMRI_SCHEME,	/* fmri scheme module is missing or failed to load */
1070Sstevel@tonic-gate     EFMD_FMRI_OP,	/* fmri scheme module operation failed */
1080Sstevel@tonic-gate     EFMD_FMRI_INVAL,	/* fmri nvlist is missing required element */
1090Sstevel@tonic-gate     EFMD_FMRI_NOTSUP,	/* fmri scheme module does not support operation */
1100Sstevel@tonic-gate     EFMD_VER_OLD,	/* plug-in is compiled using an obsolete fmd API */
1110Sstevel@tonic-gate     EFMD_VER_NEW,	/* plug-in is compiled using a newer fmd API */
1120Sstevel@tonic-gate     EFMD_HDL_INIT,	/* client handle wasn't initialized by _fmd_init */
1130Sstevel@tonic-gate     EFMD_HDL_INFO,	/* client info is missing required information */
1140Sstevel@tonic-gate     EFMD_HDL_PROP,	/* client info includes invalid property definition */
1150Sstevel@tonic-gate     EFMD_HDL_NOTREG,	/* client handle has never been registered */
1160Sstevel@tonic-gate     EFMD_HDL_REG,	/* client handle has already been registered */
1170Sstevel@tonic-gate     EFMD_HDL_TID,	/* client handle must be registered by owner */
1180Sstevel@tonic-gate     EFMD_HDL_INVAL,	/* client handle is corrupt or not owned by caller */
1190Sstevel@tonic-gate     EFMD_HDL_ABORT,	/* client requested that module execution abort */
1200Sstevel@tonic-gate     EFMD_HDL_NOMEM,	/* client memory limit exceeded */
1210Sstevel@tonic-gate     EFMD_PROP_TYPE,	/* property accessed using incompatible type */
1220Sstevel@tonic-gate     EFMD_PROP_DEFN,	/* property is not defined */
1230Sstevel@tonic-gate     EFMD_STAT_FLAGS,	/* invalid flags passed to fmd_stat_* function */
1240Sstevel@tonic-gate     EFMD_STAT_TYPE,	/* invalid operation for statistic type */
1250Sstevel@tonic-gate     EFMD_STAT_BADTYPE,	/* invalid type for statistic */
1260Sstevel@tonic-gate     EFMD_STAT_BADNAME,	/* invalid name for statistic */
1270Sstevel@tonic-gate     EFMD_STAT_DUPNAME,	/* statistic name is already defined in collection */
1280Sstevel@tonic-gate     EFMD_STAT_NOMEM,	/* failed to allocate memory for statistics snapshot */
1290Sstevel@tonic-gate     EFMD_CASE_OWNER,	/* case can only be manipulated or closed by owner */
1300Sstevel@tonic-gate     EFMD_CASE_STATE,	/* case is not in appropriate state for operation */
1310Sstevel@tonic-gate     EFMD_CASE_EVENT,	/* case operation failed due to invalid event */
1320Sstevel@tonic-gate     EFMD_CASE_INVAL,	/* case uuid does not match any known case */
1330Sstevel@tonic-gate     EFMD_BUF_INVAL,	/* buffer specification uses invalid name or size */
1340Sstevel@tonic-gate     EFMD_BUF_LIMIT,	/* client exceeded limit on total buffer space */
1350Sstevel@tonic-gate     EFMD_BUF_NOENT,	/* no such buffer is currently defined by client */
1360Sstevel@tonic-gate     EFMD_BUF_OFLOW,	/* write would overflow the size of this buffer */
1370Sstevel@tonic-gate     EFMD_BUF_EXISTS,	/* buffer with the specified name already exists */
1380Sstevel@tonic-gate     EFMD_SERD_NAME,	/* no serd engine with the specified name exists */
1390Sstevel@tonic-gate     EFMD_SERD_EXISTS,	/* serd engine with the specified name already exists */
1400Sstevel@tonic-gate     EFMD_THR_CREATE,	/* failed to create auxiliary module thread */
1410Sstevel@tonic-gate     EFMD_THR_LIMIT,	/* limit on module auxiliary threads exceeded */
1420Sstevel@tonic-gate     EFMD_THR_INVAL,	/* invalid thread id specified for thread call */
1430Sstevel@tonic-gate     EFMD_THR_JOIN,	/* failed to join with auxiliary thread */
1440Sstevel@tonic-gate     EFMD_TIMER_INVAL,	/* invalid time delta or id specified for timer call */
1450Sstevel@tonic-gate     EFMD_TIMER_LIMIT,	/* client exceeded limit on number of pending timers */
1460Sstevel@tonic-gate     EFMD_CKPT_NOMEM,	/* failed to allocate checkpoint buffer */
1470Sstevel@tonic-gate     EFMD_CKPT_MKDIR,	/* failed to create checkpoint directory */
1480Sstevel@tonic-gate     EFMD_CKPT_CREATE,	/* failed to create checkpoint file */
1490Sstevel@tonic-gate     EFMD_CKPT_COMMIT,	/* failed to commit checkpoint file */
1500Sstevel@tonic-gate     EFMD_CKPT_DELETE,	/* failed to delete checkpoint file */
1510Sstevel@tonic-gate     EFMD_CKPT_OPEN,	/* failed to open checkpoint file */
1520Sstevel@tonic-gate     EFMD_CKPT_SHORT,	/* checkpoint file has been truncated or corrupted */
1530Sstevel@tonic-gate     EFMD_CKPT_INVAL,	/* checkpoint file has invalid header or content */
1540Sstevel@tonic-gate     EFMD_CKPT_RESTORE,	/* failed to restore checkpoint file */
1550Sstevel@tonic-gate     EFMD_RPC_REG,	/* failed to register rpc service */
1560Sstevel@tonic-gate     EFMD_RPC_BOUND,	/* rpc program/version is already bound */
1570Sstevel@tonic-gate     EFMD_NVL_INVAL,	/* invalid nvlist function argument */
1580Sstevel@tonic-gate     EFMD_CTL_INVAL,	/* invalid fault manager control event */
1590Sstevel@tonic-gate     EFMD_END		/* end of custom errno list (to ease auto-merge) */
1600Sstevel@tonic-gate } fmd_errno_t;
1610Sstevel@tonic-gate 
1620Sstevel@tonic-gate extern const char *fmd_errclass(int);
1630Sstevel@tonic-gate extern const char *fmd_strerror(int);
1640Sstevel@tonic-gate extern int fmd_set_errno(int);
1650Sstevel@tonic-gate 
1660Sstevel@tonic-gate #ifdef	__cplusplus
1670Sstevel@tonic-gate }
1680Sstevel@tonic-gate #endif
1690Sstevel@tonic-gate 
1700Sstevel@tonic-gate #endif	/* _FMD_ERROR_H */
171