Google
 

Trailing-Edge - PDP-10 Archives - BB-FB49A-RM - sources/sgapro.b36
There are no other files named sgapro.b36 in the archive.
%title 'SNA Gateway Access Protocol for SNT Output'

module SGAPRO (ident = 'Version 1.01') =
begin

! Copyright (c) 1984, 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 Protocol Module for SNT.
!
! ABSTRACT:
!
!       Functions to assemble Gateway Access protocol output messages.
!
! ENVIRONMENT:
!
!	TOPS-20 Operating Systems, user interface.
!
! AUTHOR:	Dennis Brannon,              CREATION DATE: May 31, 1984
!
! MODIFIED BY:
!
! 	D. Brannon, 11-Oct-84 : VERSION 1.00
! 
! 1.01  D. Brannon, 31-Jan-85
!       Fixed ST[ST_CIRCUIT_ID] in GAP$RO_INI, because it has now changed to
!       contain a pointer to the circuit id string instead of the it's address.
!--
!
! TABLE OF CONTENTS
!

!
! INCLUDE FILES
!

library 'MONSYM';                       ! Monitor symbols
library 'SNTDEF';                       ! SNA Gateway Access common symbols
library 'SYS:TXTLIB';                   ! Text Processing Library

!
! FORWARD ROUTINE
!

forward routine
    GAP$RO_INI: novalue,
    GAP$RO_ASSEMBLE: novalue;

!
! EXTERNAL
!
external routine
    TXT$WRITE;
%routine ('GAP$RO_ASSEMBLE', SOURCE, DESTINATION) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Assemble single field to the protocol message buffer
!       The field built will be a counted string.
!
! 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$move (.LENGTH, .SOURCE, ..DESTINATION);
         end
    else ch$wchar_a (%O'0', .DESTINATION);

    return;
    end;                                ! End of GAP$RO_ASSEMBLE
%global_routine ('GAP$RO_INI', ST: ref SNTBLOCK, BUFFER, BUFLEN) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Assemble outgoing "Initiate Trace" message
!
!	MSG: /msgtype/type/version/dececo/cuseco/buffers/type/
!            /msglen(W)/seglen(W)/session #(W)/circuit id(ascii)/
!
! FORMAL PARAMETERS:
!
!	ARGBLK          Address of the argument block.
!       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
        BASE,
        TEMP: CH$SEQUENCE(10),
        LENGTH,
        CIRPTR,
	POINTER;

    bind
        UPPERCASE = ch$asciz ('%A%N');  ! Pattern to uppercase & suppress null

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

    ch$wchar_a (ST$INI, POINTER);           ! Message type
    ch$wchar_a (STVER, POINTER);            ! SNT Version number
    ch$wchar_a (STECO, POINTER);            ! SNT DEC ECO number
    ch$wchar_a (STUEC, POINTER);            ! SNT Customer ECO number
    ch$wchar_a (.ST[ST_BUFFERS], POINTER);  ! Buffering level
    ch$wchar_a (.ST[ST_TYPE], POINTER);     ! Trace type
    ch$wWORD_a (.ST[ST_SIZE], POINTER);     ! MSGLEN Maximum message length
    ch$wWORD_a (.ST[ST_SIZE], POINTER);     ! SEGLEN Maximum segment length
    ch$wWORD_a (.ST[ST_SESSION], POINTER);  ! Session Id
    CIRPTR = .ST[ST_CIRCUIT_ID];
    !
    ! Circuit id.
    !
    LENGTH = CH$LEN (.CIRPTR);
    TXT_WRITE (POINTER, .LENGTH, UPPERCASE, .CIRPTR);

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

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