CHANGING THE GRAPH
A number of functions can be used to create or destroy nodes and hooks. The function ng_mkpeer_id creates a new node of type type whose hook peerhook will be connected to hook of node id. If name is not NULL the new node is named with this name. The function returns The node id of the new node or 0 if an error happens.
The functions ng_connect_node and ng_connect_id make a new hook connecting ourhook of the modules socket node snmp_node to peerhook of the node identified by id id or name node. The functions return 0 on success or -1 otherwise.
The function ng_connect2_id connects hook ourhook of the node with id id to hook peerhook of the node with id peer. The functions return 0 on success or -1 otherwise. The function ng_connect2_tee_id does the same as ng_connect2_id except, that it puts an unnamed tee node between the two nodes.
The function ng_rmhook removes hook hook on the modules snmp_node. The function ng_rmhook_id removes hook hook on the node with id id. The function ng_rmhook_tee_id additionally shuts down all tee nodes between the node and the first non-tee peer.
The function ng_shutdown_id destroys the given node.
FILES