(* $Workfile:   wire.tpl  $ $Revision:   2.8  $ *)
(* WIRE.TPL *)
(*****************************************************************************)
(* ASN.1 WIRE PROTOCOL DATA-TYPE TEMPLATE                                    *)
(*                                                                           *)
(* - Defines:                                                                *)
(*    - WIRE PROTOCOL                                                        *)
(*                                                                           *)
(*****************************************************************************)
APDU                       LABEL     = Wapdu
                           STRUCTURE = CHOICE
                           CHILDREN  = { <Wxaiv, C  1 C,O,0>,
                                         <Wxars, C  2 C,O,0>,
                                         <Wxaer, C  3 C,O,0>  }

XAIV apdu                  LABEL     = Wxaiv
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Woper, U  2 P,M,0>*,
                                         <Wargs, C  1 C,M,0>  }

XARS apdu                  LABEL     = Wxars
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wrslt, U  2 P,M,0>*,
                                         <Wrarg, U  0 P,O,0>  }

XAER apdu                  LABEL     = Wxaer
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Werrv, U  2 P,M,0>*,
                                         <Wearg, U  0 P,O,0>  }

Arguments                  LABEL     = Wargs
                           STRUCTURE = ANY DEFINED BY
                           TAG       = (C  1 C)
                           DEFGLABEL = Woper
                           REGISTER  = { <01,Wocpy, U 16 C,0>,
                                         <02,Wocvl, U 16 C,0>,
                                         <03,Wocrt, U 16 C,0>,
                                         <04,Wnull, U  5 P,0>,
                                         <05,Wodel, U 16 C,0>,
                                         <06,Wnull, U  5 P,0>,
                                         <07,Woget, U 16 C,0>,
                                         <08,Woins, U 16 C,0>,
                                         <09,Woput, U 16 C,0>,
                                         <0A,Worea, U 16 C,0>,
                                         <0B,Worem, U 16 C,0>,
                                         <0C,Wowri, U 16 C,0>,
                                         <16,Cnull, U  5 P,0>,
                                         <17,Wtfti, U 16 C,0>,
                                         <18,Wtopn, U 16 C,0>,
                                         <19,Cnull, U  5 P,0>,
                                         <1A,Cnull, U  5 P,0>,
                                         <1B,Wttro, U 16 C,0>,
                                         <1C,Wtwai, U 16 C,0>,
                                         <2A,Wmcsb, U 16 C,0>,
                                         <2B,Cnull, U  5 P,0>,
                                         <2C,Wmfdy, U 16 C,0>,
                                         <2D,Wmfrv, U 16 C,0>,
                                         <2E,Wmopn, U 16 C,0>,
                                         <2F,Cnull, U  5 P,0>,
                                         <30,Cnull, U  5 P,0>,
                                         <31,Wmsrv, U 16 C,0>,
                                         <32,Wmsub, U 16 C,0>,
                                         <33,Wmwai, U 16 C,0> }

Results                    LABEL     = Wrarg
                           STRUCTURE = ANY DEFINED BY
                           DEFGLABEL = Wrslt
                           REGISTER  = { <01,Worcp, U 16 C,0>,
                                         <02,Cnull, U  5 P,0>,
                                         <03,Worcr, U 16 C,0>,
                                         <04,Cnull, U  5 P,0>,
                                         <05,Cnull, U  5 P,0>,
                                         <06,Cnull, U  5 P,0>,
                                         <07,Worgt, U 16 C,0>,
                                         <08,Worin, U 16 C,0>,
                                         <09,Cnull, U  5 P,0>,
                                         <0A,Worrd, U 16 C,0>,
                                         <0B,Cnull, U  5 C,0>,
                                         <0C,Worwr, U 16 C,0>,
                                         <16,Cnull, U  5 P,0>,
                                         <17,Cnull, U  5 P,0>,
                                         <18,Wtrop, U 16 C,0>,
                                         <19,Wtrsz, U 16 C,0>,
                                         <1A,Wtrst, U 16 C,0>,
                                         <1B,Cnull, U  5 P,0>,
                                         <1C,Wtrwt, U 16 C,0>,
                                         <2A,Cnull, U  5 P,0>,
                                         <2B,Cnull, U  5 P,0>,
                                         <2C,Cnull, U  5 P,0>,
                                         <2D,Cnull, U  5 P,0>,
                                         <2E,Wmrop, U 16 C,0>,
                                         <2F,Wmrsz, U 16 C,0>,
                                         <30,Wmrsd, U 16 C,0>,
                                         <31,Wmrsr, U 16 C,0>,
                                         <32,Wmrsb, U 16 C,0>,
                                         <33,Wmrwt, U 16 C,0> }

(* Errors - error code 3C is stub error *)

Errors                     LABEL     = Wearg
                           STRUCTURE = ANY DEFINED BY
                           DEFGLABEL = Werrv
                           REGISTER  = { <01,Wretc, U  2 P,0>,
                                         <02,Wretc, U  2 P,0>,
                                         <03,Wretc, U  2 P,0>,
                                         <04,Wretc, U  2 P,0>,
                                         <05,Wretc, U  2 P,0>,
                                         <06,Wretc, U  2 P,0>,
                                         <07,Wretc, U  2 P,0>,
                                         <08,Wretc, U  2 P,0>,
                                         <09,Wretc, U  2 P,0>,
                                         <0A,Wretc, U  2 P,0>,
                                         <0B,Wretc, U  2 P,0>,
                                         <0C,Wretc, U  2 P,0>,
                                         <16,Wretc, U  2 P,0>,
                                         <17,Wretc, U  2 P,0>,
                                         <18,Wretc, U  2 P,0>,
                                         <19,Wretc, U  2 P,0>,
                                         <1A,Wretc, U  2 P,0>,
                                         <1B,Wretc, U  2 P,0>,
                                         <1C,Wretc, U  2 P,0>,
                                         <2A,Wretc, U  2 P,0>,
                                         <2B,Wretc, U  2 P,0>,
                                         <2C,Wretc, U  2 P,0>,
                                         <2D,Wretc, U  2 P,0>,
                                         <2E,Wretc, U  2 P,0>,
                                         <2F,Wretc, U  2 P,0>,
                                         <30,Wretc, U  2 P,0>,
                                         <31,Wretc, U  2 P,0>,
                                         <32,Wretc, U  2 P,0>,
                                         <33,Wretc, U  2 P,0>,
                                         <3C,Wretc, U  2 P,0>  }

(*****************************************************************************)
(* ARGUMENTS - MT CLOSE, MT SIZE, AND MT START TRANSFER IN USE NULL          *)
(* Note that put and copy value arguments are in different order to in the   *)
(* XAPIA interface.                                                          *)
(*****************************************************************************)

OM COPY                    LABEL     = Wocpy
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 P,M,0> }

OM COPY VALUE              LABEL     = Wocvl
                           STRUCTURE = SEQUENCE
                           CHILDREN  =  {<Wdshl, C 18 P,M,0>,
                                         <Wdsty, C 19 P,M,0>,
                                         <Wdsvp, C  9 P,M,0>,
                                         <Wobhl, C  1 P,M,0>,
                                         <Watty, C 12 P,M,0>,
                                         <Wvpos, C 13 P,M,0> }

OM CREATE                  LABEL     = Wocrt
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobid, C 11 P,M,0> }

OM DELETE                  LABEL     = Wodel
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 P,M,0> }

OM GET                     LABEL     = Woget
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 P,M,0>,
                                         <Wexcl, C  6 P,M,0>,
                                         <Wtypl, C  7 C,O,0>,
                                         <Winvl, C  8 P,O,0>,
                                         <Wfnvl, C  9 P,O,0> }

OM INSTANCE                LABEL     = Woins
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobid, C  3 P,M,0>,
                                         <Wobjt, U  0 P,M,0> }

OM PUT                     LABEL     = Woput
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wdshl, C 18 P,M,0>,
                                         <Wmodi, C 10 P,M,0>,
                                         <Wtypl, C  7 C,O,0>,
                                         <Winvl, C  8 P,O,0>,
                                         <Wfnvl, C  9 P,O,0>,
                                         <Wpdsc, C 11 C,M,0> }

OM READ                    LABEL     = Worea
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 P,O,0>,
                                         <Wsref, C 28 P,O,0>,
                                         <Watty, C 12 P,M,0>,
                                         <Wvpos, C 13 P,M,0>,
                                         <Wfeps, C 14 P,M,0>,
                                         <Wmxnm, C 15 P,M,0> }

OM REMOVE                  LABEL     = Worem
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 P,M,0>,
                                         <Watty, C 12 P,M,0>,
                                         <Winvl, C 13 P,M,0>,
                                         <Wfnvl, C 15 P,M,0> }

OM WRITE                   LABEL     = Wowri
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 O,O,0>,
                                         <Wdref, C 29 P,O,0>,
                                         <Watty, C 12 P,M,0>,
                                         <Wvpos, C 13 P,M,0>,
                                         <Watsy, C 27 P,M,0>,
                                         <Wfeps, C 14 P,M,0>,
                                         <Welts, C 16 P,O,0>,
                                         <Wsref, C 28 P,O,0>,
                                         <Werfl, C 23 C,O,0> }

MT FINISH XFER IN          LABEL     = Wtfti
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 P,O,0>,
                                         <Wremv, C 18 P,M,0> }

MT OPEN                    LABEL     = Wtopn
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wclnm, C 30 P,M,0>,
                                         <Wcinm, C 19 P,M,0>,
                                         <Wfeas, U 16 C,0,0>,
                                         <Wwksp, U  2 P,O,0> }

MT TRANSFER OUT            LABEL     = Wttro
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobjt, U 0 P,M,0> }

MT WAIT                    LABEL     = Wtwai
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wwait, C 25 P,M,0> }

MA FINISH DELIVERY         LABEL     = Wmfdy
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobjd, C  1 C,O,0>,
                                         <Wobjn, C  2 C,O,0> }

MA FINISH RETRIEVAL        LABEL     = Wmfrv
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wremv, C 18 P,M,0> }

MA OPEN                    LABEL     = Wmopn
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wclnm, C 30 P,M,0>,
                                         <Wfeas, U 16 C,O,0>,
                                         <Wwksp, U  2 P,O,0> }

MA SUBMIT                  LABEL     = Wmsub
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobjt, U 0 P,M,0> }

MA START RETRIEVAL         LABEL     = Wmsrv
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wseqn, C 17 P,M,0> }

MA WAIT                    LABEL     = Wmwai
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wwait, C 25 P,M,0>,
                                         <Wseqn, C 17 P,M,0> }

MA CANCEL SUBMISSION       LABEL     = Wmcsb
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobjt, U 0 P,M,0> }


(*****************************************************************************)
(* RESULTS                                                                   *)
(*****************************************************************************)

OM-RES COPY                LABEL     = Worcp
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 P,M,0> }

OM-RES CREATE              LABEL     = Worcr
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 P,M,0> }

OM-RES GET                 LABEL     = Worgt
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wgdsc, C  1 C,O,0> }

OM-RES INSTANCE            LABEL     = Worin
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wbool, C  3 P,M,0> }

OM-RES READ                LABEL     = Worrd
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wnelp, C  4 P,M,0>,
                                         <Welts, C 16 P,M,0> }

OM-RES WRITE               LABEL     = Worwr
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wnelp, C  4 P,M,0>,
                                         <Wdref, C 29 P,O,0> }

MT-RES OPEN                LABEL     = Wtrop
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wactl, U 16 C,M,0>,
                                         <Wobhl, C  1 P,O,0> }

MT-RES SIZE                LABEL     = Wtrsz
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobjq, C 24 P,M,0> }

MT-RES START XFER IN       LABEL     = Wtrst
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C  1 P,M,0>,
                                         <Widfr, C  5 P,M,0> }

MT-RES WAIT                LABEL     = Wtrwt
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wevnt, C 20 P,M,0> }

MA-RES OPEN                LABEL     = Wmrop
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wactl, U 16 C,M,0>,
                                         <Wobhl, C  1 P,O,0>,
                                         <Wclvr, C 26 P,O,0> }

MA-RES SIZE                LABEL     = Wmrsz
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobjq, C 24 P,M,0> }

MA-RES START DELIVER       LABEL     = Wmrsd
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C 1 P,M,0> }

MA-RES START RETRIEVE      LABEL     = Wmrsr
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wseqn, C 17 P,M,0>,
                                         <Wobhl, C  1 P,M,0> }

MA-RES SUBMIT              LABEL     = Wmrsb
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wobhl, C 1 P,M,0> }

MA-RES WAIT                LABEL     = Wmrwt
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Wevnt, C 20 P,M,0> }

(*****************************************************************************)
(* COMMON (CONSTRUCTORS)                                                     *)
(* THE OBJECT IS FOR SUBMIT AND XFER-OUT. IT IS A CHOICE OF A PRIVATE AND A  *)
(* PUBLIC OBJECT. NOTICE THAT A PRIVATE OBJECT WITHIN A DESCRIPTOR LIST IS   *)
(* ENCODED WITHIN 3080 0000 AND HAS A TYPE AND SYNTAX, WHEREAS Wobhl DOESN'T.*)
(* THE LIMIT OF 20 ON TYPE LIST IS = OXCOINTL AND IS AN IMPLEMENTATION LIMIT *)
(*****************************************************************************)

Type List                  LABEL     = Wtypl
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 50
                           CHILDREN  = { <Wvltp, U  2 P,O,0>   }

Object                     LABEL     = Wobjt
                           STRUCTURE = CHOICE
                           CHILDREN  = { <Wobhl, C  1 P,O,0>,
                                         <Wpdsc, C 11 C,O,0> }

Object (Deliv Confs)       LABEL     = Wobjd
                           STRUCTURE = CHOICE
                           TAG       = (C  1 C)
                           CHILDREN  = { <Wobhl, C  1 P,O,0>,
                                         <Wpdsc, C 11 C,O,0> }

Object (NDRs)              LABEL     = Wobjn
                           STRUCTURE = CHOICE
                           TAG       = (C  2 C)
                           CHILDREN  = { <Wobhl, C  1 P,O,0>,
                                         <Wpdsc, C 11 C,O,0> }

OM_GET Descriptor List     LABEL     = Wgdsc
                           STRUCTURE = ANY
                           TAG       = (C 1 C)
                           CHILDREN  = {}

OM_PUT Descriptor List     LABEL     = Wpdsc
                           STRUCTURE = ANY
                           TAG       = (C 11 C)
                           CHILDREN  = {}

(*****************************************************************************)
(* COMMON (PRIMITIVES)                                                       *)
(*****************************************************************************)

Client Name                LABEL     = Wclnm
                           STRUCTURE = IA5 STRING

Client Instance Name       LABEL     = Wcinm
                           STRUCTURE = IA5 STRING

Client Version             LABEL     = Wclvr
                           STRUCTURE = OCTET STRING

Wait Interval              LABEL     = Wwait
                           STRUCTURE = INTEGER

Return Code                LABEL     = Wretc
                           STRUCTURE = INTEGER

Object Handle              LABEL     = Wobhl
                           STRUCTURE = OCTET STRING

Objects in queue           LABEL     = Wobjq
                           STRUCTURE = INTEGER

Reserved Objects           LABEL     = Wresr
                           STRUCTURE = INTEGER

UnReserved Objects         LABEL     = Wunrs
                           STRUCTURE = INTEGER

Event Flag                 LABEL     = Wevnt
                           STRUCTURE = BOOLEAN

Operation Value            LABEL     = Woper
                           STRUCTURE = INTEGER

Result Value               LABEL     = Wrslt
                           STRUCTURE = INTEGER

Error Value                LABEL     = Werrv
                           STRUCTURE = INTEGER

Remove From Queue          LABEL     = Wremv
                           STRUCTURE = BOOLEAN

Sequence Number            LABEL     = Wseqn
                           STRUCTURE = INTEGER

Features                   LABEL     = Wfeas
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 13
                           CHILDREN  = { <Wfeat, C 21 P,O,0> }

Feature                    LABEL     = Wfeat
                           STRUCTURE = OBJECT IDENTIFIER

Activation List            LABEL     = Wactl
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 13
                           CHILDREN  = { <Wactd, C 15 P,O,0> }

Activated Feature          LABEL     = Wactd
                           STRUCTURE = BOOLEAN

Destination Handle         LABEL     = Wdshl
                           STRUCTURE = OCTET STRING

Destination Type           LABEL     = Wdsty
                           STRUCTURE = INTEGER

Destination Value Position LABEL     = Wdsvp
                           STRUCTURE = INTEGER

Object Identifier          LABEL     = Wobid
                           STRUCTURE = OBJECT IDENTIFIER

Exclusions                 LABEL     = Wexcl
                           STRUCTURE = INTEGER

Value Type                 LABEL     = Wvltp
                           STRUCTURE = INTEGER

Value Position             LABEL     = Wvpos
                           STRUCTURE = INTEGER

Maximum Number of Elements LABEL     = Wmxnm
                           STRUCTURE = INTEGER

Attribute Type             LABEL     = Watty
                           STRUCTURE = INTEGER

Attribute Syntax           LABEL     = Watsy
                           STRUCTURE = INTEGER

First Element Position     LABEL     = Wfeps
                           STRUCTURE = INTEGER

Elements                   LABEL     = Welts
                           STRUCTURE = OCTET STRING

Source DB Server Reference LABEL     = Wsref
                           STRUCTURE = OCTET STRING

Dest DB Server Reference   LABEL     = Wdref
                           STRUCTURE = OCTET STRING

Embedded DB Ref Offsets    LABEL     = Werfl
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 10
                           CHILDREN  = { <Weref, U  2 P,O,0> }

Embedded DBS Ref Offset    LABEL     = Weref
                           STRUCTURE = INTEGER

Next Element Position      LABEL     = Wnelp
                           STRUCTURE = INTEGER

Initial Value Position     LABEL     = Winvl
                           STRUCTURE = INTEGER

Final Value Position       LABEL     = Wfnvl
                           STRUCTURE = INTEGER

Modifications              LABEL     = Wmodi
                           STRUCTURE = INTEGER

Boolean                    LABEL     = Wbool
                           STRUCTURE = BOOLEAN

Session Workspace          LABEL     = Wwksp
                           STRUCTURE = INTEGER

Boolean                    LABEL     = Wnull
                           STRUCTURE = NULL

Identifier                 LABEL     = Widfr
                           STRUCTURE = IA5 STRING


(*****************************************************************************)
(* COMPLETELY SEPARATE BIT OF TEMPLATE FOR SESSION OBJECT                    *)
(*****************************************************************************)
SessionObject              LABEL     = Wsess
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Mgbid, A  3 C,M,0> D,
                                         <Wevhl, U  2 P,O,0>  }

Event Handle               LABEL     = Wevhl
                           STRUCTURE = INTEGER


!
