2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _TOPO_ERROR_H
2N/A#define _TOPO_ERROR_H
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#include <topo_tree.h>
2N/A#include <topo_module.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * This enum definition is used to define a set of error tags associated with
2N/A * the libtopo internal error conditions. The shell script mkerror.sh is
2N/A * used to parse this file and create a corresponding topo_error.c source file.
2N/A * If you do something other than add a new error tag here, you may need to
2N/A * update the mkerror shell script as it is based upon simple regexps.
2N/A */
2N/Atypedef enum topo_errno {
2N/A ETOPO_UNKNOWN = 1000, /* unknown libtopo error */
2N/A ETOPO_NOMEM, /* memory limit exceeded */
2N/A ETOPO_MODULE, /* module detected or caused an error */
2N/A ETOPO_MOD_INIT, /* failed to initialize module */
2N/A ETOPO_MOD_FINI, /* failed to uninitialize module */
2N/A ETOPO_MOD_LOADED, /* specified module is already loaded */
2N/A ETOPO_MOD_NOMOD, /* specified module is not loaded */
2N/A ETOPO_MOD_ABIVER, /* module registered with invalid ABI version */
2N/A ETOPO_MOD_INVAL, /* module invalid argument */
2N/A ETOPO_MOD_DUP, /* module duplicate node entry */
2N/A ETOPO_MOD_NOREG, /* module failed to register */
2N/A ETOPO_MOD_NOENT, /* module path invalid */
2N/A ETOPO_MOD_XRD, /* unable to read topology map file */
2N/A ETOPO_MOD_XENUM, /* unable to enumerate from a topology map file */
2N/A ETOPO_MOD_NOSUP, /* enumerator not supported in this module */
2N/A ETOPO_MOD_VER, /* module version mismatch while loading */
2N/A ETOPO_RTLD_OPEN, /* rtld failed to open shared library plug-in */
2N/A ETOPO_RTLD_INIT, /* shared library plug-in does not define _topo_init */
2N/A ETOPO_RTLD_NOMEM, /* memory limit exceeded when opening shared library */
2N/A ETOPO_BLTIN_NAME, /* built-in plug-in name not found in definition list */
2N/A ETOPO_BLTIN_INIT, /* built-in plug-in does not define init function */
2N/A ETOPO_VER_OLD, /* plugin compiled using an obsolete topo ABI */
2N/A ETOPO_VER_NEW, /* plugin is compiled using a newer topo ABI */
2N/A ETOPO_ENUM_PARTIAL, /* partial enumeration completed for client */
2N/A ETOPO_ENUM_NOMAP, /* no topology map file for enumeration */
2N/A ETOPO_ENUM_FATAL, /* fatal enumeration error */
2N/A ETOPO_ENUM_RECURS, /* recursive enumertation detected */
2N/A ETOPO_NVL_INVAL, /* invalid nvlist function argument */
2N/A ETOPO_FILE_NOENT, /* no topology file found */
2N/A ETOPO_PRSR_BADGRP, /* unrecognized grouping */
2N/A ETOPO_PRSR_BADNUM, /* unable to interpret attribute numerically */
2N/A ETOPO_PRSR_BADRNG, /* non-sensical range */
2N/A ETOPO_PRSR_BADSCH, /* unrecognized scheme */
2N/A ETOPO_PRSR_BADSTAB, /* unrecognized stability */
2N/A ETOPO_PRSR_BADTYPE, /* unrecognized property value type */
2N/A ETOPO_PRSR_NOATTR, /* tag missing attribute */
2N/A ETOPO_PRSR_NOENT, /* topology xml file not found */
2N/A ETOPO_PRSR_NOMETH, /* range missing enum-method */
2N/A ETOPO_PRSR_NVPROP, /* properties as nvlist missing crucial field */
2N/A ETOPO_PRSR_OOR, /* node instance out of declared range */
2N/A ETOPO_PRSR_REGMETH, /* failed to register property method */
2N/A ETOPO_WALK_EMPTY, /* empty topology */
2N/A ETOPO_WALK_NOTFOUND, /* scheme based topology not found */
2N/A ETOPO_FAC_NOENT, /* no facility node of specified type found */
2N/A ETOPO_END /* end of custom errno list (to ease auto-merge) */
2N/A} topo_errno_t;
2N/A
2N/Aextern int topo_hdl_seterrno(topo_hdl_t *, int);
2N/Aextern const char *topo_hdl_errmsg(topo_hdl_t *);
2N/Aextern int topo_hdl_errno(topo_hdl_t *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _TOPO_ERROR_H */