Google
 

Trailing-Edge - PDP-10 Archives - TOPS-20_V6.1_DECnetSrc_7-23-85 - mcb/xpt/xptrcv.bli
There is 1 other file named xptrcv.bli in the archive. Click here to see a list.
module XPTRCV	(
		IDENT = 'X01220'
		) =
begin

!
!                    COPYRIGHT (c) 1980, 1981, 1982
!                    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:	Transport
!
! ABSTRACT:
!
!	This module processes all messages received from the DLL.  Based on the
!	first (control) character of the message, the message is passed to one
!	of the following routines:
!
!	MESSAGE TYPE		ACTION		ROUTINE		MODULE
!
!	Alarm			Throw away	TERMINATE	Forwarding
!
!	Phase III Data 		Route it	RCVDAT		Select
!
!	Phase II Data		Route it	RCVPH2		Select
!
!	Routing			Process it	RCVROU		Decision
!
!	Invalid or other	Throw away	TERMINATE	Forwarding
!	control message
!
! ENVIRONMENT:	MCB
!
! AUTHOR: L. Webber , CREATION DATE: 30-Jul-79
!
! MODIFIED BY:
!
!	L. Webber, 30-Jul-79 : VERSION 01
!
! 1.01	L. Webber, 24-Oct-79
!	Bring the module into conformance with the design specification
!
! 1.02	L. Webber, 20-Dec-79
!	Modifications associated with breaking Transport Line Interface out
!
! 1.03	L. Webber, 4-Apr-80
!	Change call to RCVROU to an extension process call
!
! 1.04	L. Webber, 11-Dec-80
!	Modify to support MCB 3.1
!
! 1.05	L. Webber, 26-Jan-80
!	Add counter updating on bad message
!
! 1.06	L. Webber, 9-Feb-81
!	Change references to TERMINATE to CALL$E
!
! 1.07	L. Webber, 9-Feb-81
!	Change back to direct call; an interface routine has been added.
!
! 1.08	L. Webber, 18-Feb-81
!	Add debugging code to maintain a count of receive buffers outstanding
!	to Transport from the DLL.
!
! 1.09	L. Webber, 24-Feb-81
!	Add validity checking of Hello message (call to RCVHEL)
!
! 1.10	L. Webber, 17-Mar-81
!	Change call to INI_LIN from CALL$E to CALL$P so that a CCB queued
!	by INI_LIN will have come from TLI.
!
! 1.11	L. Webber, 23-Feb-82
!	Add maintenance of DLLquota to RCVBUF.
!
! 1.12	L. Webber,26-Feb-82
!	Enhance 1.11 to keep counters (data packets are assumed to
!	be transit.)
!
! 1.22	A. Peckham,19-Apr-82
!	Eliminate references to GETLINE.
!
!--
!
! TABLE OF CONTENTS
!

forward routine
	RCVBUF: novalue;

!
! INCLUDE FILES:
!

!
! MACROS:
!

require 'XPTMAC';

!
! EQUATED SYMBOLS:
!

!
! OWN STORAGE:
!

!
! EXTERNAL REFERENCES:
!

external routine
    TERMINATE: novalue,
    RCVDAT: novalue,    
    RCVPH2: novalue,
    RCVROU: novalue;
global
routine RCVBUF (CCB): novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!  Processes a message received from the Data Link Layer.
!
! FORMAL PARAMETERS
!
!	CCB - Address of the RDB containing the message
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
! COMPLETION CODES:
!
!	NONE.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

begin
local LINEb;
require 'XPTSYM';
require 'MCBCOM';
local BUFPTR,CTL;

LINEb = $XPT_GET_LINE_DB(.CCB[C_LIX]);

!
!  Map the buffer into our address space and pick up flags byte
!

MAPBUF(.CCB,BUFPTR);
CTL = getb(BUFPTR);			!Pick up the flags byte

!
!  Increment the count of receive buffers Transport is responsible for.
!  If we already have enough buffers from the DLL, reject this one.
!

INPUTcount = .INPUTcount + 1;
DLLquota = .DLLquota - 1;
if .DLLquota lss 0 then
    if .Nty neq PhTwo then begin			
	TERMINATE(.CCB,CE_RTE);			! If we have all the
	if .CTL<0,2> eql 2 then begin		!   packets we can handle,
	    COUNTER_INCREMENT(LINEb,XPTxit_cng);!   throw this one away
	    COUNTER_INCREMENT(LINEb,XPTxit_rcv);!   and increment the
	    end;				!   counters now
	return;
        end;

!
! Dispatch based on protocol type
!

if not .Ph2circuit
then begin
     !
     ! Phase III protocol
     !
     if .CTL<0,1> eql 0
     then begin
          if .CTL<6,1> eql 0
          then begin
               if (.CTL and %b'10100101') eql 0
               then RCVDAT(.CCB)        ! Route phase III data message
               else begin
                    COUNTER_INCREMENT(XPTDB,XPTfmt_loss);
                    TERMINATE(.CCB,CS_SUC);     !    throw it away
                    end;
               end
          else RCVPH2(.CCB);            ! Route phase II message
          end
     else begin
          if (.CTL and %b'11110000') eql 0
          then begin
               case .CTL<1,3> from 0 to 7 of
                   set
                   [0,1,2]:
                       TERMINATE(.CCB,CS_SUC);  !    throw it away
                   [3]:
                       CALL$E(RCVROU,PD_XPE,.CCB);
                   [inrange]:
                       begin
                       COUNTER_INCREMENT(XPTDB,XPTfmt_loss);
                       TERMINATE(.CCB,CS_SUC);  !    throw it away
                       end;
                   tes;
               end
          else begin
               COUNTER_INCREMENT(XPTDB,XPTfmt_loss);
               TERMINATE(.CCB,CS_SUC);  !    throw it away
               end;
          end;
     end
else begin
     !
     ! Phase II protocol
     !
     if .CTL<1,1> eql 1
     then RCVPH2(.CCB)                  ! Route phase II message
     else if .CTL<0,7> neq (2^2 + 5^4)
          then RCVPH2(.CCB)             ! Route phase II message
          else TERMINATE(.CCB,CS_SUC);  !    throw it away
     end;

end;				!End of RCVBUF
end				!End of Module XPTRCV
eludom