HP-UX SNAplus2 R7 LUA Programmer's Guide

Designing and Writing LUA Applications
SNA Information
On the SLI_OPEN verb, the application can optionally specify the address of its own routine to process BIND
requests from the host. If it has done so, LUA sends an additional verb SLI_BIND_ROUTINE to the application-
supplied routine to allow it to process the request, as follows. It is the responsibility of the LUA application to
check that the parameters specied on the BIND are suitable. The application has the following options:
Accept the BIND as it is, by returning the SLI_BIND_ROUTINE verb with a primary return code of
OK. The
application does not modify the data buffer containing the BIND.
Try to negotiate one or more BIND parameters (this is only permitted if the BIND is negotiable). To do this, the
application returns the SLI_BIND_ROUTINE verb with a primary return code of
OK, but including the modied
BIND in the data buffer.
Reject the BIND by returning the SLI_BIND_ROUTINE verb with a primary return code of
LUA_NEGATIVE_RESPONSE, and replacing the BIND request in the data buffer with an appropriate SNA sense
code.
The validation of the BIND parameters, and ensuring that all messages sent are consistent with them, is the
responsibility of the LUA application. However, SNAplus2 requires the BIND to specify that the secondary LU is
the contention winner, and that error recovery is the responsibility of the contention loser.
2.4.3 Negative Responses and SNA Sense Codes
SNA sense codes may be returned to an LUA application in the following cases:
When the host sends a negative response to a request from the LUA application, this includes an SNA sense code
indicating the reason for the negative response. This is reported to the application on a subsequent RUI_READ
or SLI_RECEIVE verb, as follows:
The primary return code is
LUA_OK.
The Request/Response Indicator, Response Type Indicator, and Sense Data Included Indicator are all set to
1, indicating a negative response that includes sense data.
The data returned by the RUI_READ or SLI_RECEIVE verb is the SNA sense code.
When SNAplus2 receives data that is not valid from the host, it generally sends a negative response to the host
and does not pass the data that is not valid to the LUA application. This is reported to the application on a
subsequent RUI_READ or RUI_BID verb, or SLI_RECEIVE / SLI_BID, as follows:
The primary return code is
LUA_NEGATIVE_RSP.
The secondary return code is the SNA sense code sent to the host.
In some cases, SNAplus2 detects that data supplied by the host is not valid, but cannot determine the correct
sense code to send. In this case, it passes the data that is not valid in an Exception Request (EXR) to the LUA
application on an RUI_READ or SLI_RECEIVE verb as follows:
The Request/Response Indicator is set to 0 (zero), indicating a request.
The Sense Data Included Indicator is set to 1, indicating that sense data is included (this indicator is normally
used only for a request).
The message data is replaced by a suggested SNA sense code.
The application must then send a negative response to the message; it may use the sense code suggested by
SNAplus2, or may alter it.
SNAplus2 may send a sense code to the application to indicate that data supplied by the application was not
valid. This is reported to the application on the RUI_WRITE or SLI_SEND verb that supplied the data, as
follows:
The primary return code is
LUA_UNSUCCESSFUL.
The secondary return code is the SNA sense code.
45