Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Socket address structure to host name and service name z/OS Communications Server: IPv6 Network and Application Design Guide SC27-3663-00 |
|
The getnameinfo call is a replacement for the existing gethostbyaddr and getservbyport APIs. The getnameinfo call takes an input IP address, an input port number, or both, and returns (when resolution is successful) the hostname or the service location. These parameters are passed in a sockaddr structure that also contains the address family. For input link-local IPv6 addresses, the zone index value in the sockaddr structure is also used as an input by getnameinfo processing. The zone index value in this instance is returned as scope information that is appended to the output host name, using the format hostname%scopeinformation. The form of the scope information can be the numeric form of the zone index value or the interface name associated with the zone index value, which is identified using the if_indextoname() function (see Interface identification for details). The format of the scope information returned to the application as part of the hostname is determined by the flag, NI_NUMERICSCOPE, on the getnameinfo() call. The total length of the combined host name and scope information must be able to fit within the buffer passed by the application (up to a maximum buffer size of 255 characters in length), or the value is truncated to fit within the buffer. In addition to IP address or port number, one of which must be present on a valid getnameinfo invocation, the application can specify more input to the Resolver on the getnameinfo invocation. This input is optional. The input settings include the following settings (various input flag settings can be specified):
|
Copyright IBM Corporation 1990, 2014
|