libtopo.h revision 7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fe
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER START
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * The contents of this file are subject to the terms of the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Common Development and Distribution License (the "License").
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * 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
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Use is subject to license terms.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#ifndef _LIBTOPO_H
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define _LIBTOPO_H
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#pragma ident "%Z%%M% %I% %E% SMI"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#include <sys/nvpair.h>
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#ifdef __cplusplus
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern "C" {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_VERSION 1 /* Library ABI Interface Version */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef struct topo_hdl topo_hdl_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef struct topo_node tnode_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef struct topo_walk topo_walk_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef int32_t topo_instance_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef uint32_t topo_version_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Topo stability attributes
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Each topology node advertises the name and data stability of each of its
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * modules and properties. (see attributes(5))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef enum topo_stability {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_STABILITY_INTERNAL = 0, /* private to libtopo */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_STABILITY_PRIVATE, /* private to Sun */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_STABILITY_OBSOLETE, /* scheduled for removal */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_STABILITY_EXTERNAL, /* not controlled by Sun */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_STABILITY_UNSTABLE, /* new or rapidly changing */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_STABILITY_EVOLVING, /* less rapidly changing */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_STABILITY_STABLE, /* mature interface from Sun */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_STABILITY_STANDARD, /* industry standard */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_STABILITY_MAX /* end */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi} topo_stability_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_STABILITY_MAX TOPO_STABILITY_STANDARD /* max valid stability */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef enum {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_INVALID = 0,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_BOOLEAN, /* boolean */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_INT32, /* int32_t */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_UINT32, /* uint32_t */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_INT64, /* int64_t */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_UINT64, /* uint64_t */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_STRING, /* const char* */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_TIME, /* uint64_t */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_SIZE, /* uint64_t */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TOPO_TYPE_FMRI /* nvlist_t */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi} topo_type_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef int (*topo_walk_cb_t)(topo_hdl_t *, tnode_t *, void *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern topo_hdl_t *topo_open(int, const char *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_close(topo_hdl_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern char *topo_snap_hold(topo_hdl_t *, const char *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_snap_release(topo_hdl_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern topo_walk_t *topo_walk_init(topo_hdl_t *, const char *, topo_walk_cb_t,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi void *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_walk_step(topo_walk_t *, int);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_walk_fini(topo_walk_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_WALK_ERR -1
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_WALK_NEXT 0
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_WALK_TERMINATE 1
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_WALK_CHILD 0x0001
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_WALK_SIBLING 0x0002
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_fmri_present(topo_hdl_t *, nvlist_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_fmri_contains(topo_hdl_t *, nvlist_t *, nvlist_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_fmri_unusable(topo_hdl_t *, nvlist_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_fmri_nvl2str(topo_hdl_t *, nvlist_t *, char **, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_fmri_str2nvl(topo_hdl_t *, const char *, nvlist_t **, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_fmri_asru(topo_hdl_t *, nvlist_t *, nvlist_t **, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_fmri_fru(topo_hdl_t *, nvlist_t *, nvlist_t **,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_fmri_compare(topo_hdl_t *, nvlist_t *, nvlist_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_fmri_invoke(topo_hdl_t *, nvlist_t *, topo_walk_cb_t, void *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern nvlist_t *topo_fmri_create(topo_hdl_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi topo_instance_t, nvlist_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Topo node utilities: callable from topo_walk_step() callback or module
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * enumeration, topo_mod_enumerate()
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern char *topo_node_name(tnode_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern topo_instance_t topo_node_instance(tnode_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void *topo_node_private(tnode_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_node_asru(tnode_t *, nvlist_t **, nvlist_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_node_fru(tnode_t *, nvlist_t **, nvlist_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_node_resource(tnode_t *, nvlist_t **, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_node_label(tnode_t *, char **, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_node_asru_set(tnode_t *node, nvlist_t *, int, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_node_fru_set(tnode_t *node, nvlist_t *, int, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_node_label_set(tnode_t *node, char *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_method_invoke(tnode_t *node, const char *, topo_version_t,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi nvlist_t *, nvlist_t **, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_pgroup_create(tnode_t *, const char *, topo_stability_t, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_pgroup_destroy(tnode_t *, const char *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_get_int32(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int32_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_get_uint32(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi uint32_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_get_int64(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int64_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_get_uint64(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi uint64_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_get_string(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi char **, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_get_fmri(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi nvlist_t **, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_set_int32(tnode_t *, const char *, const char *, int,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int32_t, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_set_uint32(tnode_t *, const char *, const char *, int,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi uint32_t, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_set_int64(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int, int64_t, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_set_uint64(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int, uint64_t, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_set_string(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int, const char *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_set_fmri(tnode_t *, const char *, const char *,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int, const nvlist_t *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_stability(tnode_t *, const char *, topo_stability_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern nvlist_t *topo_prop_get_all(topo_hdl_t *, tnode_t *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_prop_inherit(tnode_t *, const char *, const char *, int *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_SET_ONCE 0
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_SET_MULTIPLE 1
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_ASRU_COMPUTE 0x0001 /* Compute ASRU dynamically */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_FRU_COMPUTE 0x0002 /* Compute FRU dynamically */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/* Protocol property group and property names */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PGROUP_PROTOCOL "protocol" /* Required property group */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_RESOURCE "resource" /* resource FMRI */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_ASRU "ASRU" /* ASRU FMRI */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_FRU "FRU" /* FRU FMRI */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_MOD "module" /* software module FMRI */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_PKG "package" /* software package FMRI */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_LABEL "label" /* property LABEL */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Legacy TOPO property group: this group supports legacy platform.topo
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * property names
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PGROUP_LEGACY "legacy" /* Legacy property group */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_PLATASRU "PLAT-ASRU"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_PLATFRU "PLAT-FRU"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * System property group
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PGROUP_SYSTEM "system"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_PLATFORM "platform"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_ISA "isa"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_MACHINE "machine"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/* Property node NVL names */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_GROUP "property-group"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_GROUP_NAME "property-group-name"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_VAL "property"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_VAL_NAME "property-name"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_PROP_VAL_VAL "property-value"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern const char *topo_strerror(int);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_debug_set(topo_hdl_t *, int, char *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void *topo_hdl_alloc(topo_hdl_t *, size_t);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void *topo_hdl_zalloc(topo_hdl_t *, size_t);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_hdl_free(topo_hdl_t *, void *, size_t);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_hdl_nvalloc(topo_hdl_t *, nvlist_t **, uint_t);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern int topo_hdl_nvdup(topo_hdl_t *, nvlist_t *, nvlist_t **);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern char *topo_hdl_strdup(topo_hdl_t *, const char *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiextern void topo_hdl_strfree(topo_hdl_t *, char *);
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_DBG_ERR 0x0001 /* enable error handling debug messages */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_DBG_MOD 0x0002 /* enable module subsystem debug messages */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_DBG_LOG 0x0004 /* enable log subsystem debug messages */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_DBG_WALK 0x0008 /* enable walker subsystem debug messages */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_DBG_TREE 0x0010 /* enable tree subsystem debug messages */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define TOPO_DBG_ALL 0xffff /* enable all debug modes */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#ifdef __cplusplus
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi}
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif /* _LIBTOPO_H */