TCP/IP Programming Manual

specify data from a Name Server. (This function is supported for G06.27 and later G-series RVUs
and H06.05 and later H-series RVUs of NonStop TCP/IPv6.)
C Synopsis
#include <sys/socket.h>
#include <netdb.h>
return_val = lwres_getipnodebyaddr(const
void *src, socklen_t len, int af, int *error_ptr);
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
return_val := lwres_getipnodebyaddr( src, len, af, error_ptr);
INT(32) return_val;
STRING .EXT src;
INT(32) len;
INT af;
INT .EXT error_ptr;
return_val
is a pointer to a structure of type hostent.
src
input value; a pointer to an IP address for which the hostname should be returned; the address
specified should be in binary format and network order.
len
input value; the length of the IP address: 4 octets for AF_INET or 16 octets for AF_INET6.
af
input value; specifies the member of the address family: AF_INET or AF_INET6.
error_ptr
input and return value; a pointer to the integer containing an error code, if any.
Errors
If an error occurs, lwres_getipnodebyaddr sets *error_ptr to an appropriate error code,
and the function returns a NULL pointer. The error codes and their meanings are defined in netdb.h:
HOST_NOT_FOUND
The specified host was not found.
TRY_AGAIN
A temporary, and possibly transient, error occurred, such as a server not responding.
NO_RECOVERY
An unexpected server failure occurred which cannot be recovered.
NO_ADDRESS
The specified hostname is valid, but the host does not have an IP address. Another type of
request to the Name Server for the domain might return an error.
lwres_hstrerror (page 152) translates these error codes to suitable error messages.
Usage Guidelines
lwres_getipnodebyaddr provides the same functionality as lwres_gethostbyaddr, but is
protocol-independent.
148 Library Routines