Download ADAM-4500 Series
Transcript
Chapter 5 Programming and Function Library
gethostbyaddr
Syntax:
struct hostent * gethostbyaddr ( const char * pcAddr, int len, int type )
Description:
Gets host information corresponding to an address.
Parameters
pcAddr
len
4 for
Description
A pointer to an address in network byte order.
The length of the address, which must
be
PF_INET addresses.
The type of the address, which must be PF_INET.
type
Return Value
If no error occurs, gethostbyaddr() returns a pointer to the
hostent structure described above. Otherwise it returns a NULL pointer
and a
specific error number is returned in errno.
Error Codes
ENETDOWN
WSAHOST_NOT_FOUND
WSATRY_AGAIN
or
WSANO_RECOVERY
WSANO_DATA
SOCKETS
has
detected
that
the network subsystem has failed.
Authoritative Answer Host not found.
Non-Authoritative Host not found,
SERVERFAIL.
Non-recoverable errors, FORMERR,
REFUSED, NOTIMP.
Valid name,
no data record of
requested type.
Remarks
gethostbyaddr() returns a pointer to the following structure
which contains the name(s) and address which correspond to
the given
address.
struct hostent
{
char * h_name;
char ** h_aliases;
short h_addrtype;
ADAM-4500 Series User’s Manual
5-179
Related documents
ADAM 5510 Series
Elegant Manual
IUP - LuaForge
NetRockey4ND User`s Guide
ASX User Manual
FX3U-ENET USER`S MANUAL
PVRScope User Manual - Imagination Technologies
Page 1 of 396 27/07/2014
Final Report - Michigan State University
IUP - Portable User Interface
ADAM-6000
IUP - Portable User Interface - PUC-Rio