In a Discrete Event Simulation, how do I find all IP addresses on a given node?

Categories:
Solution Number:
S20819
Last Modified:
2013-08-20
Issue

In a Discrete Event Simulation, how do I find all IP addresses on a given node?

Solution

You will need the node objid to find an IP address on the node. You can get the node objid if you have the hierarchical name of the node. The function to use is ip_support_node_id_from_name_get () (declared in ip_support.h).If you are interested in ANY ONE address on the node, you can call the function ip_support_address_from_node_id_get () [defined in ip_support.h). Host devices like workstations and servers typically have only one address. This function will return that address. In case of routers and multi-homed clients/servers, this function will return the address of the first loopback interface. If there is no loopback address, it will return the address of a physical interface. If you are interested in getting all the addresses on a router or a multihomed device, one of the following approaches may be used.Method 1========Get the module data of type IpT_Rte_Module_Data* using the function ip_support_module_data_get () (declared in ip_support.h).Get the number of interfaces on this node using ip_rte_num_interfaces_get ()(declared in ip_rte_support.h).Loop through the interfaces of this module using ip_rte_intf_tbl_access (declared in ip_rte_support.h).Query each interface for its address using ip_rte_intf_addr_get () (declared in ip_rte_support.h)Method 2========Another way to do this is using the TPAL API:- Use tpal_ip_addr_from_name () to get a TPAL IP address map. The name to pass is the hierarchical name of the node. The function is declared in tpal_ip_v3.h. The returned value is a pointer to a structure of type TpalT_Ip_Addr_Map.- Go through the list of IP addresses present in the address map.

Environment

DES Kernel->Process Modeling/Coding,Protocols->IP

Attachments
NOTICE: Riverbed® product names have changed. Please refer to the Product List for a complete list of product names.
Can't find an answer? Create a case