The GETHOSTBYADDR call returns the domain name and alias name of a host whose IPv4 IP address is specified in the call. A given TCP⁄IP host can have multiple alias names and multiple host IPv4 IP addresses. The address resolution attempted depends on how the resolver is configured and if any local host tables exist. See z/OS Communications Server: IP Configuration Guide for information about configuring the resolver and how local host tables can be used.
Authorization: | Supervisor state or problem state. The PSW key must match the key in which the MVS™ application task was attached |
Dispatchable unit mode: | Task. |
Cross memory mode: | PASN = HASN. |
Amode: | 31-bit or 24-bit. Note: See "Addressability
mode (Amode) considerations" under CALL instruction API environmental restrictions and programming requirements.
|
ASC mode: | Primary address space control (ASC) mode. |
Interrupt status: | Enabled for interrupts. |
Locks: | Unlocked. |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
Figure 1 shows an example of GETHOSTBYADDR call instructions.
WORKING-STORAGE SECTION.
01 SOC-FUNCTION PIC X(16) VALUE IS 'GETHOSTBYADDR'.
01 HOSTADDR PIC 9(8) BINARY.
01 HOSTENT PIC 9(8) BINARY.
01 RETCODE PIC S9(8) BINARY.
PROCEDURE DIVISION.
CALL 'EZASOKET' USING SOC-FUNCTION HOSTADDR HOSTENT RETCODE.
For equivalent PL/I and assembler language declarations, see Converting parameter descriptions.