Google
 

Trailing-Edge - PDP-10 Archives - BB-FB51A-RM - sna-ai/sources/snacom.r36
There are no other files named snacom.r36 in the archive.
%title 'SNACOM -- SNA Gateway Access Common Symbols'

! Copyright (c) 1985 by
! DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts
!
! This software is furnished under a license and may be used and  copied
! only  in  accordance  with  the  terms  of  such  license and with the
! inclusion of the above copyright notice.  This software or  any  other
! copies  thereof may not be provided or otherwise made available to any
! other person.  No title to and ownership of  the  software  is  hereby
! transferred.
!
! The information in this software is subject to change  without  notice
! and  should  not  be  construed  as  a commitment by Digital Equipment
! Corporation.
!
! Digital assumes no responsibility for the use or  reliability  of  its
! software on equipment which is not supplied by Digital.

macro COPYRIGHT_STATEMENT =
    bind ______ = CH$ASCIZ ('--  COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1984  --') %;

library 'SNAXPT';                       ! Our own version of XPORT
$show (fields, noinfo)
%sbttl 'Common Literals'

literal                                 ! Library version number
    EV$VER = %O'001',                   ! Major
    EV$ECO = %O'000',                   ! ECO
    EV$UEC = %O'000';                   ! Customer ECO

macro EDIT_VERSION =
    %name ('E.VERS'): initial (EV$VER ^ 28 + EV$ECO ^ 20 + EV$UEC ^ 12) %;

literal                                 ! Boolean literals
    $TRUE = (1 eql 1),
    $FALSE = (1 eql 0);

literal
    MAXIMUM_SUPPORTED_PORTS = 20;       ! Maximum supported virtual circuits

literal                                 ! Packet data type
    NORMAL_DATA = 0,
    EXPEDITED_DATA = 1;
%sbttl 'CRLF  Macro'

macro CRLF (CNT) =            ! Macro to set error code for 
   begin 
         local TMPCNT;

    TMPCNT = CNT;

    while .TMPCNT gtr 0 do
        begin
        jsys_psout (.CRLFX);
        TMPCNT = .TMPCNT - 1;
        end;

    end %;
%sbttl 'BLT  Macro'

macro XERO (XBLOCK, XLEN) =
      
      begin
  
      register AC;
      builtin  MACHOP;

      literal BLT = %o'251';

      XBLOCK = 0;
      AC<18,18> = XBLOCK;
      AC<0,18> = XBLOCK + 1;
      MACHOP (BLT, AC, XBLOCK + XLEN-1);
      
      end%;
%sbttl 'Make Macro'

macro DISX (XSOURCE, XDEST, XBUFF) =
      
    begin
      local LENGTH;

      LENGTH = ch$rchar_a (XSOURCE);
      if .LENGTH eql 0
      then XDEST = 0
      else begin
           XDEST = ch$ptr (XBUFF);
           DISASSEMBLE (.XSOURCE, .XDEST, .LENGTH);
           XSOURCE = ch$plus (.XSOURCE, .LENGTH);
           end;
      
      end%;
%sbttl 'Lexical Macros'

macro CH$SEQUENCE (LENGTH, SIZE) =
    vector [ch$allocation (LENGTH %if not %null (SIZE) %then , SIZE %fi)] %;


macro CH$ASCIZ [] =
    ch$ptr (uplit (%asciz %string (%remaining))) %;


macro CH$ASCII [] =
    ch$ptr (uplit (%ascii %string (%remaining))) %;


macro CH$ASCIC [] =
    ch$ptr (uplit (%string (%char (%charcount (%remaining)), %remaining))) %;


macro CH$LEN (POINTER, LENGTH) =
    ch$diff (ch$find_ch (%if %null (LENGTH)
                         %then 2048
                         %else LENGTH %fi,
                         POINTER,
                         0),
             POINTER) %;


macro CH$MOVSTRING (POINTER_ADDRESS) [] =
    %if %isstring (%remaining)
    %then POINTER_ADDRESS = ch$move (%charcount (%string (%remaining)),
                                     CH$ASCIZ (%remaining),
                                     .POINTER_ADDRESS)
    %else %if %length gtr 2
          %then %error ('Illegal parameter count for CH$MOVSTRING')
          %else begin
                local LEN;

                LEN = CH$LEN (%remaining);
                POINTER_ADDRESS = ch$move (.LEN, %remaining, POINTER_ADDRESS);
                end
          %fi
    %fi %;


macro CH$MOVCSTRING (POINTER_ADDRESS) [ ] =
    %if %isstring (%remaining)
    %then POINTER_ADDRESS = ch$move (%charcount (%string (%remaining)) + 1,
                                     CH$ASCIC (%remaining),
                                     .POINTER_ADDRESS)
    %else %if %length gtr 2
          %then %error ('Illegal parameter count for CH$MOVCSTRING')
          %else begin
                local LEN;

                LEN = ch$rchar (%remaining) + 1;
                POINTER_ADDRESS = ch$move (.LEN, %remaining, .POINTER_ADDRESS);
                end
          %fi
    %fi %;


macro CH$RWORD (POINTER) =
    begin
    local VAL;

    VAL = 0;
    VAL<0,8> = ch$rchar (POINTER);
    VAL<8,8> = ch$rchar (ch$plus (POINTER,1));
    .VAL
    end %;


macro CH$RWORD_A (POINTER_ADDRESS) =
    begin
    local VAL;

    VAL = 0;
    VAL<0,8> = ch$rchar_a (POINTER_ADDRESS);
    VAL<8,8> = ch$rchar_a (POINTER_ADDRESS);
    .VAL
    end %;


macro CH$WWORD (VALUE, POINTER) =
    begin
    local VAL;

    VAL = VALUE;
    ch$wchar (.VAL<0,8>, POINTER);
    ch$wchar (.VAL<8,8>, ch$plus (POINTER,1));
    end %;


macro CH$WWORD_A (VALUE, POINTER_ADDRESS) =
    begin
    local VAL;

    VAL = VALUE;
    ch$wchar_a (.VAL<0,8>, POINTER_ADDRESS);
    ch$wchar_a (.VAL<8,8>, POINTER_ADDRESS);
    end %;


macro $$ (VAL, MASK) =
    ((VAL) ^ (%nbitsu (MASK and -MASK) -1)) %;


macro $ (MASK) =
    %nbitsu (MASK and -MASK) -1,
    %nbitsu (MASK ^ -(%nbitsu (MASK and -MASK) -1) and (1 ^ (36 - (%nbitsu (MASK and -MASK) -1))) -1) %;
%sbttl 'SNA Port Data Block Field Definitions'

$field PORT_CONTROL_BLOCK_FIELDS =
    set
    PCB_BLOCK_FIELD = [$sub_block()],
    PCB_JFN = [$byte],                  ! Gateway logical link JFN
    PCB_STATE = [$byte],                ! Port state
    PCB_FLAGS = [$byte],                ! Control flags
    PCB_RESET_SEEN = [$tiny_integer],   ! Reset seen counter
    PCB_INTCNT = [$short_integer],      ! Count of Interrrupts seen 
    PCB_ERROR = [$bytes(2)],            ! Port error
    PCB_PACKET_SIZE = [$bytes(2)],      ! Current packet size
    PCB_DATA_BASE = [$address],         ! Current user data base
    PCB_INPUT_BUFFER = [$address],      ! Address of input buffer data
    PCB_OUTPUT_BUFFER = [$address],     ! Address of output buffer data
    PCB_INHEAD_BUFFER = [$address],      ! Address of input buffer interrupt
    PCB_OUTHEAD_BUFFER = [$address],     ! Address of output buffer interrupt
    PCB_INTAIL_BUFFER = [$address],      ! Address of input buffer interrupt
    PCB_OUTTAIL_BUFFER = [$address],     ! Address of output buffer interrupt

        $overlay (PCB_FLAGS)
    PCB_RCV_INTERRUPT = [$bit],         ! Received interrupt bit
    PCB_DATA = [$bit]                   ! Data available flag
        $continue
    tes;

literal
    PORT_CONTROL_BLOCK_SIZE = $field_set_size;

macro PORT_CONTROL_BLOCK =
    block [PORT_CONTROL_BLOCK_SIZE] field (PORT_CONTROL_BLOCK_FIELDS) %;

macro PORT_CONTROL_BLOCKS =
    blockvector [MAXIMUM_SUPPORTED_PORTS, PORT_CONTROL_BLOCK_SIZE]
    field (PORT_CONTROL_BLOCK_FIELDS) %;


! RING Definitions

structure
    MULTIWORD_VECTOR[I; NUM_ELEMENTS, ELEMENT_SIZE] =
              [NUM_ELEMENTS*ELEMENT_SIZE] (I*ELEMENT_SIZE+MULTIWORD_VECTOR)<0, 36>;
literal
    MAX_INTERRUPTS = 5;

literal
    INT_BUFFER_SIZE = 16;


$field RING_ENTRY_FIELDS =
    set
    DATA_BUFFER = [$bytes(INT_BUFFER_SIZE)], ! Input buffer
        $align (fullword)
    IN_USE_FLAG = [$fullword],
    DATA_LENGTH = [$fullword],
    NEXT_RING_PTR = [$fullword]
    tes;

literal
    RING_ENTRY_SIZE = $field_set_size;

macro RING_ENTRY =
    block [RING_ENTRY_SIZE] field (RING_ENTRY_FIELDS) %;

macro RING_BLOCK =
    MULTIWORD_VECTOR [MAX_INTERRUPTS, RING_ENTRY_SIZE]%;

literal 
    RING_SIZE = MAX_INTERRUPTS*RING_ENTRY_SIZE;

macro RING_BLOCK_VECTOR =
    MULTIWORD_VECTOR [MAXIMUM_SUPPORTED_PORTS, RING_SIZE]%;

macro INITIAL_STACK (SIZE) [] =
    %if %count lss SIZE
    %then %if %count gtr 0 %then , %fi
          %count
          INITIAL_STACK (SIZE)
    %else %exitmacro %fi %;

macro STACK (SIZE) =
    vector [SIZE] %;
%sbttl 'Input/Output Buffer Blocks'

literal
    IO_BUFFER_SIZE = 3500;

$field IO_BUFFER_BLOCK_FIELDS =
    set
    IOB_INPUT_BUFFER = [$bytes(IO_BUFFER_SIZE)], ! Input buffer
        $align (fullword)
    IOB_INPUT_MARKER = [$fullword],
    IOB_OUTPUT_BUFFER = [$bytes(IO_BUFFER_SIZE)], ! Output buffer
        $align (fullword)
    IOB_OUTPUT_MARKER = [$fullword]
    tes;

literal
    IO_BUFFER_BLOCK_SIZE = $field_set_size;

macro IO_BUFFER_BLOCK =
    block [IO_BUFFER_BLOCK_SIZE] field (IO_BUFFER_BLOCK_FIELDS) %;

macro IO_BUFFER_BLOCKS =
    blockvector [MAXIMUM_SUPPORTED_PORTS, IO_BUFFER_BLOCK_SIZE]
    field (IO_BUFFER_BLOCK_FIELDS) %;

macro INITIAL_IO_BUFFER (SIZE) [] =
    %if %count lss SIZE
    %then %if %count gtr 0 %then , %fi
          [%count, IOB_INPUT_MARKER] = -1,
          [%count, IOB_OUTPUT_MARKER] = -1
          INITIAL_IO_BUFFER (SIZE)
    %else %exitmacro %fi %;
%sbttl 'User Port Data Base Field Definitions'

$field USER_DATA_BASE_FIELDS =
    set
    UDB_FLAGS = [$byte],                     ! User data base flags
    UDB_FLUSH_SEND = [$short_integer],! Number of Flush buffer messages to send
    UDB_USER_DATA_LENGTH = [$short_integer], ! User data buffer size
    UDB_DATA_LENGTH = [$short_integer],      ! Data Length
    UDB_E_DATA_LENGTH = [$short_integer],      ! Data Length
    UDB_BIND_LENGTH = [$short_integer],      ! Bind data length
    UDB_ABORT_LENGTH = [$short_integer],     ! Abort data length 
    UDB_ABORT_STATUS = [$fullword],          ! Status at time of abort
        $align (fullword)
    UDB_USER = [$stringx(8)],                ! 
        $align (fullword)
    UDB_BIND_DATA = [$bytes(129)],           ! BIND data buffer
        $align (fullword)
    UDB_ABORT_DATA = [$bytes(129)],          ! Abort data buffer
        $align (fullword)
    UDB_USER_DATA = [$sub_blockx(513)],      ! User data buffer
        $continue

        $overlay (UDB_FLAGS)
    UDB_DATA = [$bit],                       ! Data type
    UDB_DATA_AVAILABLE = [$bit],        ! Data available flag
    UDB_BIND_AVAILABLE = [$bit],        ! BIND data available flag
    UDB_INTERRUPT_AVAILABLE = [$bit]    ! Interrupt data available flag
        $continue
    tes;

literal
    USER_DATA_BASE_SIZE = $field_set_size;

macro USER_DATA_BASE =
    block [USER_DATA_BASE_SIZE] field (USER_DATA_BASE_FIELDS) %;
%sbttl 'Macro Interface Argument Block Field Definitions'

$field ARGUMENT_BLOCK_FIELDS =
    set
    ARGUMENT_WORD_0 = [$sub_block(1)],

        $overlay (ARGUMENT_WORD_0)
    WORKING_AREA = [$address],
    INTERRUPT_CHANNEL = [$short_integer],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Accept Incoming Connect
    ACC_PORT_NUMBER = [$integer],
    ACC_RETURN_CODE = [$fullword],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Reject a Connect
    REJ_PORT_NUMBER = [$integer],
    REJ_RETURN_CODE = [$fullword],
    REJ_SENSE_CODE = [$fullword],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Connect to an IBM Appl. 
    CON_PORT_NUMBER = [$halfword],
    CON_INTERRUPT_CHANNEL = [$halfword],
    CON_RETURN_CODE = [$fullword],
    CON_NODE_NAME = [$pointer],
    CON_CIRCUIT_NAME = [$pointer],
    CON_PASSWORD = [$pointer],
    CON_LOGON_MODE = [$pointer],
    CON_PLU_NAME = [$pointer],
    CON_USER = [$pointer],
    CON_USER_DATA = [$pointer],
    CON_USER_DATA_LENGTH = [$fullword],
    CON_ACCESS_NAME = [$pointer],
    CON_SLU_NUMBER = [$fullword],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Recieve Data Message
    REC_PORT_NUMBER = [$integer],
    REC_RETURN_CODE = [$fullword],
    REC_DATA_LENGTH = [$fullword],
    REC_DATA_POINTER = [$pointer],
    REC_SEQ_NUMBER = [$integer],
    REC_RH = [$fullword],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Receiving Interrupt Message
    REM_PORT_NUMBER = [$integer],
    REM_RETURN_CODE = [$fullword],
    REM_DATA_LENGTH = [$short_integer],
    REM_DATA = [$pointer],
    REM_SEQ_NUMBER = [$fullword],
    REM_RH  = [$fullword],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Read Event data
    RDE_PORT_NUMBER = [$integer],
    RDE_RETURN_CODE = [$fullword],
    RDE_EVENT_CODE = [$halfword],
    RDE_RESERVED = [$bits(16)],
    RDE_INTERRUPT_AVAILABLE = [$bit],
    RDE_DATA_AVAILABLE = [$bit],
    RDE_STATE = [$fullword],
    RDE_ERROR = [$fullword],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Read Abort data
    RAD_PORT_NUMBER = [$integer],
    RAD_RETURN_CODE = [$fullword],
    RAD_ABORT_STATUS = [$fullword],
    RAD_ABORT_REASON = [$fullword],
    RAD_SENSE_CODE = [$fullword],
    RAD_STATE = [$halfword],
    RAD_LENGTH = [$halfword],
    RAD_DATA = [$pointer],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Read BIND data
    RBD_PORT_NUMBER = [$integer],
    RBD_RETURN_CODE = [$fullword],
    RBD_BIND_LENGTH = [$fullword],
    RBD_BIND_DATA = [$pointer],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Re-Connect
    RCN_PORT_NUMBER = [$integer],
    RCN_RETURN_CODE = [$fullword],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Transmit Data Message
    TRA_PORT_NUMBER = [$integer],
    TRA_RETURN_CODE = [$fullword],
    TRA_DATA_LENGTH = [$short_integer],
    TRA_RESERVED = [$bits(17)],
    TRA_DATA_TYPE = [$bit],
    TRA_DATA_POINTER = [$pointer],
    TRA_SEQ_NUMBER = [$fullword],
    TRA_RH  = [$fullword],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Terminate Port Access
    TER_PORT_NUMBER = [$integer],
    TER_RETURN_CODE = [$fullword],
    TER_SENSE_CODE = [$fullword],
        $continue

        $overlay (ARGUMENT_WORD_0)      ! Listen for Incoming Connect
    LIS_PORT_NUMBER = [$integer],
    LIS_RETURN_CODE = [$fullword],
    LIS_NODE_NAME = [$pointer],
    LIS_CIRCUIT_NAME = [$pointer],
    LIS_ACCESS_NAME = [$pointer],
    LIS_SLU_NUMBER = [$fullword]
        $continue
    tes;

literal
    ARGUMENT_BLOCK_SIZE = $field_set_size;

macro ARGUMENT_BLOCK =
    block [ARGUMENT_BLOCK_SIZE] field (ARGUMENT_BLOCK_FIELDS) %;
%sbttl 'Miscelaneous Field Definitions'

$field LEVTAB_BLOCK_FIELDS = 
       set
       BLOCK1 = [$fullword],
       BLOCK2 = [$fullword],
       BLOCK3 = [$fullword]
       tes;

macro LEVTAB_BLOCK =
    block [3] field (LEVTAB_BLOCK_FIELDS) %;

    $field CHNTAB_BLOCK_FIELDS =
       set
       WORD0 = [$fullword],
       CHAN_1 = [$halfword],
       INTLEV1 = [$halfword],
       CHAN_2 = [$halfword],
       INTLEV2 = [$halfword],
       BBZ = [$bytes(132)]
       tes;

macro CHNTAB_BLOCK =
    block [36] field (CHNTAB_BLOCK_FIELDS) %;

$field LEVTAB_CHNTAB_FIELDS =
       set
       CHNTAB_ADDRESS = [$halfword],
       LEVTAB_ADDRESS = [$halfword]
       tes;

macro INT_BLOCK =
    block [1] field (LEVTAB_CHNTAB_FIELDS) %;

$field SIGNED_BYTE_FIELDS =
    set
    VALUE = [0,0,8,1]                   ! Signed eight bit byte
    tes;

macro $SIGNED_BYTE_VALUE =
    block [1] field (SIGNED_BYTE_FIELDS) %;
%sbttl 'Functional Specification Literals'

literal                                 ! SNA Port state
    AS_UND = 0,                         ! UNDEFINED
    AS_BNW = 1,                         ! BINDWAIT (LISTENING)
    AS_BNR = 2,                         ! BIND RECIEVED (CALLED)
    AS_FLU = 3,                         ! FLUSHING 
    AS_RUN = 4,                         ! RUNNING
    AS_RCN = 5,                         ! RECONNECTING 
    AS_ABG = 6,                         ! ABORTING
    AS_ABD = 7,                         ! ABORTED
    AS_ERR = 8;                        ! ERROR

literal                                 ! SNA Gateway Access protocol
    AP_OUTGOING_CONNECT = 1,            ! 1
    AP_LISTEN_CONNECT = 2,              ! 2
    AP_BINDDATA = 3,                    ! 3
    AP_BIND_ACCEPT = 4,                 ! 4
    AP_NORMAL_DATA = 5,                 ! 5
    AP_FLUSH_BUF = 6,                   ! 6
    AP_RECON_PEND = 7,                  ! 7
    AP_RECON_CONFIRM = 8;               ! 8

literal                                 ! Standard facility values
    AF_STANDARD_PACKET_SIZE = 10,
    AF_MINIMUM_PACKET_SIZE = 4,
    AF_MAXIMUM_PACKET_SIZE = 12,
    AF_MAXIMUM_BIND_DATA_SIZE = 128,
    AF_MAXIMUM_USER_DATA_SIZE = 128,
    AF_MAXIMUM_ABORT_DATA_SIZE = 128;

literal                                 ! SNA Return error codes
    AC_SUC = 0,                         ! Success
    AC_DCE = 1^0,                       ! Error making the Decnet connection
    AC_IAR = 1^1,                       ! Insufficient access resources
    AC_PER = 1^2,                       ! Procedure error
    AC_NDA = 1^3,                       ! No data to read
    AC_NLN = 1^4,                       ! No translation, logical name SNAGAT
    AC_NCM = 1^5,                       ! No Communication
    AC_RCN = 1^6,                       ! Reconnect Pending
    AC_DFT = 1^7,                       ! Data field truncated
    AC_INA = 1^8,                       ! Illegal network access code
    AC_BPN = 1^9,                       ! Bad Port Number
    AC_BTL = 1^10,                      ! Buffer too long
    AC_BTS = 1^11,                      ! Buffer too short
    AC_RSS = 1^12,                      ! Reset seen
    AC_SER = 1^13,                      ! Error Sending Normal data
    AC_RCE = 1^14,                      ! Error Reconnecting
    AC_SIE = 1^15,                      ! Error Sending Interrupt Data
    AC_PSE = 1^16,                      ! Error setting up the PSI system
    AC_DLA = 1^17;                      ! Decnet Link aborted during connect

literal                                 ! SNA error code
    AR_UND = 0,                         ! Undefined error
    AR_UAB = 100,                       ! User Abort Reason code
    AR_URJ = 101,                       ! User Reject
    AR_IPV = 102,                       ! Insufficient Gateway resourses
    AR_IGR = 103,                       ! Insufficient Gateway resourses
    AR_NAN = 104,                       ! No Such Access Name
    AR_CNA = 105,                       ! Circuit Name not available
    AR_NSC = 106,                       ! No such Circuit 
    AR_CNS = 107,                       ! Circuit Name not specified
    AR_PNS = 108,                       ! PLU Name not specified
    AR_NSA = 109,                       ! No such SLU
    AR_SNA = 110,                       ! SLU address not available (no ACTLU)
    AR_SIU = 111,                       ! SLU address in use
    AR_CRJ = 112,                       ! CONNECT request rejected by SSCP/PLU
    AR_BIN = 113,                       ! BIND values rejected by gateway
    AR_UBR = 114,                       ! UNBIND received while in RUNNING
    AR_SDA = 115,                       ! SLU deactivated
    AR_IAE = 116,                       ! Internal library error
    AR_IGE = 117,                       ! Internal Gateway error
    AR_SAA = 118,                       ! Session was aborted by re-
    AR_AST = 119,                       ! Abnormal session termination
    AR_NSL = 120,                       ! All SLU addresses inactive or in use
    AR_EDO = 121;                       ! Expedited data overrun
    

literal                                 ! SNA error codes
    AE_UNK = 0,                         ! Unknown error
    AE_IGR = 1^1,                       ! Insufficient gateway resources
    AE_INU = 1^2,                       ! Circuit in use
    AE_UCN = 1^3,                       ! Undefined circuit name
    AE_NLN = 1^4,                       ! No logical name
    AE_NCM = 1^5,                       ! No communication with the Gateway
    AE_DFT = 1^6,                       ! Data field truncated
    AE_FFT = 1^7,                       ! Facilities field truncated
    AE_EDO = 1^8;                       ! Expedited data overrun


macro                                   ! Gateway Access version text strings
    XV_VER = '001' %,                    ! Major
    XV_ECO = '001' %,                    ! ECO
    XV_CEC = '000' %,                    ! Customer ECO
    XV_GWA = '001' %,                    ! Gateway version
    XV_UEC = '000' %;                    ! User version

literal                                 ! Gateway Access version numeric value
    XV$VER = %X'01',                   ! Major
    XV$ECO = %X'01',                   ! ECO
    XV$CEC = %X'00',                   ! Customer ECO
    XV$GWA = %X'01',                   ! Gateway version
    XV$UEC = %X'00';                   ! User version

macro PROTOCOL_VERSION =
    %name ('P.VERS'): initial (XV$VER ^ 28 + XV$ECO ^ 20 + XV$CEC ^ 12 + XV$GWA ^ 4 + XV$UEC) %;

literal                                 ! Rejection codes
    AR_REJ = 1,                         ! Incompatibility
    AR_ACC = 2;                         ! Illegal access

$literal                                ! Function codes
    AF_ACC = $distinct,                 ! Accept a Connect
    AF_CON = $distinct,                 ! Connect to IBM app.
    AF_REC = $distinct,                 ! Recieve Data Message
    AF_REM = $distinct,                 ! Read Expedited Message
    AF_REJ = $distinct,                 ! Reject a BIND
    AF_RBD = $distinct,                 ! Read BIND Data
    AF_RDE = $distinct,                 ! Read Event Data
    AF_RAD = $distinct,                 ! Read Abort Data
    AF_RCN = $distinct,                 ! Re-Connect
    AF_TRA = $distinct,                 ! Transmit Data Message
    AF_TER = $distinct,                 ! Terminate Port Access
    AF_LIS = $distinct;                 ! Listen (for) Incoming Connect
%sbttl 'Global Routine Name Mapping'

macro %ROUTINE (NAME) =
    %sbttl %string (NAME %if not %identical (NAME, %string (%name (NAME)))
                         %then ,'   (', %name (NAME), ')' %fi)
    routine %name (NAME)
    %if %length gtr 1
    %then (%remaining) %fi %;

macro %GLOBAL_ROUTINE (NAME) =
    %sbttl %string (NAME %if not %identical (NAME, %string (%name (NAME)))
                         %then ,'   (', %name (NAME), ')' %fi)
    global routine %name (NAME)
    %if %length gtr 1
    %then (%remaining) %fi %;

!
! SNA Gateway Access DECnet Function Routines
!

macro                                   ! SAIDNF routines
    GAD$ABORT_LINK = GADABT %,
    GAD$ABORT_REASON = GADRSN %,
    GAD$DISCONNECT_LINK = GADDIS %,
    GAD$LINK_STATUS = GADSTA %,
    GAD$NETWORK_DESCRIPTOR = GADNET %,
    GAD$OPEN_LINK = GADOPN %,
    GAD$OPEN_SERVER = GADSRV %,
    GAD$PROTOCOL_TYPE = GADTYP %,
    GAD$PSI_CHANNELS = GADPSI %,
    GAD$RECEIVE_DATA = GADRCV %,
    GAD$SEND_DATA = GADSEN %,
    GAD$RECEIVE_INTERRUPT = GADRCI %,
    GAD$SEND_INTERRUPT = GADSNI %,
    GAD$EC_SEND_DATA = GADSEC %;

!
! SNA Gateway Access DECnet Link Function Routines
!

macro                                   ! SAIDLF routines
    GAL$CHECK_VERSION = GALCKR %,
    GAL$CONFIRM_VERSION = GALCFV %,
    GAL$LINK_SERVICE = GALSRV %,
    GAL$TERMINATE = GALTER %,
    GAL$REJECT = GALREJ %,
    GAL$INTERRUPT = GALINT %,
    GAL$RECEIVE_INTERRUPT = GALRCI %,
    GAL$RECEIVE_DATA = GALRCD %;

!
! SNA Gateway Access Macro Interface Routines
!

macro                                   ! SAIMAC routines
    GAM$VERIFY_PORT = GAMVFY %,
    GAM$SERVICE_PORT = GAMSER %,
    GAM$PORT_STATE = GAMSTA %,
    GAM$ASCIZ = GAMASZ %,
    GAM$ASCIC = GAMASC %;

!
! SNA Gateway Access Protocol Input/Output Routines
!

macro                                   ! SAIPRI routines
    GAP$I_BIND_ACCEPT = GPIACP %,
    GAP$I_COPY = GPICPY %,
    GAP$I_BINDDATA = GPIBIN %,
    GAP$I_DATA = GPIDAT %,
    GAP$I_FLUSH_BUF = GPIFLB %,
    GAP$I_RECON_PEND = GPIRCP %,
    GAP$I_PROTOCOL_TYPE = GPITYP %;


macro                                   ! SAIPRO routines
    GAP$O_ACCEPT = GPOACP %,
    GAP$O_ASSEMBLE = GPOASM %,
    GAP$O_CALL = GPOCAL %,
    GAP$O_LISTEN = GPOLIS %,
    GAP$O_DATA = GPODAT %,
    GAP$O_FLUSH = GPOFLB %,
    GAP$O_RECONNECT = GPORCN %;
%sbttl 'Interface Linkages'

linkage MAC =
    pushj (register = 1):
    linkage_regs (15,13,0)
    preserve (0,1,2,3,4,5,6,7,8,9,10,11,12,14);

  
 ! 
 ! Buffer used to exchange abort messages between 
 ! the gateway and AI 
 ! 
 !...$SNAABTBUFDEF	
  
 MACRO		SNAABTBUF$B_MSGCDE	= 0,0,8,0%;	! Abort Message code 
 			 
 MACRO		SNAABTBUF$T_SENSE	= 1,0,0,0%;	! Sense data	 
 LITERAL	SNAABTBUF$S_SENSE	= 100; 
 			 
 MACRO		SNAABTBUF$B_UNBCDE	= 5,0,8,0%;	! Unbind type 
 MACRO		SNAABTBUF$B_ABTCDE	= 6,0,8,0%;	! Server abort code 
 MACRO		SNAABTBUF$B_ABTQUAL	= 7,0,8,0%;    ! Server abort qualifier

 LITERAL	SNAABTBUF$C_LEN	= 8; 
 LITERAL	SNAABTBUF$K_LEN	= 8; 	 


! Local Modes:
! Mode:BLISS
! Auto Save Mode:2
! Comment Column:40
! Comment Rounding:+1
! End: