Returns information about a host, given its Internet address.
#include <netdb.h> struct hostent *gethostbyaddr ( const char *addr, int len, int type);
(IN) Points to an in_addr structure containing the host’s Internet address. This address is in binary format (that is, not null terminated) and in network byte order.
(IN) Specifies the length of the Internet address, in bytes.
(IN) Specifies the value corresponding to the type of Internet address (always AF_INET).
If successful, returns a pointer to a structure of type hostent. Otherwise, returns NULL and sets h_errno to the following:
When the type is AF_INET, the gethostbyaddr function accepts a pointer to a in_addr structure containing the Internet address, an integer value representing the length, and an integer value representing the application family type. The numeric Internet address is expressed in network byte order; the Internet address length is expressed in bytes.
Calling any database routine overwrites the results of the last call to this function.