Previous Page Contents Page Next Page

3 LUA Verbs

This chapter contains the following information:

The following information is provided for each LUA verb:

Symbolic constants are defined in the header files /usr/include/sna/lua_c.h and /usr/include/sna/values_c.h (Solaris operating system) or sdk/winlua.h (Windows operating system)for many parameter values. For portability, use the symbolic constant and not the numeric value when setting values for supplied parameters, or when testing values of returned parameters. The file values_c.h also includes definitions of parameter types such as AP_UINT16 that are used in the LUA VCBs.

Parameters marked as reserved should always be set to 0 (zero).

3.1 LUA Verb Control Block (VCB) Format

The verb control block consists of two parts:

The definition of some parts of the VCB structure, in particular the ordering of bit fields, varies between different operating systems. For clarity, only one version of the ordering is shown here, although both versions are defined in the header file. When setting or testing values in bit fields, the application should access individual bits by name, to avoid dependencies on the bit ordering, rather than using bitwise AND or OR operations on complete bytes.

To allow for these differences, the LUA header file contains the following information:

Note

The LUA VCB contains many parameters marked as reserved; some of these are used internally by the SNAP-IX software, and others are not used in this version but may be used in future versions. Your application must not attempt to access any of these reserved parameters; instead, it must set the entire contents of the VCB to zero to ensure that all of these parameters are zero, before it sets other parameters that are used by the verb. This ensures that SNAP-IX will not misinterpret any of its internally-used parameters, and also that your application will continue to work with future SNAP-IX versions in which these parameters may be used to provide new functions.

To set the VCB contents to zero, use memset:

memset(vcb, 0, sizeof(vcb));

3.1.1 LUA_VERB_RECORD Data Structure

typedef struct
{
  struct LUA_COMMON common;
  struct LUA_SPECIFIC specific;
} LUA_VERB_RECORD;

3.1.2 Common Data Structure

struct LUA_COMMON  
{
  AP_UINT16       lua_verb;                   /* Verb Code                   */
  AP_UINT16       lua_verb_length;            /* Length of Verb Record       */
  AP_UINT16       lua_prim_rc;                /* Primary Return Code         */
  AP_UINT32       lua_sec_rc;                 /* Secondary Return Code       */
  AP_UINT16       lua_opcode;                 /* Verb Operation Code         */
  AP_UINT32       lua_correlator;             /* User Correlation Field      */
  unsigned char   lua_luname[8];              /* Local LU Name               */
  AP_UINT16       lua_extension_list_offset;  /* Offset of DLL Extention List*/
  AP_UINT16       lua_cobol_offset;           /* Offset of Cobol Extension   */
  AP_UINT32       lua_sid;                    /* Session ID                  */
  AP_UINT16       lua_max_length;             /* Receive Buffer Length       */
  AP_UINT16       lua_data_length;            /* Data Length                 */
  char *          lua_data_ptr;               /* Data Buffer Pointer         */
  unsigned long   lua_post_handle;            /* Posting handle              */

  struct LUA_TH {                            /* LUA TH Fields                */
    BIT_FIELD_TYPE   flags_fid  : 4;         /* Format Identification Type 2 */
    BIT_FIELD_TYPE   flags_mpf  : 2;         /* Segmenting Mapping Field     */
    BIT_FIELD_TYPE   flags_odai : 1;         /* OAF-DAF Assignor Indicator   */
    BIT_FIELD_TYPE   flags_efi  : 1;         /* Expedited Flow Indicator     */
    BIT_FIELD_TYPE              : 8;         /* Reserved Field               */
    unsigned char    daf;                    /* Destination Address Field    */
    unsigned char    oaf;                    /* Originating Address Field    */
    unsigned char    snf[2];                 /* Sequence Number Field        */
    } lua_th;

  struct LUA_RH {                            /* LUA RH Fields                */
    BIT_FIELD_TYPE   rri  : 1;               /* Request-Response Indicator   */
    BIT_FIELD_TYPE   ruc  : 2;               /* RU Category                  */
    BIT_FIELD_TYPE        : 1;               /* Reserved Field               */
    BIT_FIELD_TYPE   fi   : 1;               /* Format Indicator             */
    BIT_FIELD_TYPE   sdi  : 1;               /* Sense Data Included Ind      */
    BIT_FIELD_TYPE   bci  : 1;               /* Begin Chain Indicator        */
    BIT_FIELD_TYPE   eci  : 1;               /* End Chain Indicator          */

    BIT_FIELD_TYPE   dr1i : 1;               /* DR 1 Indicator               */
    BIT_FIELD_TYPE        : 1;               /* Reserved Field               */
    BIT_FIELD_TYPE   dr2i : 1;               /* DR 2 Indicator               */
    BIT_FIELD_TYPE   ri   : 1;               /* Response Indicator           */
    BIT_FIELD_TYPE        : 2;               /* Reserved Field               */
    BIT_FIELD_TYPE   qri  : 1;               /* Queued Response Indicator    */
    BIT_FIELD_TYPE   pi   : 1;               /* Pacing Indicator             */

    BIT_FIELD_TYPE   bbi  : 1;               /* Begin Bracket Indicator      */
    BIT_FIELD_TYPE   ebi  : 1;               /* End Bracket Indicator        */
    BIT_FIELD_TYPE   cdi  : 1;               /* Change Direction Indicator   */
    BIT_FIELD_TYPE        : 1;               /* Reserved Field               */
    BIT_FIELD_TYPE   csi  : 1;               /* Code Selection Indicator     */
    BIT_FIELD_TYPE   edi  : 1;               /* Enciphered Data Indicator    */
    BIT_FIELD_TYPE   pdi  : 1;               /* Padded Data Indicator        */
    BIT_FIELD_TYPE        : 1;               /* Reserved Field               */
    } lua_rh;

  struct LUA_FLAG1 {                         /* LUA_FLAG1                    */
    BIT_FIELD_TYPE   bid_enable  : 1;        /* Bid Enabled Indicator        */
    BIT_FIELD_TYPE   reserv1     : 1;        /* reserved                     */
    BIT_FIELD_TYPE   close_abend : 1;        /* Close Immediate Flag         */
    BIT_FIELD_TYPE   nowait      : 1;        /* Don't Wait for Data Flag     */
    BIT_FIELD_TYPE   sscp_exp    : 1;        /* SSCP expedited flow          */
    BIT_FIELD_TYPE   sscp_norm   : 1;        /* SSCP normal flow             */
    BIT_FIELD_TYPE   lu_exp      : 1;        /* LU expedited flow            */
    BIT_FIELD_TYPE   lu_norm     : 1;        /* lu normal flow               */
    } lua_flag1;

  unsigned char      lua_message_type;       /* sna message command type     */

  struct LUA_FLAG2 {                         /* LUA_FLAG2                    */
    BIT_FIELD_TYPE   bid_enable  : 1;        /* Bid Enabled Indicator        */
    BIT_FIELD_TYPE   async       : 1;        /* flags asynchronous verb      */
                                                 completion                  */
    BIT_FIELD_TYPE               : 2;        /* reserved                     */
    BIT_FIELD_TYPE   sscp_exp    : 1;        /* SSCP expedited flow          */
    BIT_FIELD_TYPE   sscp_norm   : 1;        /* SSCP normal flow             */
    BIT_FIELD_TYPE   lu_exp      : 1;        /* LU expedited flow            */
    BIT_FIELD_TYPE   lu_norm     : 1;        /* lu normal flow               */
    } lua_flag2;

  unsigned char      lua_resv56[7];          /* Reserved Field               */
  unsigned char      lua_encr_decr_option;   /* Cryptography Option          */
} ;

struct LUA_COMMON  
{
  unsigned short  lua_verb;                   /* Verb Code                   */
  unsigned short  lua_verb_length;            /* Length of Verb Record       */
  unsigned short  lua_prim_rc;                /* Primary Return Code         */
  unsigned long   lua_sec_rc;                 /* Secondary Return Code       */
  unsigned short  lua_opcode;                 /* Verb Operation Code         */
  unsigned long   lua_correlator;             /* User Correlation Field      */
  unsigned char   lua_luname[8];              /* Local LU Name               */
  unsigned short  lua_extension_list_offset;  /* Offset of DLL Extention List*/
  unsigned short  lua_cobol_offset;           /* Offset of Cobol Extension   */
  unsigned long   lua_sid;                    /* Session ID                  */
  unsigned short  lua_max_length;             /* Receive Buffer Length       */
  unsigned short  lua_data_length;            /* Data Length                 */
  char far        *lua_data_ptr;              /* Data Buffer Pointer         */
  unsigned long   lua_post_handle;            /* Posting handle              */

  struct LUA_TH {                            /* LUA TH Fields                */
    unsigned char    flags_fid  : 4;         /* Format Identification Type 2 */
    unsigned char    flags_mpf  : 2;         /* Segmenting Mapping Field     */
    unsigned char    flags_odai : 1;         /* OAF-DAF Assignor Indicator   */
    unsigned char    flags_efi  : 1;         /* Expedited Flow Indicator     */
    unsigned char               : 8;         /* Reserved Field               */
    unsigned char    daf;                    /* Destination Address Field    */
    unsigned char    oaf;                    /* Originating Address Field    */
    unsigned char    snf[2];                 /* Sequence Number Field        */
    } lua_th;

  struct LUA_RH {                            /* LUA RH Fields                */
    unsigned char    rri  : 1;               /* Request-Response Indicator   */
    unsigned char    ruc  : 2;               /* RU Category                  */
    unsigned char         : 1;               /* Reserved Field               */
    unsigned char    fi   : 1;               /* Format Indicator             */
    unsigned char    sdi  : 1;               /* Sense Data Included Ind      */
    unsigned char    bci  : 1;               /* Begin Chain Indicator        */
    unsigned char    eci  : 1;               /* End Chain Indicator          */

    unsigned char    dr1i : 1;               /* DR 1 Indicator               */
    unsigned char         : 1;               /* Reserved Field               */
    unsigned char    dr2i : 1;               /* DR 2 Indicator               */
    unsigned char    ri   : 1;               /* Response Indicator           */
    unsigned char         : 2;               /* Reserved Field               */
    unsigned char    qri  : 1;               /* Queued Response Indicator    */
    unsigned char    pi   : 1;               /* Pacing Indicator             */

    unsigned char    bbi  : 1;               /* Begin Bracket Indicator      */
    unsigned char    ebi  : 1;               /* End Bracket Indicator        */
    unsigned char    cdi  : 1;               /* Change Direction Indicator   */
    unsigned char         : 1;               /* Reserved Field               */
    unsigned char    csi  : 1;               /* Code Selection Indicator     */
    unsigned char    edi  : 1;               /* Enciphered Data Indicator    */
    unsigned char    pdi  : 1;               /* Padded Data Indicator        */
    unsigned char         : 1;               /* Reserved Field               */
    } lua_rh;

  struct LUA_FLAG1 {                         /* LUA_FLAG1                    */
    unsigned char    bid_enable  : 1;        /* Bid Enabled Indicator        */
    unsigned char    reserv1     : 1;        /* reserved                     */
    unsigned char    close_abend : 1;        /* Close Immediate Flag         */
    unsigned char    nowait      : 1;        /* Don't Wait for Data Flag     */
    unsigned char    sscp_exp    : 1;        /* SSCP expedited flow          */
    unsigned char    sscp_norm   : 1;        /* SSCP normal flow             */
    unsigned char    lu_exp      : 1;        /* LU expedited flow            */
    unsigned char    lu_norm     : 1;        /* lu normal flow               */
    } lua_flag1;

  unsigned char      lua_message_type;       /* sna message command type     */

  struct LUA_FLAG2 {                         /* LUA_FLAG2                    */
    unsigned char    bid_enable  : 1;        /* Bid Enabled Indicator        */
    unsigned char    async       : 1;        /* flags asynchronous verb      */
                                                 completion                  */
    unsigned char                : 2;        /* reserved                     */
    unsigned char    sscp_exp    : 1;        /* SSCP expedited flow          */
    unsigned char    sscp_norm   : 1;        /* SSCP normal flow             */
    unsigned char    lu_exp      : 1;        /* LU expedited flow            */
    unsigned char    lu_norm     : 1;        /* lu normal flow               */
    } lua_flag2;

  unsigned char      lua_resv56[7];          /* Reserved Field               */
  unsigned char      lua_encr_decr_option;   /* Cryptography Option          */
} ;

The following list explains the fields in these data structures.

lua_verb

Identifies this as an LUA verb: always set to LUA_VERB_RUI.

lua_verb_length

Length of the verb control block (VCB).

lua_prim_rc

Primary return code set by LUA.

lua_sec_rc

Secondary return code set by LUA.

lua_opcode

Verb operation code that identifies the LUA verb being issued.

lua_correlator

A four-byte correlator that you can use to correlate this verb with other processing in your application. LUA does not use this parameter.

lua_luname

The LU name used by the LUA session (in ASCII). This can be an LU name or an LU pool name; for more information, see RUI_INIT.

lua_extension_list_offset

This field is reserved.

lua_cobol_offset

This field is reserved.

lua_sid

The session ID of the LUA session on which this verb is issued.

lua_max_length

The length of the buffer supplied to RUI_READ to receive data, or the total length of a waiting RU returned to RUI_BID.

lua_data_length

The length of the data to be sent, or the actual length of data received.

lua_data_ptr

A pointer to the data to be sent, or the data buffer to receive data.

lua_post_handle

A pointer to a callback routine that LUA will call to indicate completion if the verb completes asynchronously.

If the VCB is used in a RUI function call, set this field to an event handle. If the VCB is used in a WinRUI function call, this field is reserved.

lua_th

A data structure containing the TH (transmission header) of the message sent or received, as follows:

lua_th.flags_fid

Format Identification type 2: 4 bits

lua_th.flags_mpf

Segmenting mapping field: 2 bits

lua_th.flags_odai

Origin Address Field-Destination Address Field (OAF-DAF) Assignor Indicator

lua_th.flags_efi

Expedited Flow Indicator

lua_th.daf

DAF (Destination address field)

lua_th.oaf

OAF (Originating address field)

lua_th.snf

Sequence Number Field

lua_rh

A data structure containing the RH (request/response header) of the message sent or received, as follows:

lua_rh.rri

Request-Response Indicator

lua_rh.ruc

RU category: 2 bits

lua_rh.fi

Format Indicator

lua_rh.sdi

Sense Data Included Indicator

lua_rh.bci

Begin Chain Indicator

lua_rh.eci

End Chain Indicator

lua_rh.dr1i

Definite Response 1 Indicator

lua_rh.dr2i

Definite Response 2 Indicator

lua_rh.ri

Exception Response Indicator (for a request), or Response Type Indicator (for a response)

lua_rh.qri

Queued Response Indicator

lua_rh.pi

Pacing Indicator

lua_rh.bbi

Begin Bracket Indicator

lua_rh.ebi

End Bracket Indicator

lua_rh.cdi

Change Direction Indicator

lua_rh.csi

Code Selection Indicator

lua_rh.edi

Enciphered Data Indicator

lua_rh.pdi

Padded Data Indicator

lua_flag1

A data structure containing flags for messages supplied by the application, as follows:

lua_flag1.bid_enable

Bid Enable Indicator

lua_flag1.close_abend

Close Immediate Indicator

lua_flag1.nowait

No Wait For Data flag

lua_flag1.sscp_exp

SSCP expedited flow

lua_flag1.sscp_norm

SSCP normal flow

lua_flag1.lu_exp

LU expedited flow

lua_flag1.lu_norm

LU normal flow

lua_message_type

The type of SNA message received by an RUI_READ verb (or indicated to an RUI_BID verb)

lua_flag2

A data structure containing flags for messages returned by LUA, as follows:

lua_flag2.bid_enable

Bid Enabled Indicator

lua_flag2.async

Asynchronous verb completion flag

lua_flag2.sscp_exp

SSCP expedited flow

lua_flag2.sscp_norm

SSCP normal flow

lua_flag2.lu_exp

LU expedited flow

lua_flag2.lu_norm

LU normal flow

lua_encr_decr_option

Cryptography option

3.1.3 Specific Data Structure

The following data structure is included for the RUI_BID verb, and for the extended form of the RUI_INIT verb:

union LUA_SPECIFIC
{
struct SLI_OPEN  open;
unsigned char    lua_sequence_number[2];
unsigned char    lua_peek_data[12];
struct RUI_INIT  init;
} ;
struct RUI_INIT
{
unsigned char    rui_init_format;
unsigned char    lua_puname[8];
unsigned char    lua_lunumber;
};

The SLI_OPEN structure is defined in the LUA header file. This structure, and the lua_sequence_number parameter, are included in the definition of the LUA_SPECIFIC union for compatibility with other LUA implementations, but are not used by SNAP-IX LUA.

For RUI_BID, this data structure contains the following field:

lua_peek_data

Up to 12 bytes of the data waiting to be read.

For the extended form of the RUI_INIT verb, this data structure contains the following fields. For more information about the extended form of RUI_INIT, see RUI_INIT.

rui_init_format

Reserved-this parameter must be set to 0 (zero).

lua_puname

The name of the local PU that owns the LU to be used for this session. The PU name must be specified in the definition of an LS or of an internal PU in the SNAP-IX configuration.

lua_lunumber

The LU number of the LU to be used for this session. This must match the LU number of a type 0-3 LU that is configured for the PU name specified by lua_puname.

The extended form of the RUI_INIT verb does not apply to Windows. The RUI_INIT data structure is not used.

Previous Page Contents Page Top of Page Next page