Subnet Sub-Package
The Network package provides APIs to modify and query subnets. Subnets are objects that can contain other network objects. For example, a subnet could represent a city which contains multiple switches, represented by child nodes.
The interface Ets_Nt_Subnet_Current_Get() returns the ETS object handle of the current subnet of a given model, while Ets_Nt_Subnet_Current_Set() permits you to set a subnet to be currently active. Ets_Nt_Subnet_Map_Set() and Ets_Nt_Subnet_Map_Get() will set and get the current geographical map of a given subnet. To get the bounding rectangle (in latitude-longitude) for a map, use Ets_Nt_Subnet_Map_Extents_Get(). You can also display iso-elevation line maps. These are associated with a subnet using Ets_Nt_Subnet_Iso_Map_Names_Set() and queried using Ets_Nt_Subnet_Iso_Map_Names_Get().
Ets_Nt_Subnet_Bounds_Get() provides a way to obtain the size of the area represented by the subnet while Ets_Nt_Subnet_Objview_Coords_Get() returns the area covering all the objects inside the subnet (which might be smaller than the actual subnet area). Ets_Nt_Subnet_View_Coords_Get() returns the coordinates of the upper-left and lower-right corner of the subnet in its parent's units, while Ets_Nt_Subnet_View_Coords_Set() is used to set these coordinates. To set the view to show all objects in a subnet, use Ets_Nt_Subnet_Zoom_To_Content().
The grid style, color and units of a subnet can be queried and set via the interfaces Ets_Nt_Subnet_Grid_Properties_Set() and Ets_Nt_Subnet_Grid_Properties_Get(). Both interfaces allow you to specify which property to set or query. The provided value depends on the kind of property.
To remove all the properties from a given subnet use Ets_Nt_Subnet_Clear().
Subnets contain a variable number of layers—called slices—that store specific types of information to be displayed in the workspace. Ets_Nt_Subnet_Slice_Count_Get() returns the number of slices in a specified subnet. You can use Ets_Nt_Subnet_Slice_Insert(), Ets_Nt_Subnet_Slice_Nth_Get(), and Ets_Nt_Subnet_Slice_Nth_Remove() to add or remove slices in a subnet. (The Slice sub-package allows you to manage slices.)
You can capture an image of a subnet using Ets_Nt_Subnet_Image_Capture() or Ets_Nt_Subnet_Image_Capture_Core().
Subnet Grouping
The Subnet sub-package contains a function and three callback types that support the Group Nodes into Subnets feature. The callback types are used to create functions that implement a subnet grouping plug-in. The function, Ets_Nt_Subnet_Grouping_Perform(), creates a new subnet hierarchy by applying a grouping settings file to a list of nodes.
A subnet grouping plug-in defines a grouping operation for the Group Nodes into Subnets feature. is a set of callback functions that the GUI uses to request grouping parameters from the user, display the parameters, and perform the actual grouping. The plug-in consists of two files: a grouping definition file that registers the necessary callback functions and a library that implements the callbacks. Both files must be in a directory listed in the “mod_dirs“ preference. (The grouping plug-ins are in the <reldir>/sys/utilities directory.)
The grouping definition file is a text file with a .gpf extension. It contains one or more plug-in descriptions that look like the following example:
start_grouping_definition
grouping name: Move nodes to a subnet
description: Moves a specified group of nodes into a new subnet
parameter dialog callback: move_nodes_lib move_nodes_param_dialog_callback
parameter display callback: move_nodes_lib move_nodes_param_display_callback
grouping callback: move_nodes_lib move_nodes_perform_callback
end_grouping_definition
The definition elements are defined as follows:
- grouping name—a unique identifier used to find a particular plug-in. This name is used in the Operation pop-up menu of the Grouping Operations dialog box.
- description—extended description of the grouping.
- parameter dialog callback—the library and name of the function to use for requesting grouping parameters from the user. The prototype is given in
EtsT_Nt_Subnet_Grouping_Param_Dialog_Callback. This element is optional and can be omitted if no parameters are needed. - parameter display callback—the library and name of the function to use for displaying the grouping parameters to the user. The prototype is given in
EtsT_Nt_Subnet_Grouping_Param_Display_Callback. This element is optional and can be omitted if no parameters were requested. - grouping callback—the library and name of the function to use to perform the actual grouping operation. The prototype is given in
EtsT_Nt_Subnet_Grouping_Perform_Callback.