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