function
Library: Network utilities (OMNETUTIL)
Import : omnetutl.xmd |
Returns: name of a host computer given its IP address |
define external stream function netutil.host-name of value string Host-IP optional
Argument definitions
Use netutil.host-name to retrieve the official name of a host computer given its Internet Protocol (IP) address.
The IP address must be specified in dotted decimal format (for example, "127.0.0.1").
If no IP address is specified, netutil.host-name
returns the name of the local host. If this function fails to retrieve the host name, it returns the passed IP address.
import "omnetutil.xmd" prefixed by netutil. process local stream address initial {"206.116.41.138"} output "The name of the machine at IP address " || address || " is: " || netutil.host-name of address || "%n" output "The local host name is: " || netutil.host-name || "%n"