Receive Data (QOLRECV) API

  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Receive Data (QOLRECV) API performs an input operation on a link that is currently enabled in the job in which the application program is running. The type of data received is returned in the operation parameter. The data itself, is returned in the input buffer that was created when the link was enabled. For X'0001' operations, a description of that data is also be returned in the input buffer descriptor that is created when the link was enabled.

The QOLRECV API can receive different types of data depending on the type of communications line the link is using. See LAN Input Operations for more information on the types of data that can be received on links using a token-ring, Ethernet, wireless, or FDDI communications line. See X.25 SVC and PVC Input Operations for more information on the types of data that can be received on links using an X.25 communications line.

Note: The QOLRECV API should only be called when the user-defined communications support has data available to be received. This is indicated either by an incoming-data entry on the data queue or user queue, or by the data available parameter on the QOLRECV API.


Authorities and Locks

None.


Required Parameter Group

Return code
OUTPUT; BINARY(4)

The recovery action to take. See Return and Reason Codes.

Reason code
OUTPUT; BINARY(4)

The error that occurred. See Return and Reason Codes.

Existing user connection end point ID
OUTPUT; BINARY(4)

The user connection end point (UCEP) ID that the data was received on. For links using a token-ring, Ethernet, wireless, or FDDI communications line, the content of this parameter will always be 1.

For links using an X.25 communications line, the content of this parameter is only valid when the operation parameter is X'0001', X'B001', X'B101', X'B301', or X'BF01'. It will contain the UCEP ID that was provided in the new user connection end point ID parameter on the call to the QOLSEND API with operation X'B000' or X'B400'.

Note: If an incoming X.25 SVC call is rejected by the user-defined communications application program by calling the QOLSEND API with operation X'B100', the content of this parameter will be set to zero when notification of the completion of the X'B100' operation is received from the QOLRECV API (operation X'B101').

New provider connection end point ID
OUTPUT; BINARY(4)

The provider connection end point (PCEP) ID for the connection that is to be established. This identifier must be used on all subsequent calls to the QOLSEND API for this connection.

The content of this parameter is only valid for links using an X.25 communications line and when the operation parameter is X'B201'.

Operation
OUTPUT; CHAR(2)

The type of data received by the application program. With the exception of X'0001', all values are only valid for links using an X.25 communications line. The valid values are as follows:

Note: The special value of X'0000' will be returned in the operation parameter to indicate no data was received from the QOLRECV API. See Return and Reason Codes for more information.

Number of data units
OUTPUT; BINARY(4)

The number of data units in the input buffer that contain data. Any value between 1 and the number of data units created in the input buffer may be returned when the operation parameter is X'0001'. Otherwise, any value between 0 and 1 may be returned.

Note: The number of data units created in the input buffer was returned in the data units created parameter on the call to the QOLELINK API. See Enable Link (QOLELINK) API for more information.

Data available
OUTPUT; CHAR(1)

Specifies whether more data is available for the user-defined communications application program to receive. The valid values are as follows:

Note: An incoming-data entry will be sent to the data queue or user queue only when the content of this parameter is X'00' and then more data is subsequently available to be received. See Incoming-data entry for more information.

Diagnostic data
OUTPUT; CHAR(40)

Specifies additional diagnostic data. See Format of Diagnostic Data Parameter for more information.

The content of this parameter is only valid when the operation parameter is X'B001', X'B101', X'B301', X'B311', or X'BF01'.

Communications handle
INPUT; CHAR(10)

The name of the link on which to receive the data.


Format of Diagnostic Data Parameter

The format of the diagnostic data parameter is shown below. The contents of the fields within this parameter are only valid on X'B001', X'B101', X'B301', X'B311', and X'BF01' operations for the indicated return and reason codes.



LAN Input Operations

The only type of data that an application program can receive from the QOLRECV API on links using a token-ring, Ethernet, wireless, or FDDI communications line is user data (operation X'0001'). User-defined communications support returns the following information for each data frame received from the QOLRECV API:

For example, suppose two data frames came in from the network and the user-defined communications application program was notified of this by an incoming-data entry on the data queue or user queue. On return from the QOLRECV API, the information for the first frame would be in the first data unit of the input buffer and described in the first element of the input buffer descriptor. The information for the second frame would be in the second data unit of the input buffer and described in the second element of the input buffer descriptor. The number of data units parameter would be set to 2.

Data Unit Format-LAN Operation X'0001'

Each data frame received from the QOLRECV API corresponds to a data unit in the input buffer. The information in each of these data units is made up of a general LAN header, routing information (for token-ring links only), followed by user data.

The general LAN header is used to pass information about the frame to the communications support. The fields in the general LAN header are used for all LAN link types, although some of them are link specific. For example, routing information is only for token-ring links, and the length of routing information is X'00' to X'18'. For non-token-ring links, the length of the routing information is always X'00'. Also, DSAP and SSAP are defined for protocols that use the 802.2 logical link control interface and do not apply to Ethernet Version 2. A DSAP and SSAP of X'00' tells the communications support that the data frame is an Ethernet Version 2 frame.

Format of the General LAN Information

Token-ring routing information follows the general LAN header. The length of this field is specified by the length of token-ring routing information field found in the general LAN header. If the length of the routing information is nonzero, the user data follows the routing information header.

The following table shows the fields and offsets used for Ethernet 802.3, wireless, and token-ring frames without routing information.

The length of the user data is described in the length of user data field in the general LAN header. For Ethernet Version 2 frames, the first 2 bytes of user data are used for the frame type. The type field is a 2-byte field that specifies the upper layer protocol of the frame.

The adapter address, DSAP, SSAP, and frame type fields are all used to define inbound routing information used by the QOLSETF API. Refer to Set Filter (QOLSETF) API for information on the QOLSETF API and how inbound routing information is used to route inbound data to the application program.

Note: Inbound routing information is not related to the token-ring routing information described in the general LAN header.

The following table shows the fields and offsets used for token-ring frames with routing information.

The following table shows the fields and offsets used for Ethernet Version 2 frames.

Note: For Ethernet Version 2, the frame type field is the first 2 bytes of user data, following the general LAN information, with user data starting at offset 18.

Input Buffer Descriptor Element Format-LAN Operation X'0001'

The information returned in each data unit of the input buffer will be described in the corresponding element of the input buffer descriptor. The following table shows the format of each element in the input buffer descriptor.



X.25 SVC and PVC Input Operations

The following table shows the types of data that can be received from the QOLRECV API on links using an X.25 communications line.

X.25 Operation X'0001'

This operation indicates that user data was received on an X.25 SVC or PVC connection. User-defined communications support will return the following information:

For example, suppose two data units of user data came in from the network and the application program was notified of this by an incoming-data entry on the data queue or user queue. On return from the QOLRECV API, the first portion of the user data would be in the first data unit of the input buffer and described in the first element of the input buffer descriptor. The second portion of the user data would be in the second data unit of the input buffer and described in the second element of the input buffer descriptor. The number of data units parameter would be set to 2.

User-defined communications support will automatically reassemble the X.25 data packet(s) from a complete packet sequence into the next data unit of the input buffer. If the amount of user data in a complete packet sequence is more than what can fit into a data unit, the more data indicator field in the corresponding element of the input buffer descriptor will be set to X'01' and the next data unit will be used for the remaining user data, and so on.

Data Unit Format-X.25 Operation X'0001'

Each data unit in the input buffer consists solely of user data and starts offset 0 from the top of the data unit.

Input Buffer Descriptor Element Format-X.25 Operation X'0001'

The user data returned in each data unit of the input buffer will be described in the corresponding element of the input buffer descriptor.

X.25 Operation X'B001'

This operation indicates that a X'B000' output operation has completed. User-defined communications support will return the data for this operation (if any) in the first data unit of the input buffer. The input buffer descriptor is not used.

Data will be returned in the input buffer for the following return and reason codes:

The format of the data returned in the input buffer for the X'B001' operation depends on whether the X'B000' output operation was used to initiate an SVC call or to open a PVC connection. Each format will be explained below.

Note: The formats below only apply to 0/0 and 83/4002 return and reason codes. When the X'B001' operation is received with a 83/1999 return and reason code, the data returned starts at offset 0 from the top of the first data unit in the input buffer and contains the data specified in the output buffer on the X'B000' output operation. See Send Data (QOLSEND) API for more information.

Data Unit Format-X.25 Operation X'B001' (Completion of SVC Call)

The data returned starts at offset 0 from the top of the first data unit in the input buffer.

Data Unit Format-X.25 Operation X'B001' (Completion of Open PVC)

The data returned starts at offset 0 from the top of the first data unit in the input buffer.

X.25 Operation X'B101'

This operation indicates that a X'B100' output operation has completed. User-defined communications support will return the data for this operation (if any) in the first data unit of the input buffer. The input buffer descriptor is not used.

Data will be returned in the input buffer for the following return and reason codes:

Note: The format below only applies for a 0/0 return and reason code. When the X'B101' operation is received with an 83/1999 return and reason code, the data returned starts at offset 0 from the top of the first data unit in the input buffer and contains the data specified in the output buffer on the X'B100' output operation. See Send Data (QOLSEND) API for more information.

Data Unit Format-X.25 Operation X'B101'

The data returned starts at offset 0 from the top of the first data unit in the input buffer.

X.25 Operation X'B111'

This operation indicates a X'B110' output operation has completed. All connections have been closed and the clean up of connection control information is complete. All UCEPs and PCEPs are freed. There is no data associated with this operation.

X.25 Operation X'B201'

This operation indicates that an incoming X.25 SVC call was received. User-defined communications support returns the data for this operation in the first data unit of the input buffer. The input buffer descriptor is not used.

Note: It is the responsibility of the application program to either accept or reject the incoming call. This is done by calling the QOLSEND API with operation X'B400' or X'B100', respectively.

Data Unit Format-X.25 Operation X'B201'

The data returned starts at offset 0 from the top of the first data unit in the input buffer.

X.25 Operation X'B301'

This operation indicates that a failure has occurred, or a reset indication has been received, on an X.25 SVC or PVC connection. User-defined communications support will return data for this operation in the first data unit of the input buffer only on a 83/4002 return and reason code when the number of data units parameter is set to one. The input buffer descriptor is not used.

Note: The diagnostic data parameter will contain the X.25 cause and diagnostic codes when a reset indication is received.

Data Unit Format-X.25 Operation X'B301'

The data returned starts at offset 0 from the top of the first data unit in the input buffer.

X.25 Operation X'B311'

This operation indicates that an error has occurred that has caused the system to close all connections on the link. The error may be a system error or a network error. The error information is returned in the diagnostic data and no additional data is provided.

Note: This operation is only received when the extended operation parameter on the QOLELINK API is set to operation supported. If the extended operations are not supported and an error occurs that will close all connections, X'B301' is received for each connection.

X.25 Operation X'BF01'

This operation indicates that a X'BF00' output operation has been completed. Neither the input buffer nor the input buffer descriptor is used for this operation.

Note: When the X'BF01' operation is received with a 0/0 return and reason code, the diagnostic data parameter will contain information indicating if a reset request or reset confirmation packet was sent.


Return and Reason Codes

The return and reason codes that can be returned from the QOLRECV API depend on the type of communications line the link is using and on the type of data (operation) that was received.

LAN Return and Reason Codes

The following table shows the return and reason codes that indicate data could not be received from the QOLRECV API.

Note: When these return and reason codes are returned, all output parameters except the return and reason codes will contain hexadecimal zeros.

Return and Reason Codes for LAN Operation X'0001'

X.25 Return and Reason Codes

The following table shows the return and reason codes that indicate data could not be received from the QOLRECV API.

Note: When these return and reason codes are returned, all output parameters except the return and reason codes will contain hexadecimal zeros.

Return and Reason Codes for X.25 Operation X'0001'

Return and Reason Codes for X.25 Operation X'B001'

Return and Reason Codes for X.25 Operation X'B101'

Return and Reason Codes for X.25 Operation X'B111'

Return and Reason Codes for X.25 Operation X'B201'

Return and Reason Codes for X.25 Operation X'B301'

Return and Reason Codes for X.25 Operation X'B311'

Return and Reason Codes for X.25 Operation X'BF01'



Error Messages



API introduced: V2R1

[ Back to top | Communications APIs | APIs by category ]