topo_tree.h revision 7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fe
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _TOPO_TREE_H
#define _TOPO_TREE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <fm/topo_mod.h>
#include <topo_list.h>
#include <topo_prop.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct topo_modhash topo_modhash_t;
typedef struct topo_range {
} topo_range_t;
typedef struct topo_nodehash {
char *th_name; /* name for all nodes in this hash */
typedef struct topo_imethod {
char *tim_name; /* Method name */
char *tim_desc; /* Method description */
struct topo_node {
char *tn_name; /* Node name */
int tn_state; /* node state (see below) */
void *tn_priv; /* Private enumerator data */
int tn_refs; /* node reference count */
};
#define TOPO_NODE_INIT 0x0001
#define TOPO_NODE_ROOT 0x0002
#define TOPO_NODE_BOUND 0x0004
#define TOPO_NODE_LINKED 0x0008
typedef struct topo_tree {
char *tt_scheme; /* Scheme name */
void *tt_file; /* Topology file info */
} ttree_t;
struct topo_walk {
void *tw_pdata; /* Private callback data */
};
typedef struct topo_alloc {
int ta_flags;
} topo_alloc_t;
struct topo_hdl {
char *th_uuid; /* uuid of snapshot */
char *th_rootdir; /* Root directory of plugin paths */
int th_errno; /* errno */
int th_debug; /* Debug mask */
int th_dbout; /* Debug channel */
};
extern int topo_tree_enum_all(topo_hdl_t *);
extern void topo_node_lock(tnode_t *);
extern void topo_node_unlock(tnode_t *);
extern void topo_node_hold(tnode_t *);
extern void topo_node_rele(tnode_t *);
extern int topo_walk_bottomup(topo_walk_t *, int);
#ifdef __cplusplus
}
#endif
#endif /* _TOPO_TREE_H */