Ets_Topo_To_Graph()

Abstract

Creates a PrgT_Graph object from a given network topology.

Syntax

Ets_Topo_To_Graph (net_model_hndl, graph_state_id, namespace, vertex_state_create_proc, edge_state_create_proc, filter_proc, state_ptr, options)
Argument Type Description
net_model_hndl EtsT_Model_Handle The handle of the network model for which the graph will be created
graph_state_id PrgT_Graph_State_ID An already registered state ID for the state that will be attached to each graph edge and vertex
namespace char* the name of the namespace in which the handlers for the graph_state_id’s state were registered
vertex_state_create_proc EtsT_Topo_Graph_Vertex_State_Create_Proc A function that takes in a handle to the node for which a graph vertex is being created, as well as the state passed in through the state_ptr, and returns the state to be attached to the new vertex
edge_state_create_proc EtsT_Topo_Graph_Edge_State_Create_Proc A function that takes in a handle to the link for which a graph edge is being created, as well as the state passed in through the state_ptr, and returns the state to be attached to the new edge
filter_proc EtsT_Topo_Graph_Filter_Proc A function that takes in the object handle and returns whether or not a graph object should be created for that specific object
state_ptr void * Additional state that is passed to the vertex_state_create_proc and edge_state_create_proc for use in creating a graph object state.
options int How to convert duplex links to edges. Can be ETSC_TOPO_CREATE_TWO_SIMPLEX_FOR_DUPLEX or ETSC_TOPO_CREATE_NATIVE_EDGES. See Table 42 Topology Package Symbolic Constants for details.

Return Type

PrgT_Graph *

a representation of the network model as a graph

ets_api_topo.h

Details

This procedure is used to convert a network model’s topology into a PrgT_Graph object. The PrgT_Graph object can then be used in conjunction with the Prg packages, such as the Djk routing package.

This procedure allows the client to specify an additional state that can be attached to the resulting PrgT_Graph’s vertices (PrgT_Graph_Vertex) and edges (PrgT_Graph_Edge). However, this state must be defined ahead of the procedure call by using prg_graph_state_handler_register(), and obtaining a state id that is passed in as the graph_state_id argument. Since the new graph will be created in the same namespace as the state’s handlers, the state’s namespace must also be passed as an argument. Additionally, the client must define two procedures (vertex_state_create_proc and edge_state_create_proc) that allow the procedure to create a new state for each vertex and edge.

Additionally, should the client not want to create a graph out of every object in the model, the filter_proc argument allows the user to define a function that determines if an object should be included in the graph.

The three callback arguments use the following type definitions:

typedef void*
(*EtsT_Topo_Graph_Vertex_State_Create_Proc)(EtsT_Obj_Handle obj_handle,
	PrgT_Graph_Vertex* vertex_ptr, void* state_ptr);

typedef void*
(*EtsT_Topo_Graph_Edge_State_Create_Proc) (EtsT_Obj_Handle obj_handle,
	PrgT_Graph_Edge* edge_ptr, void* state_ptr);

typedef int
(*EtsT_Topo_Graph_Filter_Proc) (EtsT_Obj_Handle obj_handle);

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com