11414Scindi /* 21414Scindi * CDDL HEADER START 31414Scindi * 41414Scindi * The contents of this file are subject to the terms of the 53062Scindi * Common Development and Distribution License (the "License"). 63062Scindi * You may not use this file except in compliance with the License. 71414Scindi * 81414Scindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 91414Scindi * or http://www.opensolaris.org/os/licensing. 101414Scindi * See the License for the specific language governing permissions 111414Scindi * and limitations under the License. 121414Scindi * 131414Scindi * When distributing Covered Code, include this CDDL HEADER in each 141414Scindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 151414Scindi * If applicable, add the following below this CDDL HEADER, with the 161414Scindi * fields enclosed by brackets "[]" replaced with your own identifying 171414Scindi * information: Portions Copyright [yyyy] [name of copyright owner] 181414Scindi * 191414Scindi * CDDL HEADER END 201414Scindi */ 211414Scindi /* 22*7243Srobj * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 231414Scindi * Use is subject to license terms. 241414Scindi */ 251414Scindi 261414Scindi #ifndef _TOPO_ERROR_H 271414Scindi #define _TOPO_ERROR_H 281414Scindi 291414Scindi #pragma ident "%Z%%M% %I% %E% SMI" 301414Scindi 311414Scindi #include <topo_tree.h> 321414Scindi #include <topo_module.h> 331414Scindi 341414Scindi #ifdef __cplusplus 351414Scindi extern "C" { 361414Scindi #endif 371414Scindi 381414Scindi /* 391414Scindi * This enum definition is used to define a set of error tags associated with 403062Scindi * the libtopo internal error conditions. The shell script mkerror.sh is 411414Scindi * used to parse this file and create a corresponding topo_error.c source file. 421414Scindi * If you do something other than add a new error tag here, you may need to 431414Scindi * update the mkerror shell script as it is based upon simple regexps. 441414Scindi */ 451414Scindi typedef enum topo_errno { 461414Scindi ETOPO_UNKNOWN = 1000, /* unknown libtopo error */ 471414Scindi ETOPO_NOMEM, /* memory limit exceeded */ 481414Scindi ETOPO_MODULE, /* module detected or caused an error */ 491414Scindi ETOPO_MOD_INIT, /* failed to initialize module */ 501414Scindi ETOPO_MOD_FINI, /* failed to uninitialize module */ 511414Scindi ETOPO_MOD_LOADED, /* specified module is already loaded */ 521414Scindi ETOPO_MOD_NOMOD, /* specified module is not loaded */ 533062Scindi ETOPO_MOD_ABIVER, /* module registered with invalid ABI version */ 541414Scindi ETOPO_MOD_INVAL, /* module invalid argument */ 551414Scindi ETOPO_MOD_DUP, /* module duplicate node entry */ 561414Scindi ETOPO_MOD_NOREG, /* module failed to register */ 571414Scindi ETOPO_MOD_NOENT, /* module path invalid */ 583062Scindi ETOPO_MOD_XRD, /* unable to read topology map file */ 593062Scindi ETOPO_MOD_XENUM, /* unable to enumerate from a topology map file */ 601414Scindi ETOPO_MOD_NOSUP, /* enumerator not supported in this module */ 613062Scindi ETOPO_MOD_VER, /* module version mismatch while loading */ 621414Scindi ETOPO_RTLD_OPEN, /* rtld failed to open shared library plug-in */ 631414Scindi ETOPO_RTLD_INIT, /* shared library plug-in does not define _topo_init */ 641414Scindi ETOPO_RTLD_NOMEM, /* memory limit exceeded when opening shared library */ 651414Scindi ETOPO_BLTIN_NAME, /* built-in plug-in name not found in definition list */ 661414Scindi ETOPO_BLTIN_INIT, /* built-in plug-in does not define init function */ 671414Scindi ETOPO_VER_OLD, /* plugin compiled using an obsolete topo ABI */ 681414Scindi ETOPO_VER_NEW, /* plugin is compiled using a newer topo ABI */ 691414Scindi ETOPO_ENUM_PARTIAL, /* partial enumeration completed for client */ 703062Scindi ETOPO_ENUM_NOMAP, /* no topology map file for enumeration */ 713062Scindi ETOPO_ENUM_FATAL, /* fatal enumeration error */ 723323Scindi ETOPO_ENUM_RECURS, /* recursive enumertation detected */ 731414Scindi ETOPO_NVL_INVAL, /* invalid nvlist function argument */ 741414Scindi ETOPO_FILE_NOENT, /* no topology file found */ 751414Scindi ETOPO_PRSR_BADGRP, /* unrecognized grouping */ 761414Scindi ETOPO_PRSR_BADNUM, /* unable to interpret attribute numerically */ 771414Scindi ETOPO_PRSR_BADRNG, /* non-sensical range */ 781414Scindi ETOPO_PRSR_BADSCH, /* unrecognized scheme */ 791414Scindi ETOPO_PRSR_BADSTAB, /* unrecognized stability */ 801414Scindi ETOPO_PRSR_BADTYPE, /* unrecognized property value type */ 811414Scindi ETOPO_PRSR_NOATTR, /* tag missing attribute */ 821414Scindi ETOPO_PRSR_NOENT, /* topology xml file not found */ 831414Scindi ETOPO_PRSR_NOMETH, /* range missing enum-method */ 841414Scindi ETOPO_PRSR_NVPROP, /* properties as nvlist missing crucial field */ 851414Scindi ETOPO_PRSR_OOR, /* node instance out of declared range */ 865068Srobj ETOPO_PRSR_REGMETH, /* failed to register property method */ 871414Scindi ETOPO_WALK_EMPTY, /* empty topology */ 881414Scindi ETOPO_WALK_NOTFOUND, /* scheme based topology not found */ 89*7243Srobj ETOPO_FAC_NOENT, /* no facility node of specified type found */ 901414Scindi ETOPO_END /* end of custom errno list (to ease auto-merge) */ 911414Scindi } topo_errno_t; 921414Scindi 931414Scindi extern int topo_hdl_seterrno(topo_hdl_t *, int); 941414Scindi extern const char *topo_hdl_errmsg(topo_hdl_t *); 951414Scindi extern int topo_hdl_errno(topo_hdl_t *); 961414Scindi 971414Scindi #ifdef __cplusplus 981414Scindi } 991414Scindi #endif 1001414Scindi 1011414Scindi #endif /* _TOPO_ERROR_H */ 102