The following code returns a pointer to a HOSTENT structure, which contains the alias names and the internet addresses of a host whose address is specified as input. For the callable service, see gethostbyaddr (BPX1GHA, BPX4GHA) Get the IP address and alias of a host name for the specified IP address. AMODE 64 callers use BPX4GHA (gethostbyaddr) example.
* MVC HOST_ADDR,=XL4'C90E0256' IP Address of Host
MVC HOST_ADDRLEN,=F'4' Address length
SPACE ,
CALL BPX1GHA, Get host by address +
(HOST_ADDR, Input: IP address of queried HOST +
HOST_ADDRLEN, Input: Length of IP address +
HOSTENT_PTR, Output: 0 or -> HOSTENT structure +
=A(AF_INET), Input: Domain - AF_INET +
RETVAL, Return code +
RETCODE, Return code +
RSNCODE), Reason code +
VL,MF=(E,PLIST) ----------------------------------