1*c5591576SRob Johnston /*
2*c5591576SRob Johnston  * This file and its contents are supplied under the terms of the
3*c5591576SRob Johnston  * Common Development and Distribution License ("CDDL"), version 1.0.
4*c5591576SRob Johnston  * You may only use this file in accordance with the terms of version
5*c5591576SRob Johnston  * 1.0 of the CDDL.
6*c5591576SRob Johnston  *
7*c5591576SRob Johnston  * A full copy of the text of the CDDL should have accompanied this
8*c5591576SRob Johnston  * source.  A copy of the CDDL is also available via the Internet at
9*c5591576SRob Johnston  * http://www.illumos.org/license/CDDL.
10*c5591576SRob Johnston  */
11*c5591576SRob Johnston 
12*c5591576SRob Johnston /*
13*c5591576SRob Johnston  * Copyright 2020 Joyent, Inc.
14*c5591576SRob Johnston  */
15*c5591576SRob Johnston 
16*c5591576SRob Johnston #ifndef _TOPO_DIGRAPH_H
17*c5591576SRob Johnston #define	_TOPO_DIGRAPH_H
18*c5591576SRob Johnston 
19*c5591576SRob Johnston #include <fm/topo_mod.h>
20*c5591576SRob Johnston 
21*c5591576SRob Johnston #include <topo_list.h>
22*c5591576SRob Johnston #include <topo_prop.h>
23*c5591576SRob Johnston #include <topo_method.h>
24*c5591576SRob Johnston #include <topo_alloc.h>
25*c5591576SRob Johnston #include <topo_error.h>
26*c5591576SRob Johnston #include <topo_file.h>
27*c5591576SRob Johnston #include <topo_module.h>
28*c5591576SRob Johnston #include <topo_string.h>
29*c5591576SRob Johnston #include <topo_subr.h>
30*c5591576SRob Johnston #include <topo_tree.h>
31*c5591576SRob Johnston 
32*c5591576SRob Johnston #ifdef __cplusplus
33*c5591576SRob Johnston extern "C" {
34*c5591576SRob Johnston #endif
35*c5591576SRob Johnston 
36*c5591576SRob Johnston struct topo_digraph {
37*c5591576SRob Johnston 	topo_list_t	tdg_list;		/* next/prev pointers */
38*c5591576SRob Johnston 	const char	*tdg_scheme;		/* FMRI scheme */
39*c5591576SRob Johnston 	topo_mod_t	*tdg_mod;		/* builtin enumerator mod */
40*c5591576SRob Johnston 	tnode_t		*tdg_rootnode;		/* see topo_digraph_new() */
41*c5591576SRob Johnston 	topo_list_t	tdg_vertices;		/* adjacency list */
42*c5591576SRob Johnston 	uint_t		tdg_nvertices;		/* total num of vertices */
43*c5591576SRob Johnston 	uint_t		tdg_nedges;		/* total num of edges */
44*c5591576SRob Johnston };
45*c5591576SRob Johnston 
46*c5591576SRob Johnston struct topo_vertex {
47*c5591576SRob Johnston 	topo_list_t	tvt_list;		/* next/prev pointers */
48*c5591576SRob Johnston 	tnode_t		*tvt_node;
49*c5591576SRob Johnston 	topo_list_t	tvt_incoming;
50*c5591576SRob Johnston 	topo_list_t	tvt_outgoing;
51*c5591576SRob Johnston 	uint_t		tvt_nincoming;		/* total num incoming edges */
52*c5591576SRob Johnston 	uint_t		tvt_noutgoing;		/* total num outgoing edges */
53*c5591576SRob Johnston };
54*c5591576SRob Johnston 
55*c5591576SRob Johnston struct topo_edge {
56*c5591576SRob Johnston 	topo_list_t	tve_list;		/* next/prev pointers */
57*c5591576SRob Johnston 	topo_vertex_t	*tve_vertex;
58*c5591576SRob Johnston };
59*c5591576SRob Johnston 
60*c5591576SRob Johnston #ifdef __cplusplus
61*c5591576SRob Johnston }
62*c5591576SRob Johnston #endif
63*c5591576SRob Johnston 
64*c5591576SRob Johnston #endif	/* _TOPO_DIGRAPH_H */
65