|
|
HP-UX IPv6 Porting Guide: HP-UX 11i v2 September 2004 > Chapter 7 Function Calls Converting IP addresses
to Namesgetnameinfo(3N) |
|
The getnameinfo() function takes a socket-address structure and returns a node name or service name.
The getnameinfo() function translates a socket address to a node name and service location. The definitions for getaddrinfo() apply to getnameinfo(). *sa: A pointer to a socket-address structure awaiting translation. sockelen_t: The integer size of the socket address structure pointed to by sa. *host: A pointer to the host name returned by getnameinfo().If the function finds no host name, it returns the host’s IP address If host points to NULL or hostlen equals zero, then host does not return a host name or IP address. Both host and serv cannot point to NULL. hostlen: The length of the character string host. *serv: A pointer to the service name returned by getnameinfo(). If it finds no service name, it returns the service’s port number. If serv points to NULL or servlen equals zero, then serv does not return a service name or port number. servlen: The length of the character string serv. flags: flags change the default actions of the function.
|
|