Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.72 KB

gethostbyaddr.md

File metadata and controls

60 lines (42 loc) · 1.72 KB

Home

Function name : gethostbyaddr

Group: Windows Sockets 2 (Winsock) - Library: ws2_32


The gethostbyaddr function retrieves the host information corresponding to a network address.


Code examples:

Winsock: retrieving the host information corresponding to a network address
Retrieving the IP-to-physical address mapping table
Retrieving the interface–to–IP address mapping table
How to retrieve network parameters for the local computer (including Host name, Domain name, and DNS Server)

Declaration:

struct HOSTENT FAR * gethostbyaddr(
  const char FAR *addr,
  int len,
  int type
);  

FoxPro declaration:

DECLARE INTEGER gethostbyaddr IN ws2_32;
	STRING  addr,;
	INTEGER len,;
	INTEGER type  

Parameters:

addr [in] Pointer to an address in network byte order.

len [in] Length of the address.

type [in] Type of the address, such as the AF_INET address family type (defined as TCP, UDP, and other associated Internet protocols). Address family types and their corresponding values are defined in the Winsock2.h header file.


Return value:

If no error occurs, gethostbyaddr returns a pointer to the hostent structure. Otherwise, it returns a NULL pointer, and a specific error code can be retrieved by calling WSAGetLastError.


Comments:

The gethostbyaddr function has been deprecated by the introduction of the getnameinfo function.