The GETNAMEINFO call returns the node name and service
location of a socket address that is specified in the call. On successful
completion, GETNAMEINFO returns the node and service named, if requested,
in the buffers provided.
The following requirements apply to this call:
Authorization: |
Supervisor state or problem state, any PSW key. |
Dispatchable unit mode: |
Task. |
Cross memory mode: |
PASN = HASN. |
Amode: |
31-bit or 24-bit.
|
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. GETNAMEINFO
call instruction example WORKING-STORAGE SECTION.
01 SOC-FUNCTION PIC X(16) VALUE IS 'GETNAMEINFO'.
01 NAMELEN PIC 9(8) BINARY.
01 HOST PIC X(255).
01 HOSTLEN PIC 9(8) BINARY.
01 SERVICE PIC X(32).
01 SERVLEN PIC 9(8) BINARY.
01 FLAGS PIC 9(8) BINARY VALUE 0.
01 NI-NOFQDN PIC 9(8) BINARY VALUE 1.
01 NI-NUMERICHOST PIC 9(8) BINARY VALUE 2.
01 NI-NAMEREQD PIC 9(8) BINARY VALUE 4.
01 NI-NUMERICSERVER PIC 9(8) BINARY VALUE 8.
01 NI-DGRAM PIC 9(8) BINARY VALUE 16.
01 NI-NUMERICSCOPE PIC 9(8) BINARY VALUE 32.
* IPv4 socket structure.
01 NAME.
03 FAMILY PIC 9(4) BINARY.
03 PORT PIC 9(4) BINARY.
03 IP-ADDRESS PIC 9(8) BINARY.
03 RESERVED PIC X(8).
* IPv6 socket structure.
01 NAME.
03 FAMILY PIC 9(4) BINARY.
03 PORT PIC 9(4) BINARY.
03 FLOWINFO PIC 9(8) BINARY.
03 IP-ADDRESS.
10 FILLER PIC 9(16) BINARY.
10 FILLER PIC 9(16) BINARY.
03 SCOPE-ID PIC 9(8) BINARY.
01 ERRNO PIC 9(8) BINARY.
01 RETCODE PIC S9(8) BINARY.
PROCEDURE DIVISION.
MOVE 28 TO NAMELEN.
MOVE 255 TO HOSTLEN.
MOVE 32 TO SERVLEN.
MOVE NI-NAMEREQD TO FLAGS.
CALL 'EZASOKET' USING SOC-FUNCTION NAME NAMELEN HOST
HOSTLEN SERVICE SERVLEN FLAGS ERRNO RETCODE.