Open System Services Library Calls Reference Manual (G06.27+, H06.04+)
lwres_gethostbyaddr(3) OSS Library Calls Reference Manual
NAME
lwres_gethostbyaddr - Gets the name of the host with the specified Internet address and 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_gethostbyaddr (
const void *addr,
size_t len,
int type
);
PARAMETERS
addr Points to the Internet address of the host whose name is to be found. The address
pointed to is in binary format and network order. (This address is in the same
format and order as the return value of the inet_addr( ) function.)
len Is the length of the Internet address pointed to by the returned pointer.
type Is the type of address specified. It is either AF_INET (IPv4) or AF_INET6
(IPv6).
DESCRIPTION
The lwres_gethostbyaddr() function gets the name of the host with the specified Internet
address and address family. This function provides the same information as the gethostbyaddr( )
function but uses the Domain Name System (DNS) lightweight resolver server lresd instead of
the named DNS server.
NOTES
The address that is returned can be directly used in a sockaddr_in structure. The address is in
network order.
RETURN VALUES
Upon successful completion, the lwres_gethostbyaddr() function points to a structure (based on
the hostent structure) in which information on the specified host is returned. The information
includes the official name, aliases, and addresses for the host. If the lookup fails, NULL is
returned, and the external variable lwres_h_errno is set as indicated in the ERRORS section of
this reference page.
ERRORS
lwres_gethostbyaddr() returns NULL to indicate an error. In this case, the global variable
lwres_h_errno contains one of the following error codes as defined in the netdb.h header file:
HOST_NOT_FOUND
The host or address was not found.
TRY_AGAIN A recoverable error occurred (for example, a timeout). Retrying the lookup
might succeed.
4−100 Hewlett-Packard Company 527187-004