Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

lwres_gethostbyname2(3) OSS Library Calls Reference Manual
NAME
lwres_gethostbyname2 - Gets an Internet host entry by name and IPv4 or IPv6 address family
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <netdb.h>
extern lwres_h_errno;
struct hostent *lwres_gethostbyname2 (
const char *name,
int af);
PARAMETERS
name Points to either the ofcial name or an alias of the host whose Internet address is
to be found.
af Species the address family searched for and returned by the function. Valid
values are AF_INET (IPv4) or AF_INET6 (IPv6).
DESCRIPTION
The lwres_gethostbyname2() function searches host entries sequentially until a match with the
value pointed to by the name parameter occurs. This function provides the same information as
the gethostbyname2() function but uses the Domain Name System (DNS) lightweight resolver
server lwresd instead of the named DNS server.
The lwres_gethostbyname2() function returns a pointer to a structure of type hostent whose
members specify data obtained from a name server specied in the /etc/resolv.conf le or from
elds of a record line in the /etc/hosts network hostname database le. (When the name server is
not running and /etc/resolv.conf can not be searched, this function searches the /etc/hosts name
le.)
The <netdb.h> header le denes the hostent structure.
NOTES
The name value passed to the lwres_gethostbyname2() function is case-sensitive.
The hostent structure is statically declared. Subsequent calls to lwres_gethostbyname2()
replace the existing data in the hostent structure.
RETURN VALUES
Upon successful completion, lwres_gethostbyname2() returns a pointer to a structure (based on
the hostent structure) in which information on the specied host is returned. The information
includes the ofcial name, aliases, and addresses for the host.
If the call to lwres_gethostbyname2() fails, a null pointer is returned.
ERRORS
If any of the following conditions occur, the lwres_gethostbyname2() function sets
lwres_h_errno to the value that corresponds to the condition:
HOST_NOT_FOUND
The name you have used is not a valid hostname or alias. This is not a soft error;
another type of name server request might be successful.
This is the only possible value if the resolver code has been disabled.
4102 Hewlett-Packard Company 527187-004