VMS Help
TCPIP Services, Programming Interfaces, Sockets API, gethostbyaddr()
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
Searches the hosts database sequentially from the beginning for a
host record with a given IPv4 address.
The $QIO equivalent is the IO$_ACPCONTROL function with the
INETACP_FUNC$C_GETHOSTBYADDR subfunction code.
Format
#include <netdb.h>
struct hostent *gethostbyaddr ( const void *addr, size_t len,
int type );
addr
A pointer to a series of bytes in network order specifying the
address of the host sought.
len
The number of bytes in the address pointed to by the addr
argument.
type
The type of address format being sought. Currently, only AF_INET
is supported.
This function finds the first host record in the hosts database
with the given address.
The gethostbyaddr() function uses a common static area for its
return values. This means that subsequent calls to this function
overwrite previously returned host entries. You must make a copy
of the host entry if you want to save it.
NULL Indicates an error; errno is set to one of the
following values.
x A pointer to an object having the hostent
structure.
ENETDOWN TCP/IP Services was not started.
HOST_NOT_FOUND Host is unknown.
NO_DATA The server recognized the request and the
name, but no address is available for the
name. Another type of name server request may
be successful.
NO_RECOVERY An unexpected server failure occurred. This is
a nonrecoverable error.
TRY_AGAIN A transient error occurred, for example,
the server did not respond. A retry may be
successful.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.