Google
 

Trailing-Edge - PDP-10 Archives - BB-FB51A-RM - sna-ai/sources/saipro.b36
There are no other files named saipro.b36 in the archive.
%title 'SNA GATEWAY ACCESS PROTOCOL OUTPUT'

module SAIPRO (ident = 'Version 1.0') =
begin

! 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.


!++
! FACILITY:
!
!	SNA Gateway Access Module
!
! ABSTRACT:
!
!       Functions to assemble Gateway Access protocol output messages
!
! ENVIRONMENT:
!
!	TOPS-20 Operating Systems, user interface.
!
! AUTHOR:	Vicki Gary, CREATION DATE: March 17, 1984
!
! MODIFIED BY:
!
! 	, : VERSION
! 01	-
!--
!
! TABLE OF CONTENTS
!

!
! INCLUDE FILES
!

library 'MONSYM';                       ! Monitor symbols
library 'SNACOM';                       ! SNA Gateway Access common symbols
require 'JSYS';                         ! JSYS declarations


! LOCAL DATA STORAGE
!

macro CH$EXPLODE [] =
    CH$CHTAB (%quote %explode (%remaining)) %;

macro CH$CHTAB [CH] =
    %quote %c CH %;

bind LTUTAB =                           ! Lower to Upper case translation table
    ch$transtable (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
                   16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
                   CH$EXPLODE (' !"#$%&'), %c'''',
                   CH$EXPLODE ('()*+,-./0123456789:'),
                   CH$EXPLODE (';<=>?@ABCDEFGHIJKLM'),
                   CH$EXPLODE ('NOPQRSTUVWXYZ[\]^_'),
                   CH$EXPLODE ('`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~'),
                   127);


!
! FORWARD ROUTINE
!

forward routine
    GAP$O_ASSEMBLE: novalue;
%global_routine ('GAP$O_ACCEPT', ARGBLK: ref ARGUMENT_BLOCK, BUFFER, BUFLEN) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Assemble outgoing accept protocol message
!
!	MSG: /4/FLSBUF/
!
! FORMAL PARAMETERS:
!
!	ARGBLK          Address of the argument block containing information
!                       to be assembled.
!       BUFFER          Address of the buffer to store the output protocol
!                       message.
!       BUFLEN          Address of the variable to have the length of the
!                       protocol message buffer to be returned.
!
! IMPLICIT INPUTS:
!
!	none
!
! IMPLICIT OUTPUTS:
!
!	none
!
! COMPLETION CODES:
!
!	none
!
! SIDE EFFECTS:
!
!	none
!
!--

    begin

      local
           POINTER;

    POINTER = ch$ptr (.BUFFER,,8);
    ch$wchar_a (AP_BIND_ACCEPT, POINTER);
    ch$wchar_a (0, POINTER);

    ! Return the length of protocol message

    .BUFLEN = 2;

    return;
    end;                                ! End of GAP$O_ACCEPT
%global_routine ('GAP$O_FLUSH', BUFFER) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Assemble outgoing flush buffer protocol message
!
!	MSG: /6/0/
!
! FORMAL PARAMETERS:
!
!       BUFFER          Address of the buffer to store the output protocol
!                       message.
!
! IMPLICIT INPUTS:
!
!	none
!
! IMPLICIT OUTPUTS:
!
!	none
!
! COMPLETION CODES:
!
!	none
!
! SIDE EFFECTS:
!
!	none
!
!--

    begin

      local
           POINTER;

    POINTER = ch$ptr (.BUFFER,,8);
    ch$wchar_a (AP_FLUSH_BUF, POINTER);
    ch$wchar_a (0, POINTER);

    return;
    end;                                ! End of GAP$O_FLUSH
%global_routine ('GAP$O_CALL', ARGBLK: ref ARGUMENT_BLOCK, BUFFER, BUFLEN) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Assemble outgoing call protocol message for a CONNECT
!
!   MSG: /1/GATEWAY-ID/ACCESS/CIRCUIT/APPLICATION/LOGON/USER/PASSWORD/SLU/DATA/
!
! FORMAL PARAMETERS:
!
!	ARGBLK          Argument block contains fields to be assembled.
!       BUFFER          Address of buffer to store the protocol message.
!       BUFLEN          Length of the protocol message to be returned.
!
! IMPLICIT INPUTS:
!
!	none
!
! IMPLICIT OUTPUTS:
!
!	none
!
! COMPLETION CODES:
!
!	none
!
! SIDE EFFECTS:
!
!	none
!
!--

    begin

    local
        RCODE,
        PTR,
        LEN,
	LENGTH,
	BASE,
	POINTER;

    RCODE = 0;
    BASE = POINTER = ch$ptr (.BUFFER,,8);

    ch$wchar_a (AP_OUTGOING_CONNECT, POINTER);

    ch$wchar_a (0, POINTER);


    ! Version number

    ch$wchar_a (XV$VER, POINTER);     ! Version number
    ch$wchar_a (XV$ECO, POINTER);     ! ECO number
    ch$wchar_a (XV$CEC, POINTER);     ! User ECO number (Customer)
    ch$wchar_a (XV$GWA, POINTER);     ! Gateway version number
    ch$wchar_a (XV$UEC, POINTER);     ! User version number

    GAP$O_ASSEMBLE (.ARGBLK[CON_ACCESS_NAME], POINTER);

    GAP$O_ASSEMBLE (.ARGBLK[CON_CIRCUIT_NAME], POINTER);

    GAP$O_ASSEMBLE (.ARGBLK[CON_PLU_NAME], POINTER);

    GAP$O_ASSEMBLE (.ARGBLK[CON_LOGON_MODE], POINTER);

    GAP$O_ASSEMBLE (.ARGBLK[CON_USER], POINTER);

    GAP$O_ASSEMBLE (.ARGBLK[CON_PASSWORD], POINTER);

    ch$wchar_a (.ARGBLK[CON_SLU_NUMBER], POINTER);
         
    ! Assemble user  data

    if (LENGTH = .ARGBLK[CON_USER_DATA_LENGTH]) gtr 0
    then begin
         if .LENGTH gtr AF_MAXIMUM_USER_DATA_SIZE
         then begin
              LENGTH = AF_MAXIMUM_USER_DATA_SIZE;
              RCODE<$(AC_DFT)> = $TRUE;
              end;

         ch$wchar_a (.LENGTH, POINTER);
         POINTER = ch$move (.LENGTH, ch$ptr (.ARGBLK[CON_USER_DATA],,8), .POINTER);
         end
    else ch$wchar_a (0, POINTER);

    ch$wchar_a (0, POINTER);

    ARGBLK[CON_RETURN_CODE] = .RCODE;
    

    ! Get the length of protocol message

    .BUFLEN = ch$diff (.POINTER, .BASE);

    return;
    end;                                ! End of GAP$O_CALL
%global_routine ('GAP$O_RECONNECT', ARGBLK: ref ARGUMENT_BLOCK, BUFFER, BUFLEN) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Assemble outgoing call protocol message for a RECONNECT CONFIRM
!
!	MSG: /8/
!
! FORMAL PARAMETERS:
!
!	ARGBLK          Argument block contains fields to be assembled.
!       BUFFER          Address of buffer to store the protocol message.
!       BUFLEN          Length of the protocol message to be returned.
!
! IMPLICIT INPUTS:
!
!	none
!
! IMPLICIT OUTPUTS:
!
!	none
!
! COMPLETION CODES:
!
!	none
!
! SIDE EFFECTS:
!
!	none
!
!--

    begin

    local
	POINTER;

    POINTER = ch$ptr (.BUFFER,,8);

    ch$wchar_a (AP_RECON_CONFIRM, POINTER);

    .BUFLEN = 1;

    return;
    end;                                ! End of GAP$O_RECONNECT
%global_routine ('GAP$O_LISTEN', ARGBLK: ref ARGUMENT_BLOCK, BUFFER, BUFLEN) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Assemble outgoing call protocol message for a LISTEN
!
!	MSG: /2/ACCESS/CIRCUIT/SLU/
!
! FORMAL PARAMETERS:
!
!	ARGBLK          Argument block contains fields to be assembled.
!       BUFFER          Address of buffer to store the protocol message.
!       BUFLEN          Length of the protocol message to be returned.
!
! IMPLICIT INPUTS:
!
!	none
!
! IMPLICIT OUTPUTS:
!
!	none
!
! COMPLETION CODES:
!
!	none
!
! SIDE EFFECTS:
!
!	none
!
!--

    begin

    local
        PTR,
        LEN,
	LENGTH,
	BASE,
	POINTER;

    BASE = POINTER = ch$ptr (.BUFFER,,8);

    ch$wchar_a (AP_LISTEN_CONNECT, POINTER);
    ch$wchar_a (0, POINTER);

    ! Version number


    ! Version number

    ch$wchar_a (XV$VER, POINTER);     ! Version number
    ch$wchar_a (XV$ECO, POINTER);     ! ECO number
    ch$wchar_a (XV$CEC, POINTER);     ! User ECO number (Customer)
    ch$wchar_a (XV$GWA, POINTER);     ! Gateway version number
    ch$wchar_a (XV$UEC, POINTER);     ! User version number

    GAP$O_ASSEMBLE (.ARGBLK[LIS_ACCESS_NAME], POINTER);

    GAP$O_ASSEMBLE (.ARGBLK[LIS_CIRCUIT_NAME], POINTER);

    GAP$O_ASSEMBLE (.ARGBLK[LIS_SLU_NUMBER], POINTER);

    ! Get the length of protocol message

    .BUFLEN = ch$diff (.POINTER, .BASE);

    return;
    end;                                ! End of GAP$O_LIS
%global_routine ('GAP$O_DATA', ARGBLK: ref ARGUMENT_BLOCK, BUFFER, BUFLEN) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Assemble outgoing data protocol message
!
!       MSG: /5/DATA/
!
! FORMAL PARAMETERS:
!
!	ARGBLK          Argument block contains fields to be assembled.
!       BUFFER          Address of buffer to store the protocol message.
!       BUFLEN          Length of the protocol message to be returned.
!
! IMPLICIT INPUTS:
!
!	none
!
! IMPLICIT OUTPUTS:
!
!	none
!
! COMPLETION CODES:
!
!	none
!
! SIDE EFFECTS:
!
!	none
!
!--

    begin

    local
	LENGTH,
	BASE,
	POINTER;

    POINTER = BASE = ch$ptr (.BUFFER,,8);

    ch$wchar_a (AP_NORMAL_DATA, POINTER);
    ch$wchar_a (0, POINTER);

    
    ! Put in the Sequence (2-byte) number
    
    POINTER = ch$move (2, ch$ptr (ARGBLK[TRA_SEQ_NUMBER],,8), .POINTER);

    POINTER = ch$move (3, ch$ptr (ARGBLK[TRA_RH],,8), .POINTER);

!  ch$move (.ARGBLK[TRA_DATA_LENGTH], ch$ptr (ARGBLK[TRA_DATA],,8), .POINTER);

    ! Assemble data. This section is non-transportable BLISS code

    if (LENGTH = .ARGBLK[TRA_DATA_LENGTH]) gtr 0
    then jsys_sin (.ARGBLK[TRA_DATA_POINTER], .POINTER, -.LENGTH; ARGBLK[TRA_DATA_POINTER], POINTER);

    ! Get the length of protocol message

    .BUFLEN = ch$diff (.POINTER, .BASE);

    return;
    end;                                ! End of GAP$O_DATA
%routine ('GAP$O_ASSEMBLE', SOURCE, DESTINATION) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Assemble single field to the protocol message buffer
!
! FORMAL PARAMETERS:
!
!	SOURCE          ASCIZ pointer to the data field to be assembled.
!       DESTINATION     Address of the variable containing the pointer to
!                       the current position in the protocol message buffer.
!                       Updated upon return.
!
! IMPLICIT INPUTS:
!
!	none
!
! IMPLICIT OUTPUTS:
!
!	none
!
! COMPLETION CODES:
!
!	none
!
! SIDE EFFECTS:
!
!	none
!
!--

    begin

    local
        LENGTH;

    if (.SOURCE neq 0)
    and (LENGTH = CH$LEN (.SOURCE)) gtr 0
    then begin
         ch$wchar_a (.LENGTH, .DESTINATION);
         .DESTINATION = ch$translate (LTUTAB, .LENGTH, .SOURCE, 0, .LENGTH, ..DESTINATION);
         end
    else ch$wchar_a (0, .DESTINATION);

    return;
    end;                                ! End of GAP$O_ASSEMBLE
end                                   ! End of Module XGAPRO
eludom
! Local Modes:
! Mode:BLISS
! Auto Save Mode:2
! Comment Column:40
! Comment Rounding:+1
! End: