Google
 

Trailing-Edge - PDP-10 Archives - BB-FB49A-RM - sources/sntrex.b36
There are no other files named sntrex.b36 in the archive.
%title 'SNT Request Executor'

module SNTREX (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:     DECnet/SNA Gateway Protocol Trace Utility Request Executor.
!
! ABSTRACT:	This module provide routines to execute the user commands
!               from the command parser.
!
! ENVIRONMENT:	TOPS-20 Operating Systems, user mode.
!
! AUTHOR:	Dennis Brannon            CREATION DATE: January 17, 1984
!
! MODIFIED BY:
!
! 	D. Brannon, 11-Oct-84 : VERSION 1.00
!
! 1.01  D. Brannon, 12-Feb-84
!       Added checks in REX$SERVICE_REQUEST to handle return protocol codes
!       of 0(ST$NUL), 1(ST$INI), and 4(ST$STP).
!--

!
! REQUIRED FILES
!

library 'SYS:TXTLIB';                  ! Text definitions
library 'SNTDEF';                      ! SNT common definitions
library 'SNTLIB';                      ! VMS definitions
!library 'SNARJB';                     ! BLISS interface to Access Routines
library 'DBGTRB';                      ! Debugging interface to Access Routines

!
! FORWARD REFERENCES
!

forward routine
    REX$ANALYZE,
    REX$SERVICE_REQUEST,
    REX$TRACE;
!
! OWN STORAGE
!

!
! EXTERNAL REFERENCES
!

external
    ST: SNTBLOCK,
    WORK_AREA: vector [1000];

external
    CONTROL: GLOBAL_CONTROL_BLOCK;

external routine                        ! GALAXY routines
    GLXLIB_ROUTINES;

external routine
    FIL$BUILD_HEADER_RECORD,
    FIL$OPEN_TRACE_FILE,
    FIL$CLOSE_TRACE_FILE,
    FIL$WRITE_HEADER_RECORD,
    FIL$WRITE_RECORD,
    FIL$OPEN_OUTPUT_FILE,
    FIL$CLOSE_OUTPUT_FILE,
    FIL$CLOSE_ANALYZE_FILE,
    FIL$OPEN_ANALYZE_FILE,
    MEM$GET,
    MEM$RETURN: novalue,
    ANA$ANALYZE: novalue,
    TRC$TRACE,
    USP$ERROR_MESSAGE: novalue,
    TXT$WRITE;

external routine                        ! Message routines
    MSG$WRITE_HEADER_RECORD,
    MSG$WRITE_RECORD,
    MSG$EXPAND_ERROR;
%global_routine ('REX$ANALYZE') =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Function to ANALYZE a trace file.
!
! FORMAL PARAMETERS:
!
!       none
!
! ROUTINE VALUE:
!
!       $TRUE   Successful.
!       $FALSE  Otherwise.
!
! SIDE EFFECTS:
!
!       none
!
!--

    begin

    if (not FIL$OPEN_ANALYZE_FILE ())   ! Open analyze file
    then return $FALSE;
    if (not FIL$OPEN_OUTPUT_FILE ())    ! Open TTY: or listing file
    then return $FALSE;

    ANA$ANALYZE ();                     ! Analyze file content

    if (not FIL$CLOSE_ANALYZE_FILE ())  ! Close analyze file
    then return $FALSE;

    if (not FIL$CLOSE_OUTPUT_FILE ())   ! Close TTY: or listing file
    then return $FALSE;

    return $TRUE;                       ! Done
    end;                                ! End of REX$ANALYZE
%global_routine ('REX$SERVICE_REQUEST') =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Function to service a response message returned from the gateway.
!
! FORMAL PARAMETERS:
!
!
! ROUTINE VALUE:
!
!       $TRUE   Successful.
!       $FALSE  Otherwise.
!
! SIDE EFFECTS:
!
!       none
!
!--

    begin

    local
        STATUS,
        NUMBER,
        PROTOCOL_CODE,
        RETURN_CODE,
        RETURN_DATA_ADDRESS,
        RETURN_DATA_SIZE;

    ST[ST_RSP_CODE] = $FALSE;

    SNTRSP (RETURN_CODE = RETURN_CODE,
            RETURN_PROTOCOL_CODE = PROTOCOL_CODE,
            RETURN_DATA_SIZE = RETURN_DATA_SIZE,
            RETURN_DATA_ADDRESS = RETURN_DATA_ADDRESS);

   
    selectone .PROTOCOL_CODE of
	set
          [ST$NUL]:                        ! No data available
             begin
             return SNT$_NODATA;
             end;
          [ST$INI]:                        ! Protocol code = 1 (Init)
             begin
             return SNT$_PROTOCOL;
             end;
          [ST$STR]:                        ! Start trace
             begin
             return SNT$_NORMAL;
             end;
          [ST$DAT]:                        ! Trace Data
             begin
             if .ST[SW_ANALYZE]
             then
                 STATUS = MSG$WRITE_RECORD (.RETURN_DATA_ADDRESS,
                                            .RETURN_DATA_SIZE)
             else
                 STATUS = FIL$WRITE_RECORD (.RETURN_DATA_ADDRESS,
                                            .RETURN_DATA_SIZE);
             return .STATUS;
             end;
          [ST$STP]:                        ! Stop trace (a ^Z typed)
             begin
             return SNT$_NORMAL
             end;
          [otherwise]:                     ! Unrecognized protocol message
             return SNT$_PROTOCOL;
	tes;

    end;                                ! End of REX$SERVICE_REQUEST
%global_routine ('REX$TRACE') =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Function to connect to the gateway and send an "Initiate Trace" message
!
! FORMAL PARAMETERS:
!
!       none
!
! ROUTINE VALUE:
!
!       $TRUE   Successful.
!       $FALSE  Otherwise.
!
! SIDE EFFECTS:
!
!       none
!
!--

    begin

    local
        POINTER,
        PROTOCOL_CODE,
        RETURN_CODE,
        RETURN_DATA_ADDRESS,
        RETURN_DATA_SIZE;

    SNTINI (WORK_AREA = WORK_AREA,
            RETURN_CODE = RETURN_CODE,
            RETURN_PROTOCOL_CODE = PROTOCOL_CODE,
            RETURN_DATA_SIZE = RETURN_DATA_SIZE,
            RETURN_DATA_ADDRESS = RETURN_DATA_ADDRESS);

    return $TRUE;

    end;                                ! End of REX$TRACE
end                                   ! End of SNTREX module
eludom
! Local Modes:
! Mode:BLISS
! Auto Save Mode:2
! Comment Column:40
! Comment Rounding:+1
! End: