SLI_RECEIVE(3) — Subroutines
Name
SLI_RECEIVE − Receives data or status from the remote host application program.
FORMAT
#include <lua_c.h>
void SLI(LUA_VERB_RECORD ∗sli_receive_vcb);
Parameter
sli_receive_vcb
A pointer to an LUA_VERB_RECORD structure appropriately initialized for the SLI_RECEIVE verb.
Required Verb Control Block Fields
common.lua_verb
An unsigned short value specifying the verb code LUA_VERB_SLI.
common.lua_verb_length
An unsigned short value specifying the length of the verb control block. Specify the value LUA_COMMON_LENGTH.
common.lua_post_handle
A pointer to a sem_t structure specifying the wait object that the interface should use for asynchronous calls.
common.lua_opcode
An unsigned short value specifying the verb opcode. Specify the value LUA_OPCODE_SLI_RECEIVE.
common.lua_luname
An unsigned char 8-element array specifying the local LU name (in ASCII). If the name is fewer than 8 characters in length, pad the name with space characters.
common.lua_cobol_ptr
This parameter is not currently implemented and should be set to NULL.
common.sid
An unsigned int value specifying the session ID that the interface should use to identify the local LU. If this parameter is 0, the interface uses the common.lua_luname parameter.
common.lua_max_length
An unsigned short value specifying the length of the data buffer referenced by the common.lua_data_ptr parameter.
common.lua_data_ptr
An unsigned char pointer to the data buffer that the interface should use to receive data.
common.lua_flag1
An LUA_FLAG1 structure specifying various flags that control how the interface executes the verb. The following flags are available:
bid_enable---If set, specifies that the LUA application has previously used an SLI_BID verb and that the interface should reissue the SLI_BID verb using the existing SLI_BID verb control block.
nowait---If set, specifies that the interface should return the primary return code of UNSUCCESSFUL with a secondary code of NO_DATA when there is no available data. If data chaining is in use and the first-in-chain request unit has already been received, the interface ignores this flag.
sscp_exp---If set, specifies that the interface should return the next available message on the SSCP-expedited data flow.
sscp_norm---If set, specifies that the interface should return the next available message on the SSCP-normal data flow.
lu_exp---If set, specifies that the interface should return the next available message on the LU-expedited data flow.
lu_norm---If set, specifies that the interface should return the next available message on the LU-normal data flow.
You cannot set flow flags that have already been set on other pending SLI_RECEIVE verbs.
common.lua_flag3
This parameter is not currently implemented. Any fields set are ignored.
Optional Verb Control Block Fields
common.lua_correlator
A void ∗ pointer that can contain either a value or an address of a user-supplied data structure. The LUA application can use this parameter to correlate this verb control block with other user-supplied data structures. The interface does not read from or write to this field.
Returned Verb Control Block Fields
common.lua_prim_rc
An unsigned short value containing the primary error code.
common.lua_sec_rc
An unsigned int value containing the secondary error code.
common.lua_sid
An unsigned int value containing the session ID that subsequent verbs can use to specify the session to the interface.
common.lua_th
An LUA_TH structure containing the transmission header (TH) which accompanied the received data. The following TH fields are returned:
flags_efi---The single-bit expedited flow indicator.
flags_odai---The single-bit originating address field (OAF) destination address field (DAF) assignor indicator.
flags_mpf---The 2-bit segmenting mapping field.
flags_fid---The 4-bit format identification type field.
daf---The destination address field.
oaf---The originating address field.
snf---The sequence number field. This field contains the sequence number of the last-in-chain request/response unit.
common.lua_rh
An LUA_RH structure containing the request/response header (RH) which accompanied the received data. Except for the ri field, the returned fields are a composite of all RUs in the data chain. The ri field is the status of this field in the last-in-chain RU.
The following RH fields are returned:
eci---The end chain indicator.
bci---The begin chain indicator.
sdi---The sense data included indicator.
fi---The format indicator.
ruc---The request unit category.
rri---The request-response indicator.
pi---The pacing indicator.
qri---The queued response indicator.
ri---The exception response indicator (ERI) for requests or the response type indicator (RTI) for responses.
dr2i---The definite response 2 indicator.
dr1i---The definite response 1 indicator.
pdi---The padded data indicator.
edi---The enciphered data indicator.
csi---The code selection indicator.
cdi---The change direction indicator.
ebi---The end bracket indicator.
bbi---The begin bracket indicator.
common.lua_flag2
An LUA_FLAG2 structure containing various flags that indicate how the interface executed the verb. The following flags are returned:
async---If set, indicates that the interface is completing the verb asynchronously.
bid_enable---If set, indicates that the bid enable function of the SLI_RECEIVE request completed successfully; the interface reenabled the bid. See the return codes for the status of the data receive function of the SLI_RECEIVE request.
sscp_exp---If set, indicates that the message was received on the SSCP-expedited data flow.
sscp_norm---If set, indicates that the message was received on the SSCP-normal data flow.
lu_exp---If set, indicates that the message was received on the LU-expedited data flow.
lu_norm---If set, indicates that the message was received on the LU-normal data flow.
common.lua_message_type
An unsigned char value containing the SNA message type. The following values are possible:
LUA_MESSAGE_TYPE_BID
LUA_MESSAGE_TYPE_BIS
LUA_MESSAGE_TYPE_CANCEL
LUA_MESSAGE_TYPE_CHASE
LUA_MESSAGE_TYPE_LU_DATA
LUA_MESSAGE_TYPE_LUSTAT_LU
LUA_MESSAGE_TYPE_LUSTAT_SSCP
LUA_MESSAGE_TYPE_QC
LUA_MESSAGE_TYPE_QEC
LUA_MESSAGE_TYPE_RELQ
LUA_MESSAGE_TYPE_RSP
LUA_MESSAGE_TYPE_RTR
LUA_MESSAGE_TYPE_SBI
LUA_MESSAGE_TYPE_SIGNAL
LUA_MESSAGE_TYPE_SSCP_DATA
Description
Use the lua_flag1 parameter to indicate on which data flow you wish the interface to receive data. If you set multiple data flow flags in the lua_flag1 parameter, the interface returns the data on the highest priority flow according to the priority shown in the following list:
SSCP-expedited
LU-expedited
SSCP-normal
LU-normal
The interface uses the lua_flag2 parameter to return an indication of the data flow on which the returned data was received.
The interface transfers the data to the buffer referenced by the lua_data_ptr and lua_max_length parameter. The SLI places the actual length of the data in the lua_data_length parameter. If the data exceeds the buffer size, the interface returns the secondary return code LUA_DATA_TRUNCATED.
The returned data does not include the TH or RH; the interface returns this information in the lua_th and lua_rh parameters respectively.
The LUA application can have up to four SLI_READ requests pending for each LU; one for each of the four data flows.
When data chaining is in use, the returned data is the entire data chain. The data chain can be one or more RUs.
A special use of the SLI_RECEIVE verb allows the LUA application to repost an SLI_BID request.
A second special use of the SLI_RECEIVE verb allows the LUA interface to return session status to the LUA application. If the interface has session status to return, it sets the primary return code to LUA_STATUS and the secondary return to the session’s status. The LUA application must read this status before it can use any other verb (with the exceptions of SLI_CLOSE and SLI_SEND for the SSCP-LU data flow). The interface returns the following four status values:
•LUA_NOT_READY---Indicates that the interface received a CLEAR command or UNBIND command with a type value of X’01’ or X’02’ from the IBM system. As a result, the DIGITAL SNA gateway has suspended the underlying session.
•CLEAR suspends the session until the IBM system sends an SDT command.
•UNBIND type X’02’ suspends the session until the IBM system sends a BIND (possibly followed by STSN and SDT commands).
•If the LUA application opened the session with an SLI_OPEN verb whose specific.open.lua_session_type parameter was set to LUA_SESSION_TYPE_DEDICATED, an UNBIND type X’01’ functions like an UNBIND type X’02’. That is, it suspends the session until the IBM system sends a BIND (possibly followed by STSN and SDT commands).
After reading the LUA_NOT_READY status, the LUA application can send and receive SSCP-LU data.
•LUA_READY---Indicates that the underlying session is now ready for additional message flow.
•LUA_SESSION_END_REQUESTED---Indicates that the IBM system has sent a SHUTD command. This command requests the LUA application and the LUA interface to perform an orderly shutdown. The LUA application should issue an SLI_CLOSE verb with the lua_flag1.close_abend flag set to 0.
•LUA_INIT_COMPLETE---Indicates that the SSCP-LU session initialization processing has completed. The LUA application can now send and receive data on the SSCP-LU flow. The interface only returns this status when the LUA application opened the session with an SLI_OPEN verb whose specific.open.lua_init_type parameter was set to LUA_INIT_TYPE_PRIM_SSCP.
Primary Return Codes
LUA_OK
LUA_CANCELLED
LUA_COMM_SUBSYSTEM_ABENDED
LUA_COMM_SUBSYSTEM_NOT_LOADED
LUA_IN_PROGRESS
LUA_INVALID_VERB
LUA_INVALID_VERB_SEGMENT
LUA_PARAMETER_CHECK
LUA_SESSION_FAILURE
LUA_STATE_CHECK
LUA_STATUS
LUA_UNEXPECTED_DOS_ERROR
LUA_UNSUCCESSFUL