TCP/IP Programming Manual

A successful function call returns a pointer to the hostent structure that contains the hostname.
The structure returned also contains the values used for src and address-family.
lwres_getipnodebyname
The lwres_getipnodebyname function gets host information based on the hostname. This
function is protocol-independent. (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 <netdb.h>
return_val = lwres_getipnodebyname (const
char * name, int af, int flags, int * error_ptr);
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
return_val := lwres_getipnodebyname( name, af, flags, error_ptr);
INT (320 return_val;
STRING .EXT name;
INT af;
INT flags;
INT .EXT error_ptr;
return_val
is a pointer to a structure of type hostent.
name
input value; a pointer to a node name or numeric address string, such as an IPv4 dotted-decimal
address or an IPv6 hexadecimal address.
af
input value; an integer that sets the address type searched for by the function and returned by
the function. af is either AF_INET (IPv4) or AF_INET6 (IPv6).
flags
input value; contains flag bits to specify the types of addresses that are searched for and the
types of addresses that are returned. The flag bits are:
AI_V4MAPPED
Used with an af of AF_INET6, causes IPv4 addresses to be returned as IPv4-mapped IPv6
addresses.
AI_ALL
Used with an af of AF_INET6, causes all known addresses (IPv6 and IPv4) to be returned.
If AI_V4MAPPED is also set, the IPv4 addresses are returned as mapped IPv6 addresses.
AI_ADDRCONFIG
Causes a return of an IPv6 or IPv4 address only if an active network interface of that type
exists. This flag bit is not currently implemented in the BIND 9 Lightweight resolver, and
the flag is ignored.
AI_DEFAULT
Sets the AI_V4MAPPED and AI_ADDRCONFIG flag bits.
error_ptr
input and return value; a pointer to the error code returned by the lwres_getipnodebyname
function.
lwres_hstrerror (page 152) translates these error codes to readable error messages.
lwres_getipnodebyname 149