Google
 

Trailing-Edge - PDP-10 Archives - TOPS-20_V6.1_DECnetSrc_7-23-85 - mcb/xpt/xptdec.lst
There is 1 other file named xptdec.lst in the archive. Click here to see a list.
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page   1
								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (1)

;	  0001	module XPTDEC	(
;	  0002			IDENT = 'X01390'
;	  0003			) =
;	  0004	begin
;	  0005	
;	  0006	!
;	  0007	!                    COPYRIGHT (c) 1980, 1981, 1982
;	  0008	!                    DIGITAL EQUIPMENT CORPORATION
;	  0009	!                        Maynard, Massachusetts
;	  0010	!
;	  0011	!     This software is furnished under a license and may  be  used
;	  0012	!     and copied only in accordance with the terms of such license
;	  0013	!     and with the inclusion of the above copyright notice.   This
;	  0014	!     software  or any other copies thereof may not be provided or
;	  0015	!     otherwise made available to any other person.  No  title  to
;	  0016	!     and ownership of the software is hereby transferred.
;	  0017	!
;	  0018	!     The information  in  this  software  is  subject  to  change
;	  0019	!     without  notice  and should not be construed as a commitment
;	  0020	!     by DIGITAL EQUIPMENT CORPORATION.
;	  0021	!
;	  0022	!     DIGITAL assumes no responsibility for the use or reliability
;	  0023	!     of  its  software  on  equipment  which  is  not supplied by
;	  0024	!     DIGITAL.
;	  0025	!
;	  0026	
;	  0027	!++
;	  0028	! FACILITY:	DECnet Transport
;	  0029	!
;	  0030	! ABSTRACT:
;	  0031	!
;	  0032	!	 Transport Decision process.  Maintains transport routing data bases
;	  0033	!	 and selects routing paths.
;	  0034	!
;	  0035	! ENVIRONMENT:	MCB
;	  0036	!
;	  0037	! AUTHOR: L. Webber , CREATION DATE: 16-Jul-79
;	  0038	!
;	  0039	! MODIFIED BY:
;	  0040	!
;	  0041	!	L. Webber, 16-Jul-79 : VERSION 1.00
;	  0042	!
;	  0043	! 1.01	L. Webber, 20-Dec-79
;	  0044	!	Modifications associated with splitting Transport Line Interface out
;	  0045	!
;	  0046	! 1.02	L. Webber, 24-Jan-80
;	  0047	!	Put Hop and Cost in a single matrix; modified algorithms as per
;	  0048	!	22-Jan-80 architecture change
;	  0049	!
;	  0050	! 1.03	L. Webber, 29-Jan-80
;	  0051	!	Modify interfaces to OPENT and CLOSET to match standard dispatch
;	  0052	!	linkage.
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page   2
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (1)

;	  0053	!
;	  0054	! 1.04	L. Webber, 2-Apr-80
;	  0055	!	Modify to support node and line sub-data-bases
;	  0056	!
;	  0057	! 1.05	L. Webber, 30-Jun-80
;	  0058	!	Modify to use MCBLIB macros
;	  0059	!
;	  0060	! 1.06	A. Peckham, 15-Oct-80
;	  0061	!	Update for new function modifiers.
;	  0062	!
;	  0063	! 1.07	A. Peckham, 21-Oct-80
;	  0064	!	Change CE_ERR return code to SIGNAL_STOP.
;	  0065	!
;	  0066	! 1.08	L. Webber, 11-Dec-80
;	  0067	!	Modify to support MCB 3.1
;	  0068	!
;	  0069	! 1.09	L. Webber, 20-Jan-81
;	  0070	!	Change definition of MATRIX structure to take NLN as an actual.
;	  0071	!
;	  0072	! 1.10	L. Webber, 26-Jan-81
;	  0073	!	Add Event Logging and Counter Incrementing
;	  0074	!
;	  0075	! 1.11	L. Webber, 10-Feb-81
;	  0076	!	MAPBUF is now a macro
;	  0077	!
;	  0078	! 1.12	L. Webber, 23-Feb-81
;	  0079	!	Add event logging for reachability changes and line up;
;	  0080	!	make Event Buffer image field
;	  0081	!
;	  0082	! 1.13	L. Webber, 1-Apr-81
;	  0083	!	Fix length of event buffer reason code in VALID_BUFFER.
;	  0084	!
;	  0085	! 1.14	L. Webber, 3-Apr-81
;	  0086	!	Transform all reason code insertions into calls to EP_REASON.
;	  0087	!	Add call to EP_EXNODE (expected node).
;	  0088	!
;	  0089	! 1.15	L. Webber, 3-Apr-81
;	  0090	!	Put in LIX as entity ID for all events (except for node reachability
;	  0091	!	change, which takes node address).
;	  0092	!
;	  0093	! 1.16	L. Webber, 14-Apr-81
;	  0094	!	Call $XPECLN when a node becomes unreachable, to clean out the
;	  0095	!	Link Translate Table of all links to/from the node.
;	  0096	!
;	  0097	! 1.17	L. Webber, 10-May-81
;	  0098	!	Add code to call do an $MCB_PAUSE every once in a while during the
;	  0099	!	routing algorithm.
;	  0100	!
;	  0101	! 1.18	L. Webber, 15-May-81
;	  0102	!	Do an $MCB_PAUSE every time there's something on the synch queue.
;	  0103	!	Make IncN the number of pauses this time through the algorithm.
;	  0104	!
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page   3
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (1)

;	  0105	! 1.19	L. Webber, 1-Jun-81
;	  0106	!	Modify all LOG_EVENT calls for a circuit entity to pass the NMXid.
;	  0107	!
;	  0108	! 1.20	L. Webber, 6-Jul-81
;	  0109	!	Fix VALID_BUFFER not to ignore routing messages with reachable nodes
;	  0110	!	past NN.  Also, modify the event logging of that event to give the
;	  0111	!	highest reachable node in the message instead of the local NN.
;	  0112	!
;	  0113	! 1.21	L. Webber, 13-Jul-81
;	  0114	!	Modify linkage to COSTCH.
;	  0115	!
;	  0116	! 1.22	L. Webber, 13-Jul-81
;	  0117	!	Fix 1.21 so that COSTCH doesn't call ROUTES (TLI is the wrong process
;	  0118	!	context).  Instead, it will cause the routing clock to go off.
;	  0119	!
;	  0120	! 1.23	L. Webber, 14-Jul-81
;	  0121	!	Map in Hopcost in COSTCH; change calls to MAPIN to MAP$'s.
;	  0122	!
;	  0123	! 1.24	L. Webber, 28-Jul-81
;	  0124	!	Re-map Hopcost after calling $XPECLN in ROUTES.
;	  0125	!
;	  0126	! 1.25	L. Webber, 5-Aug-81
;	  0127	!	Ignore "line up" CCB if the circuit isn't in TC state.
;	  0128	!
;	  0129	! 1.26	L. Webber, 11-Sep-81
;	  0130	!	Fix ROUTES so that OL goes "unspecified" when a node becomes
;	  0131	!	unreachable.
;	  0132	!
;	  0133	! 1.27	L. Webber, 17-Sep-81
;	  0134	!	Add support for Phase2_node flag in node data base.
;	  0135	!
;	  0136	! 1.28	L. Webber, 23-Sep-81
;	  0137	!	Add code to flag a node as "adjacent Phase II" when a circuit
;	  0138	!	comes up, and in ROUTES to make a node reachable if that flag
;	  0139	!	is on.  The purpose of this change is to make Phase II nodes
;	  0140	!	reachable to the local DN20 (and to all adjacent Phase II nodes)
;	  0141	!	but to mark them not reachable in the DN20's routing messages.
;	  0142	!
;	  0143	! 1.29	L. Webber, 24-Sep-81
;	  0144	!	Modify event logging code to use new macros for preparing the
;	  0145	!	Event Buffer.
;	  0146	!
;	  0147	! 1.30	L. Webber, 6-Oct-81
;	  0148	!	Fix LINEDN to make a Phase II node unreachable when its connecting
;	  0149	!	circuit goes down.
;	  0150	!
;	  0151	! 1.31	L. Webber, 20-Oct-81
;	  0152	!	Use the (new) "Reset" bit in LINEflags rather than Nty to determine
;	  0153	!	when a line going down had an adjacent Phase II node (Nty is zeroed
;	  0154	!	by Line Support).
;	  0155	!
;	  0156	! 1.32	L. Webber, 9-Nov-81
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page   4
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (1)

;	  0157	!	Fix dot bug in 1.31.
;	  0158	!
;	  0159	! 1.33	L. Webber, 21-Dec-81
;	  0160	!	Call CLN_RETRY for "Phase II" circuits in LINEDN.
;	  0161	!
;	  0162	! 1.34	L. Webber, 23-Feb-82
;	  0163	!	Add DLLquota maintenance.
;	  0164	!
;	  0165	! 1.35	L. Webber, 8-Mar-82
;	  0166	!	Don't process routing message if the input circuit is down.
;	  0167	!
;	  0168	! 1.36	L. Webber, 31-Mar-82
;	  0169	!	Call $XPECLN when a Phase II circuit goes down (since "node down"
;	  0170	!	doesn't handle in in that case).
;	  0171	!
;	  0172	! 1.37	A. Peckham, 19-Apr-82
;	  0173	!	Eliminate references to LOG_EVENT, GETLINE, GETNODE.
;	  0174	!       PKTA_HDR has gone to XPE.  Make local call now.
;	  0175	!       Optimize ROUTES and friends.
;	  0176	!
;	  0177	! 1.38	A. Peckham, 23-Aug-82
;	  0178	!	Fix bug in ROUTES which shows up as low core being modified (4:0 6:1).
;	  0179	!       The check for a $MCB_PAUSE allowed the loop on nodes to go beyond NN.
;	  0180	!       This ended up requesting the data base for a non-exisistent node,
;	  0181	!       which would produce a zero address for NODEb.
;	  0182	!       Move the _SYNQH check up to the top of the loop.
;	  0183	!
;	  0184	! 1.39	A. Peckham, 16-Sep-82
;	  0185	!	Add support for internal feature: SET NODE blah MAXIMUM ADDRESS num.
;	  0186	!       This causes XPT to ignore nodes above 'num' when it receives a
;	  0187	!       routing message from node 'blah'.
;	  0188	!
;	  0189	!--
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page   5
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (2)

;	  0190	
;	  0191	!
;	  0192	! INCLUDE FILES:
;	  0193	!
;	  0194	
;	  0195	require 'XPTMAC';
;	  0293	
;	  0294	!
;	  0295	! TABLE OF CONTENTS
;	  0296	!
;	  0297	
;	  0298	forward routine
;	  0299		ROUTES: novalue,
;	  0300		CHECK: novalue,
;	  0301		LINEDN: CALL$ novalue,
;	  0302		LINEUP: CALL$ novalue,
;	  0303		RCVROU: CALL$ novalue,
;	  0304		COSTCH: CALL$ novalue,
;	  0305		OPENT: CALL$ novalue,
;	  0306		CLOSET: CALL$ novalue,
;	  0307		DECTIM: CALL$ novalue,
;	  0308	        SET_EACH_Srm_FLAG: novalue,
;	  0309	        SIGNAL_REACHABILITY: novalue,
;	  0310		VALID_BUFFER;
;	  0311	
;	  0312	!
;	  0313	! MACROS:
;	  0314	!
;	  0315	
;	  0316	!
;	  0317	! EQUATED SYMBOLS:
;	  0318	!
;	  0319	
;	  0320	!
;	  0321	! OWN STORAGE:
;	  0322	!
;	  0323	
;	  0324	!
;	  0325	! EXTERNAL REFERENCES:
;	  0326	!
;	  0327	
;	  0328	external _SYNQH;			! Synch queue header
;	  0329	
;	  0330	external routine
;	  0331		$XPECLN: CALL$ novalue,
;	  0332		CLN_RETRY: novalue,
;	  0333		TERM_XPT: novalue;
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page   6
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (3)

;	  0334	global routine ROUTES: novalue =
;	  0335	
;	  0336	!++
;	  0337	! FUNCTIONAL DESCRIPTION:
;	  0338	!
;	  0339	!  Determines the reachability and output line for each destination
;	  0340	!  node.
;	  0341	!
;	  0342	!  This routine may have to be invoked multiple times to perform a single
;	  0343	!  resolution of the routing data base.  If a process needs to be
;	  0344	!  dispatched at synch level, ROUTES will do an $MCB_PAUSE.  MCB will call
;	  0345	!  ROUTES back at synch level (with no other invocations of Transport
;	  0346	!  intervening), at which time more nodes will be processed until all NN
;	  0347	!  are done.
;	  0348	!
;	  0349	! FORMAL PARAMETERS
;	  0350	!
;	  0351	!	NONE.
;	  0352	!
;	  0353	! IMPLICIT INPUTS
;	  0354	!
;	  0355	!	Hop - 2x2 matrix containing the hops to each node over each line.
;	  0356	!	Cost - 2x2 matrix containing the cost to each node over each line.
;	  0357	!	Minhop - vector containing the fewest hops to each destination.
;	  0358	!	Mincost - vector containing the least cost to each destination.
;	  0359	!	Maxh - Maximum number of hops (network diameter)
;	  0360	!	Maxc - Maximum cost to destination
;	  0361	!	Infh - Value denoting "infinite" hops
;	  0362	!	Infc - Value denoting "infinite" cost
;	  0363	!	Reach - vector containing the reachability for a destination.
;	  0364	!	NN - maximum node address; number of rows in the matrices.
;	  0365	!
;	  0366	!	MaxN - maximum node address that has been processed so far.
;	  0367	!	IncN - work variable
;	  0368	!	Synchblk - the Synch block used to reschedule this routine.
;	  0369	!
;	  0370	! ROUTINE VALUE:
;	  0371	! COMPLETION CODES:
;	  0372	!
;	  0373	!	NONE.
;	  0374	!
;	  0375	! SIDE EFFECTS:
;	  0376	!
;	  0377	!	Modifies matrices Hop and Cost.  Sometimes modifies vectors Minhop,
;	  0378	!	Mincost, Reach, OL and Srm.
;	  0379	!
;	  0380	!--
;	  0381	
;	  0382	begin
;	  0383	require 'XPTSYM';
;	  0420	bind Hopcost = Hopcost_address: matrix;
;	  0421	local I;
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page   7
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (3)

;	  0422	MAP$(HOPcost_bias);			!Map in the matrix
;	  0423	I = .MaxN;				!Calculate starting node
;	  0424	if .I eql 0
;	  0425	then begin
;	  0426	     IncN = 0;                          ! Initialize pause count if starting
;	  0427	     Routing_changed = FALSE;
;	  0428	     end;
;	  0429	do begin				! Process while synch queue is empty
;	  0430	    local NODEb: ref NODEblock, Cost, Hops, Index;
;	  0431	    if ._SYNQH neqa 0                   ! If devices need attention
;	  0432	    then begin                          ! then
;	  0433	         MaxN = .I;                     !  save where we are
;	  0434	         IncN = .IncN + 1;              !  and give them a chance.
;	  0435	         $MCB_PAUSE(.Synchblk,.ROUTESaddr);
;	  0436	         return;
;	  0437	         end;
;	  0438	    I = .I + 1;				!  Increment node address
;	  0439	    Index = 0;                          !  Index for new line
;	  0440	    Hops = Infh;                        !  Minimum hops
;	  0441	    Cost = Infc;                        !  Minimum cost
;	  0442	    begin
;	  0443	    local CNT,X: ref vector;
;	  0444	    CNT = NLN + 1;                      ! Lines to do
;	  0445	    X = Hopcost[.I,0,.CNT - 1];         ! (Note: .CNT-1 optimizes code
;	  0446	    do                                  !        instead of NLN)
;	  0447	        begin                           ! Do this for all lines
;	  0448	        local Y;                        !  including the local.
;	  0449	        Y = .X[0];
;	  0450	        Y = .Y<Hop_P,Hop_S>;            ! Isolate hops over this line
;	  0451	        if .Hops gtr .Y then Hops = .Y; !  and get minimum.
;	  0452	        Y = .X[0];
;	  0453	        X = X[1];                       ! (get bliss-16 to auto-increment)%
;	  0454	        Y = .Y<Cost_P,Cost_S>;          ! Isolate cost over this line
;	  0455	        if .Cost gtr .Y                 !  and if this path is better
;	  0456	        then
;	  0457	            begin                       ! then
;	  0458	            Cost = .Y;                  ! save better cost
;	  0459	            Index = .CNT;               ! and better line.
;	  0460	            end;
;	  0461	        end
;	  0462	    while (CNT = .CNT - 1) neq 0;       ! (optimizes in bliss-16)
;	  0463	    end;
;	  0464	    if .Hops gtr .Maxh                  ! If too far away
;	  0465	    then begin
;	  0466	         Hops = Infh;                   ! then make unreachable
;	  0467	         Index = 0;                     ! with no line.
;	  0468	         end;
;	  0469	    if .Cost gtr .Maxc                  ! If too costly
;	  0470	    then begin
;	  0471	         Cost = Infc;                   ! then make unreachable
;	  0472	         Index = 0;                     ! with no line.
;	  0473	         end;
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page   8
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (3)

;	  0474	    if (Index = .Index - 1) geq 0       ! figure line number
;	  0475	    then begin
;	  0476	         Index = -.Index;               ! (while producing
;	  0477	         Index = .Index + NLN;          !  optimal bliss-16 code).
;	  0478	         end;
;	  0479	    begin
;	  0480	    local NODEb: ref NODEblock;
;	  0481	    NODEb = $XPT_GET_NODE_DB(.I);       ! Get the affected node.
;	  0482	    if .Phase2_node                     ! If phase II node,
;	  0483	    then Index = .OL;                   !  it is still reachable.
;	  0484	    if .Index geq 0                     ! If there is a path
;	  0485	    then                                ! then
;	  0486	        begin
;	  0487	        if not .Reach                   ! If reachability change
;	  0488	        then
;	  0489	            begin                       ! then
;	  0490	            Reach = TRUE;
;	  0491	            SIGNAL_REACHABILITY(.I,1);  ! log an event.
;	  0492	            end;
;	  0493	        end
;	  0494	    else
;	  0495	        begin
;	  0496	        if .Reach                       ! If reachability change
;	  0497	        then
;	  0498	            begin                       ! then
;	  0499	            Reach = FALSE;
;	  0500	            SIGNAL_REACHABILITY(.I,0);  ! log an event.
;	  0501	            end;
;	  0502	        end;
;	  0503	    if (.Minhop neq .Hops) or (.Mincost neq .Cost)      ! Changes in these
;	  0504	    then                                ! cause
;	  0505	        begin                           ! new routing messages
;	  0506	        Routing_changed = TRUE;         ! to be sent.
;	  0507	        Minhop = .Hops;                 ! Set new values.
;	  0508	        Mincost = .Cost;
;	  0509	        end;
;	  0510	    if not .Local_node
;	  0511	    then OL = .Index;                   ! Reachable through this line.
;	  0512	    end;
;	  0513	    end
;	  0514	while .I lssu NN;
;	  0515	
;	  0516	if .Routing_changed then SET_EACH_Srm_FLAG();
;	  0517	
;	  0518	MaxN = 0;
;	  0519	end;				!End of ROUTES


						.TITLE	XPTDEC
						.IDENT	/X01390/

						.GLOBL	.SYNQH, $XPECLN, CLN.RETRY, TERM.XPT
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page   9
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (3)

						.GLOBL	.CRDAT, KISAR6, $PAUSE, GTNODE


						.SBTTL	ROUTES
000000						.PSECT	$CODE$,  RO 

000000	004167  000000G			ROUTES::
					U.1:	JSR	R1,$SAVE5			;					0334
000004	162706  000006 				SUB	#6,SP
000010	016700  000002G				MOV	.CRDAT+2,R0			;					0420
000014	016066  000010  000004 			MOV	10(R0),4(SP)			;					0382
000022	016067  000006  000000G			MOV	6(R0),KISAR6			;					0422
000030	016066  000142  000002 			MOV	142(R0),2(SP)			; *,I					0423
000036	001004 					BNE	1$				;					0424
000040	005060  000144 				CLR	144(R0)				;					0426
000044	042710  000400 				BIC	#400,(R0)			;					0427
000050	005767  000000G			1$:	TST	.SYNQH				;					0431
000054	001420 					BEQ	2$
000056	016701  000002G				MOV	.CRDAT+2,R1			;					0432
000062	016661  000002  000142 			MOV	2(SP),142(R1)			; I,*					0433
000070	005261  000144 				INC	144(R1)				;					0434
000074	016100  000150 				MOV	150(R1),R0			;					0435
000100	016160  000146  000004 			MOV	146(R1),4(R0)
000106	010004 					MOV	R0,R4
000110	004767  000000G				JSR	PC,$PAUSE
000114	000573 					BR	18$				;					0432
000116	005266  000002 			2$:	INC	2(SP)				; I					0438
000122	005002 					CLR	R2				; INDEX					0439
000124	012704  000037 				MOV	#37,R4				; *,HOPS				0440
000130	012705  001777 				MOV	#1777,R5			; *,COST				0441
000134	016716  000002G				MOV	.CRDAT+2,(SP)			;					0444
000140	011600 					MOV	(SP),R0
000142	016003  000022 				MOV	22(R0),R3			; *,CNT
000146	005203 					INC	R3				; CNT
000150	016600  000002 				MOV	2(SP),R0			; I,*					0445
000154	005300 					DEC	R0
000156	010001 					MOV	R0,R1
000160	070103 					MUL	R3,R1				; CNT,*
000162	010100 					MOV	R1,R0
000164	006300 					ASL	R0
000166	066600  000004 				ADD	4(SP),R0
000172	010001 					MOV	R0,R1				; *,X
000174	011100 				3$:	MOV	(R1),R0				; X,Y					0449
000176	072027  177766 				ASH	#-12,R0				; *,Y					0450
000202	042700  177740 				BIC	#177740,R0			; *,Y
000206	020400 					CMP	R4,R0				; HOPS,Y				0451
000210	003401 					BLE	4$
000212	010004 					MOV	R0,R4				; Y,HOPS
000214	012100 				4$:	MOV	(R1)+,R0			; X,Y					0452
000216	042700  176000 				BIC	#176000,R0			; *,Y					0454
000222	020500 					CMP	R5,R0				; COST,Y				0455
000224	003402 					BLE	5$
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  10
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (3)

000226	010005 					MOV	R0,R5				; Y,COST				0458
000230	010302 					MOV	R3,R2				; CNT,INDEX				0459
000232	077320 				5$:	SOB	R3,3$				; CNT,*					0462
000234	011600 					MOV	(SP),R0				;					0464
000236	020460  000044 				CMP	R4,44(R0)			; HOPS,*
000242	003403 					BLE	6$
000244	012704  000037 				MOV	#37,R4				; *,HOPS				0466
000250	005002 					CLR	R2				; INDEX					0467
000252	011600 				6$:	MOV	(SP),R0				;					0469
000254	020560  000040 				CMP	R5,40(R0)			; COST,*
000260	003403 					BLE	7$
000262	012705  001777 				MOV	#1777,R5			; *,COST				0471
000266	005002 					CLR	R2				; INDEX					0472
000270	005302 				7$:	DEC	R2				; INDEX					0474
000272	100404 					BMI	8$
000274	005402 					NEG	R2				; INDEX					0476
000276	011600 					MOV	(SP),R0				;					0477
000300	066002  000022 				ADD	22(R0),R2			; *,INDEX
000304	016600  000002 			8$:	MOV	2(SP),R0			; I,*					0481
000310	004767  000000G				JSR	PC,GTNODE
000314	010003 					MOV	R0,R3				; *,NODEB
000316	032713  001000 				BIT	#1000,(R3)			; *,NODEB				0482
000322	001401 					BEQ	9$
000324	111302 					MOVB	(R3),R2				; NODEB,INDEX				0483
000326	005702 				9$:	TST	R2				; INDEX					0484
000330	002411 					BLT	10$
000332	005713 					TST	(R3)				; NODEB					0487
000334	100421 					BMI	12$
000336	052713  100000 				BIS	#100000,(R3)			; *,NODEB				0490
000342	016646  000002 				MOV	2(SP),-(SP)			; I,*					0491
000346	012746  000001 				MOV	#1,-(SP)
000352	000407 					BR	11$
000354	005713 				10$:	TST	(R3)				; NODEB					0496
000356	100010 					BPL	12$
000360	042713  100000 				BIC	#100000,(R3)			; *,NODEB				0499
000364	016646  000002 				MOV	2(SP),-(SP)			; I,*					0500
000370	005046 					CLR	-(SP)
000372	004767  000000V			11$:	JSR	PC,U.11
000376	022626 					CMP	(SP)+,(SP)+			;					0498
000400	026304  000004 			12$:	CMP	4(R3),R4			; *(NODEB),HOPS				0503
000404	001003 					BNE	13$
000406	026305  000006 				CMP	6(R3),R5			; *(NODEB),COST
000412	001407 					BEQ	14$
000414	052777  000400  000002G		13$:	BIS	#400,@.CRDAT+2			;					0506
000422	010463  000004 				MOV	R4,4(R3)			; HOPS,*(NODEB)				0507
000426	010563  000006 				MOV	R5,6(R3)			; COST,*(NODEB)				0508
000432	032713  000400 			14$:	BIT	#400,(R3)			; *,NODEB				0510
000436	001001 					BNE	15$
000440	110213 					MOVB	R2,(R3)				; INDEX,NODEB				0511
000442	016700  000002G			15$:	MOV	.CRDAT+2,R0			;					0514
000446	026660  000002  000016 			CMP	2(SP),16(R0)			; I,*
000454	103002 					BHIS	16$
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  11
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (3)

000456	000167  177366 				JMP	1$
000462	032710  000400 			16$:	BIT	#400,(R0)			; *,XPTDB				0516
000466	001402 					BEQ	17$
000470	004767  000000V				JSR	PC,U.10
000474	016700  000002G			17$:	MOV	.CRDAT+2,R0
000500	005060  000142 				CLR	142(R0)				;					0518
000504	062706  000006 			18$:	ADD	#6,SP				;					0334
000510	000207 					RTS	PC

; Routine Size:  165 words,	Routine Base:  $CODE$ + 0000
; Maximum stack depth per invocation:  12 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  12
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (4)

;	  0520	routine CHECK: novalue =
;	  0521	
;	  0522	!++
;	  0523	! FUNCTIONAL DESCRIPTION:
;	  0524	!
;	  0525	!  Detects any corruption of column 0 (transport users) in the Hop and
;	  0526	!  Cost matrices.
;	  0527	!
;	  0528	! FORMAL PARAMETERS
;	  0529	!
;	  0530	!	NONE.
;	  0531	!
;	  0532	! IMPLICIT INPUTS
;	  0533	!
;	  0534	!	Hop - 2x2 matrix giving the number of hops to a destination
;	  0535	!	      over a line.
;	  0536	!	Cost - 2x2 matrix giving the cost to a destination over a line.
;	  0537	!	User - vector indicating node addresses associated with transport
;	  0538	!	       users rather than remote systems
;	  0539	!	Infh - value used as "infinite" number of hops
;	  0540	!	Infc - value used as "infinite" cost
;	  0541	!
;	  0542	! ROUTINE VALUE:
;	  0543	! COMPLETION CODES:
;	  0544	!
;	  0545	!	NONE.
;	  0546	!
;	  0547	! SIDE EFFECTS:
;	  0548	!
;	  0549	!	If column 0 in either matrix is corrupted, terminate Transport.
;	  0550	!
;	  0551	!--
;	  0552	
;	  0553	begin
;	  0554	
;	  0555	require 'XPTSYM';
;	  0592	bind Hopcost = Hopcost_address: matrix;
;	  0593	bind Limit = NLN;
;	  0594	
;	  0595	MAP$(HOPcost_bias);
;	  0596	decr I from NN to 1 do begin
;	  0597	    local NODEb: ref NODEblock;
;	  0598	    local X;
;	  0599	    NODEb = $XPT_GET_NODE_DB(.I);       ! Address node data base entry
;	  0600	    X = .Hopcost[.I,0,Limit];		! Pick up entry from matrix
;	  0601	    if
;	  0602	    (if .Local_node then
;	  0603		if .X neq 0
;	  0604		    then TRUE
;	  0605		    else FALSE
;	  0606	    else
;	  0607		if .X neq ((Infh^Hop_P) or (Infc^Cost_P))
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  13
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (4)

;	  0608		    then TRUE
;	  0609		    else FALSE)
;	  0610	    then (BPT(XPT$_CHECK); CALL$L(TERM_XPT));
;	  0611	    end;
;	  0612	end;				!End of CHECK


						.SBTTL	CHECK
000000	004167  000000G			; CHECK
					U.2:	JSR	R1,$SAVE5			;					0520
000004	016700  000002G				MOV	.CRDAT+2,R0			;					0592
000010	016005  000010 				MOV	10(R0),R5			;					0553
000014	016004  000022 				MOV	22(R0),R4
000020	016067  000006  000000G			MOV	6(R0),KISAR6			;					0595
000026	016002  000016 				MOV	16(R0),R2			; *,I					0596
000032	003443 					BLE	5$
000034	010200 				1$:	MOV	R2,R0				; I,*					0599
000036	004767  000000G				JSR	PC,GTNODE
000042	010003 					MOV	R0,R3				; *,NODEB
000044	010200 					MOV	R2,R0				; I,*					0600
000046	005300 					DEC	R0
000050	010401 					MOV	R4,R1
000052	005201 					INC	R1
000054	070100 					MUL	R0,R1
000056	006301 					ASL	R1
000060	060501 					ADD	R5,R1
000062	011100 					MOV	(R1),R0				; *,X
000064	032713  000400 				BIT	#400,(R3)			; *,NODEB				0602
000070	001403 					BEQ	2$
000072	005700 					TST	R0				; X					0603
000074	001421 					BEQ	4$
000076	000403 					BR	3$
000100	020027  077777 			2$:	CMP	R0,#77777			; X,*					0607
000104	001415 					BEQ	4$
000106	012746  100014 			3$:	MOV	#-77764,-(SP)			;					0610
000112	012746  000001 				MOV	#1,-(SP)
000116	004767  000000G				JSR	PC,$IGNAL
000122	005046 					CLR	-(SP)
000124	012746  000000G				MOV	#TERM.XPT,-(SP)
000130	004767  000000G				JSR	PC,$CALL
000134	062706  000010 				ADD	#10,SP
000140	077243 				4$:	SOB	R2,1$				; I,*					0000
000142	000207 				5$:	RTS	PC				;					0520

; Routine Size:  50 words,	Routine Base:  $CODE$ + 0512
; Maximum stack depth per invocation:  11 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  14
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (5)

;	  0613	global routine LINEDN (CCB): CALL$ novalue =
;	  0614	
;	  0615	!++
;	  0616	! FUNCTIONAL DESCRIPTION:
;	  0617	!
;	  0618	!  Processes a "line down" event from Transport Initialization.
;	  0619	!
;	  0620	! FORMAL PARAMETERS
;	  0621	!
;	  0622	!	CCB[C_LIN] - Line number being declared down.
;	  0623	!
;	  0624	! IMPLICIT INPUTS
;	  0625	!
;	  0626	!	Hop,Cost,Infh,Infc
;	  0627	!
;	  0628	! ROUTINE VALUE:
;	  0629	! COMPLETION CODES:
;	  0630	!
;	  0631	!	NONE.
;	  0632	!
;	  0633	! SIDE EFFECTS:
;	  0634	!
;	  0635	!	Sets column LINE of Hop and Cost to "infinite";
;	  0636	!  recalculates routing.
;	  0637	!
;	  0638	!--
;	  0639	
;	  0640	begin
;	  0641	
;	  0642	local NODEb,LINEb;
;	  0643	require 'XPTSYM';
;	  0680	require 'MCBCOM';
;	  0714	bind Hopcost = Hopcost_address: matrix;
;	  0715	
;	  0716	Check();			!Make sure column 0 of the matrices is OK.
;	  0717	
;	  0718	LINEb = $XPT_GET_LINE_DB(.CCB[C_LIN]);
;	  0719	NODEb = $XPT_GET_NODE_DB(.Nid);
;	  0720	
;	  0721	Line_up = false;
;	  0722	Srm = false;
;	  0723	Send_hello = false;
;	  0724	Service_line = false;
;	  0725	Hello_clock = 0;
;	  0726	
;	  0727	decr I from NN to 1 do
;	  0728	    Hopcost[.I,.LINEnumber,NLN] =       ! Make routing impossible
;	  0729		((Infh^Hop_P) or (Infc^Cost_P));!  over the line
;	  0730	
;	  0731	if .Phase2_node
;	  0732	then begin                              ! Phase II node:
;	  0733	     CLN_RETRY(.LINEb);                 !  clean out the retry queue
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  15
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (5)

;	  0734	     $XPECLN(.Nid,0);                   !  send DC for each active link
;	  0735	     Reach = false;                     !  Cancel reachability
;	  0736	     Phase2_node = false;
;	  0737	     end;
;	  0738	
;	  0739	ROUTES();                               ! Recalculate the data bases
;	  0740	CCB[C_FNC] = FC_RCE;                    ! Send down
;	  0741	CCB[C_STS] = CS_SUC;                    !  "line down complete"
;	  0742	$MCB_SCHEDULE_CCB(.CCB);                !  indication
;	  0743	end;				!End of LINEDN


						.GLOBL	GTLINE, $SCHED


						.SBTTL	LINEDN
000000	024646 				LINEDN::
					U.3:	CMP	-(SP),-(SP)			;					0613
000002	016700  000002G				MOV	.CRDAT+2,R0			;					0714
000006	016003  000010 				MOV	10(R0),R3			;					0640
000012	004767  177616 				JSR	PC,U.2				;					0716
000016	016504  000002 				MOV	2(R5),R4			; CCB(.AP.),*				0718
000022	005000 					CLR	R0
000024	156400  000010 				BISB	10(R4),R0
000030	004767  000000G				JSR	PC,GTLINE
000034	010016 					MOV	R0,(SP)				; *,LINEB
000036	010001 					MOV	R0,R1				; LINEB,*				0719
000040	016100  000004 				MOV	4(R1),R0			; *(LINEB),*
000044	004767  000000G				JSR	PC,GTNODE
000050	010066  000002 				MOV	R0,2(SP)			; *,NODEB
000054	042776  100000  000000 			BIC	#100000,@0(SP)			; *,LINEB				0721
000062	042776  020000  000000 			BIC	#20000,@0(SP)			; *,LINEB				0722
000070	042776  010000  000000 			BIC	#10000,@0(SP)			; *,LINEB				0723
000076	042776  040000  000000 			BIC	#40000,@0(SP)			; *,LINEB				0724
000104	011600 					MOV	(SP),R0				; LINEB,*				0725
000106	005060  000044 				CLR	44(R0)				; *(LINEB)
000112	016700  000002G				MOV	.CRDAT+2,R0			;					0727
000116	010002 					MOV	R0,R2				; XPTDB,*				0728
000120	016000  000016 				MOV	16(R0),R0			; *,I					0727
000124	003421 					BLE	2$
000126	010001 				1$:	MOV	R0,R1				; I,*					0728
000130	005301 					DEC	R1
000132	016205  000022 				MOV	22(R2),R5
000136	005205 					INC	R5
000140	070501 					MUL	R1,R5
000142	005001 					CLR	R1
000144	011646 					MOV	(SP),-(SP)			; LINEB,*
000146	062716  000026 				ADD	#26,(SP)
000152	153601 					BISB	@(SP)+,R1
000154	060105 					ADD	R1,R5
000156	006305 					ASL	R5
000160	060305 					ADD	R3,R5
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  16
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (5)

000162	012715  077777 				MOV	#77777,(R5)
000166	077021 					SOB	R0,1$				; I,*					0000
000170	032776  001000  000002 		2$:	BIT	#1000,@2(SP)			; *,NODEB				0731
000176	001426 					BEQ	3$
000200	011646 					MOV	(SP),-(SP)			; LINEB,*				0733
000202	004767  000000G				JSR	PC,CLN.RETRY
000206	005016 					CLR	(SP)				;					0734
000210	016600  000002 				MOV	2(SP),R0			; LINEB,*
000214	016046  000004 				MOV	4(R0),-(SP)			; *(LINEB),*
000220	012746  000002 				MOV	#2,-(SP)
000224	012746  000000G				MOV	#$XPECLN,-(SP)
000230	004767  000000G				JSR	PC,$CALL
000234	022626 					CMP	(SP)+,(SP)+
000236	042776  100000  000006 			BIC	#100000,@6(SP)			; *,NODEB				0735
000244	042776  001000  000006 			BIC	#1000,@6(SP)			; *,NODEB				0736
000252	022626 					CMP	(SP)+,(SP)+			;					0732
000254	004767  176642 			3$:	JSR	PC,ROUTES			;					0739
000260	112764  000004  000012 			MOVB	#4,12(R4)			;					0740
000266	012764  000001  000014 			MOV	#1,14(R4)			;					0741
000274	004767  000000G				JSR	PC,$SCHED			;					0742
000300	022626 					CMP	(SP)+,(SP)+			;					0613
000302	000207 					RTS	PC

; Routine Size:  98 words,	Routine Base:  $CODE$ + 0656
; Maximum stack depth per invocation:  7 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  17
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (6)

;	  0744	global routine LINEUP (CCB): CALL$ novalue =
;	  0745	
;	  0746	!++
;	  0747	! FUNCTIONAL DESCRIPTION:
;	  0748	!
;	  0749	!  Processes a "line up" indication from Transport Initialization.
;	  0750	!
;	  0751	! FORMAL PARAMETERS
;	  0752	!
;	  0753	!	CCB[C_LIN] - line being declared up.
;	  0754	!
;	  0755	! IMPLICIT INPUTS
;	  0756	!
;	  0757	!	Hop,Cost,Nty,Lcv,Srm,Nid
;	  0758	!
;	  0759	! ROUTINE VALUE:
;	  0760	! COMPLETION CODES:
;	  0761	!
;	  0762	!	NONE.
;	  0763	!
;	  0764	! SIDE EFFECTS:
;	  0765	!
;	  0766	!	Initializes column J of the routing data base;
;	  0767	!  recalculates routing.
;	  0768	!
;	  0769	!
;	  0770	!--
;	  0771	
;	  0772	begin
;	  0773	map CCB: ref block field (C_XPT_fields);
;	  0774	local NODEb,LINEb;
;	  0775	require 'XPTSYM';
;	  0812	
;	  0813	CHECK();			!Make sure column 0 of matrices is OK
;	  0814	
;	  0815	LINEb = $XPT_GET_LINE_DB(.CCB[C_LIN]);  ! Address line data base entry
;	  0816	
;	  0817	!
;	  0818	!  If the line has gone down again, ignore line up
;	  0819	!
;	  0820	
;	  0821	if .LINEstate eql TC
;	  0822	then begin
;	  0823	     !
;	  0824	     !  Otherwise - process the line up
;	  0825	     !
;	  0826	     NODEb = $XPT_GET_NODE_DB(.Nid);
;	  0827	     Phase2_node = false;
;	  0828	
;	  0829	     selectone .Nty of
;	  0830	         set
;	  0831	         [PhTwo]:                       ! Adjacent node is Phase II:
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  18
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (6)

;	  0832	             begin                      !  Don't include in routing data base.
;	  0833	             Phase2_node = true;        !  It can talk to Phase II nodes.
;	  0834	             Reach = TRUE;              !  Accessable
;	  0835	             OL = .LINEnumber;          !   over this line
;	  0836	             end;
;	  0837	         [Full]:
;	  0838	             Send_hello = true;
;	  0839	         [otherwise]:
;	  0840	             begin                      ! Adjacent node is not full routing:
;	  0841	             bind Hopcost = Hopcost_address: matrix;
;	  0842	
;	  0843	             if .Lcv gtr 0              !  If the cost is positive then
;	  0844	             then                       !  that's the cost to the adjacent node
;	  0845	                 Hopcost[.Nid,.LINEnumber,NLN] = (.Lcv^Cost_P + 1^Hop_P)
;	  0846	             else                       !  otherwise
;	  0847	                 CALL$L(TERM_XPT);      !   corruption!
;	  0848	
;	  0849	             if .Nty eql Small
;	  0850	             then Send_hello = true;
;	  0851	             end;
;	  0852	         tes;
;	  0853	
;	  0854	     SET_EACH_Srm_FLAG();
;	  0855	     Hello_clock = .Hello_timer;
;	  0856	     Line_up = true;
;	  0857	
;	  0858	     $NM_LOG_BEGIN();
;	  0859	     PARAMETER_CM(3,1);			! Log a
;	  0860	     PARAMETER_DU_2(,Nid);              !  "line up"
;	  0861	     $NM_LOG_END(4^6+$XPT$E_LUP,.NMXid);
;	  0862	
;	  0863	     ROUTES();				! Recalculate routing data base
;	  0864	     end;
;	  0865	
;	  0866	CCB[C_FNC] = FC_RCE;			!Send "line up
;	  0867	CCB[C_STS] = CS_SUC;			!  complete" to
;	  0868	$MCB_SCHEDULE_CCB(.CCB);                !  Transport Line Interface
;	  0869	
;	  0870	end;				!End of LINEUP


						.GLOBL	$NLBEG, $DPCM, $TPDU2, $NLEND


						.SBTTL	LINEUP
000000	005746 				LINEUP::
					U.4:	TST	-(SP)				;					0744
000002	004767  177322 				JSR	PC,U.2				;					0813
000006	016504  000002 				MOV	2(R5),R4			; CCB(.AP.),*				0815
000012	005000 					CLR	R0
000014	156400  000010 				BISB	10(R4),R0
000020	004767  000000G				JSR	PC,GTLINE
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  19
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (6)

000024	010016 					MOV	R0,(SP)				; *,LINEB
000026	121027  000007 				CMPB	(R0),#7				; LINEB,*				0821
000032	001137 					BNE	6$
000034	010001 					MOV	R0,R1				; LINEB,*				0826
000036	016100  000004 				MOV	4(R1),R0			; *(LINEB),*
000042	004767  000000G				JSR	PC,GTNODE
000046	042710  001000 				BIC	#1000,(R0)			; *,NODEB				0827
000052	011601 					MOV	(SP),R1				; LINEB,*				0829
000054	116105  000002 				MOVB	2(R1),R5			; *(LINEB),*
000060	020527  000004 				CMP	R5,#4
000064	001005 					BNE	1$
000066	052710  101000 				BIS	#101000,(R0)			; *,NODEB				0834
000072	116110  000026 				MOVB	26(R1),(R0)			; *(LINEB),NODEB			0835
000076	000453 					BR	5$				;					0829
000100	020527  000002 			1$:	CMP	R5,#2
000104	001445 					BEQ	4$				;					0838
000106	016702  000002G				MOV	.CRDAT+2,R2			;					0841
000112	011600 					MOV	(SP),R0				; LINEB,*				0843
000114	016003  000020 				MOV	20(R0),R3			; *(LINEB),*
000120	003426 					BLE	2$
000122	010001 					MOV	R0,R1				; LINEB,*				0845
000124	016100  000004 				MOV	4(R1),R0			; *(LINEB),*
000130	005300 					DEC	R0
000132	010201 					MOV	R2,R1				; XPTDB,*
000134	016101  000022 				MOV	22(R1),R1
000140	005201 					INC	R1
000142	070100 					MUL	R0,R1
000144	005000 					CLR	R0
000146	011646 					MOV	(SP),-(SP)			; LINEB,*
000150	062716  000026 				ADD	#26,(SP)
000154	153600 					BISB	@(SP)+,R0
000156	060001 					ADD	R0,R1
000160	006301 					ASL	R1
000162	066201  000010 				ADD	10(R2),R1
000166	010311 					MOV	R3,(R1)
000170	062711  002000 				ADD	#2000,(R1)
000174	000406 					BR	3$				;					0843
000176	005046 				2$:	CLR	-(SP)				;					0847
000200	012746  000000G				MOV	#TERM.XPT,-(SP)
000204	004767  000000G				JSR	PC,$CALL
000210	022626 					CMP	(SP)+,(SP)+
000212	020527  000003 			3$:	CMP	R5,#3				;					0849
000216	001003 					BNE	5$
000220	052776  010000  000000 		4$:	BIS	#10000,@0(SP)			; *,LINEB				0850
000226	004767  000000V			5$:	JSR	PC,U.10				;					0854
000232	011600 					MOV	(SP),R0				; LINEB,*				0855
000234	010001 					MOV	R0,R1				; LINEB,*
000236	016160  000022  000044 			MOV	22(R1),44(R0)			; *(LINEB),*(LINEB)
000244	052710  100000 				BIS	#100000,(R0)			; *,LINEB				0856
000250	004767  000000G				JSR	PC,$NLBEG			;					0858
000254	012746  000003 				MOV	#3,-(SP)			;					0859
000260	012700  000001 				MOV	#1,R0
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  20
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (6)

000264	004767  000000G				JSR	PC,$DPCM
000270	016601  000002 				MOV	2(SP),R1			; LINEB,*				0860
000274	016100  000004 				MOV	4(R1),R0			; *(LINEB),*
000300	004767  000000G				JSR	PC,$TPDU2
000304	012700  000412 				MOV	#412,R0				;					0861
000310	016602  000002 				MOV	2(SP),R2			; LINEB,*
000314	016201  000034 				MOV	34(R2),R1			; *(LINEB),*
000320	004767  000000G				JSR	PC,$NLEND
000324	004767  176266 				JSR	PC,ROUTES			;					0863
000330	005726 					TST	(SP)+				;					0822
000332	112764  000004  000012 		6$:	MOVB	#4,12(R4)			;					0866
000340	012764  000001  000014 			MOV	#1,14(R4)			;					0867
000346	004767  000000G				JSR	PC,$SCHED			;					0868
000352	005726 					TST	(SP)+				;					0744
000354	000207 					RTS	PC

; Routine Size:  119 words,	Routine Base:  $CODE$ + 1162
; Maximum stack depth per invocation:  4 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  21
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (7)

;	  0871	global routine RCVROU (CCB): CALL$ novalue =
;	  0872	
;	  0873	!++
;	  0874	! FUNCTIONAL DESCRIPTION:
;	  0875	!
;	  0876	!  Processes a received routing message.
;	  0877	!
;	  0878	! FORMAL PARAMETERS
;	  0879	!
;	  0880	!	CCB[C_LIN] - line message was received on
;	  0881	!	CCB[C_BIAS] - descriptor for message
;	  0882	!
;	  0883	! IMPLICIT INPUTS
;	  0884	!
;	  0885	!	Hop,Cost,Lcv
;	  0886	!
;	  0887	! ROUTINE VALUE:
;	  0888	! COMPLETION CODES:
;	  0889	!
;	  0890	!	NONE.
;	  0891	!
;	  0892	! SIDE EFFECTS:
;	  0893	!
;	  0894	!	Updates routing data base from routing message;
;	  0895	!  recalculates routing
;	  0896	!
;	  0897	!--
;	  0898	
;	  0899	begin
;	  0900	
;	  0901	local LINEb;
;	  0902	require 'XPTSYM';
;	  0939	require 'MCBCOM';
;	  0973	bind Hopcost = Hopcost_address: matrix;
;	  0974	local BUFPTR,BUFLEN,NO_NODES;
;	  0975	pointer PTR;
;	  0976	
;	  0977	
;	  0978	!
;	  0979	!  Validate data base
;	  0980	!
;	  0981	
;	  0982	CHECK();					!Make sure column 0 is OK
;	  0983	
;	  0984	!
;	  0985	!  If the circuit is down, ignore the message
;	  0986	!
;	  0987	
;	  0988	LINEb = $XPT_GET_LINE_DB(.CCB[C_LIN]);  ! Address line data base entry
;	  0989	
;	  0990	if .LINEstate eql RU then begin			
;	  0991	
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  22
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (7)

;	  0992	!
;	  0993	!  Validate the message
;	  0994	!
;	  0995	
;	  0996	    MAPBUF(.CCB,BUFPTR,BUFLEN);			!Map to and address buffer
;	  0997	    if .Lcv lss 0 then				!Line cost negative -
;	  0998		CALL$L(TERM_XPT)			!  bring down transport
;	  0999	    else if VALID_BUFFER(.CCB,.BUFPTR,.BUFLEN)	!Make sure buffer is good
;	  1000	    then begin
;	  1001	
;	  1002	!
;	  1003	!  Copy message fields into routing data base
;	  1004	!
;	  1005	
;	  1006	         begin                          ! Get number of nodes to process
;	  1007	         local ADR;
;	  1008	         bind MXA = NO_NODES: ref vector;
;	  1009	         PTR = ch$plus(.BUFPTR,1);      ! Bump past control header
;	  1010	         ADR = getw(PTR);
;	  1011	
;	  1012	         if (MXA = .NODEmaximum_address_vector) neqa 0
;	  1013	         then begin
;	  1014	              if (MXA = .MXA [.ADR - 1]) neq 0
;	  1015	              then begin
;	  1016	                   if .MXA gtr NN
;	  1017	                   then MXA = NN;
;	  1018	                   end
;	  1019	              else MXA = NN;
;	  1020	              end
;	  1021	         else MXA = NN;
;	  1022	
;	  1023	         NO_NODES = minu (.MXA, (.BUFLEN-5)^-1);
;	  1024	         end;
;	  1025	         incr I from 1 to NN do
;	  1026	            begin
;	  1027	            local TEMP,COSTI;
;	  1028	            bind HOPI = TEMP;           ! (for optimization)
;	  1029	            TEMP = ((Infh^Hop_P) or (Infc^Cost_P)); ! assume not accessable.
;	  1030	            if .I leq .NO_NODES
;	  1031	            then begin
;	  1032	                 MAP$(.CCB[C_BIAS]);    ! Map in the buffer
;	  1033	                 TEMP = getw(PTR);      ! Pick up next routing field
;	  1034	                 COSTI = .TEMP<Cost_P,Cost_S>;  !  COST subfield
;	  1035	                 HOPI = .TEMP<Hop_P,Hop_S>;     !  HOP subfield
;	  1036	                 COSTI = .COSTI+.Lcv;           ! Add in our cost
;	  1037	                 HOPI = .HOPI+1;                !  and one more hop.
;	  1038	                 if .COSTI gtru Infc            ! Top off
;	  1039	                 then COSTI = Infc;
;	  1040	                 if .HOPI gtru Infh             !  if necessary.
;	  1041	                 then HOPI = Infh;
;	  1042	                 COSTI = .COSTI^Cost_P;         ! Position
;	  1043	                 HOPI = .HOPI^Hop_P;            ! and
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  23
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (7)

;	  1044	                 TEMP = .HOPI;                  ! reconstruct.
;	  1045	                 TEMP = .TEMP+.COSTI;
;	  1046	                 end;
;	  1047	            MAP$(HOPcost_bias);                 ! Map in the Hop/Cost matrix
;	  1048	            Hopcost[.I,.LINEnumber,NLN] = .TEMP;        ! and update it
;	  1049	            end;
;	  1050		 ROUTES();				!Recalculate routing
;	  1051		 end;
;	  1052	    end;
;	  1053	
;	  1054	!
;	  1055	!  Clean up the accounting and return the buffer
;	  1056	!
;	  1057	
;	  1058	INPUTcount = .INPUTcount - 1;           ! Decrement outstanding buffers
;	  1059	DLLquota = .DLLquota + 1;               !  and increment global quota
;	  1060	CCB[C_FNC] = FC_RCE;                    ! Return buffer
;	  1061	$MCB_SCHEDULE_CCB(.CCB);                !  to TLI
;	  1062	end;				!End of RCVROU


						.SBTTL	RCVROU
000000	162706  000016 			RCVROU::
					U.5:	SUB	#16,SP				;					0871
000004	016700  000002G				MOV	.CRDAT+2,R0			;					0973
000010	016066  000010  000012 			MOV	10(R0),12(SP)			;					0899
000016	004767  176730 				JSR	PC,U.2				;					0982
000022	016566  000002  000004 			MOV	2(R5),4(SP)			; CCB(.AP.),*				0988
000030	005000 					CLR	R0
000032	016601  000004 				MOV	4(SP),R1
000036	156100  000010 				BISB	10(R1),R0
000042	004767  000000G				JSR	PC,GTLINE
000046	010066  000010 				MOV	R0,10(SP)			; *,LINEB
000052	121027  000010 				CMPB	(R0),#10			; LINEB,*				0990
000056	001025 					BNE	1$
000060	016600  000004 				MOV	4(SP),R0			;					0996
000064	016067  000016  000000G			MOV	16(R0),KISAR6
000072	016001  000020 				MOV	20(R0),R1			; *,BUFPTR
000076	016005  000022 				MOV	22(R0),R5			; *,BUFLEN
000102	016600  000010 				MOV	10(SP),R0			; LINEB,*				0997
000106	016066  000020  000006 			MOV	20(R0),6(SP)			; *(LINEB),*
000114	002007 					BGE	2$
000116	005046 					CLR	-(SP)				;					0998
000120	012746  000000G				MOV	#TERM.XPT,-(SP)
000124	004767  000000G				JSR	PC,$CALL
000130	022626 					CMP	(SP)+,(SP)+
000132	000572 				1$:	BR	12$				;					0997
000134	016646  000004 			2$:	MOV	4(SP),-(SP)			;					0999
000140	010146 					MOV	R1,-(SP)			; BUFPTR,*
000142	010546 					MOV	R5,-(SP)			; BUFLEN,*
000144	004767  000000V				JSR	PC,U.12
000150	062706  000006 				ADD	#6,SP
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  24
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (7)

000154	006000 					ROR	R0
000156	103160 					BCC	12$
000160	010104 					MOV	R1,R4				; BUFPTR,PTR				1009
000162	005204 					INC	R4				; PTR					1010
000164	112466  000014 				MOVB	(R4)+,14(SP)			; PTR,X
000170	112466  000015 				MOVB	(R4)+,15(SP)			; PTR,X
000174	016600  000014 				MOV	14(SP),R0			; X,ADR
000200	016716  000002G				MOV	.CRDAT+2,(SP)			;					1012
000204	012701  000016 				MOV	#16,R1				;					1016
000210	061601 					ADD	(SP),R1
000212	010103 					MOV	R1,R3
000214	011602 					MOV	(SP),R2				;					1012
000216	016201  000024 				MOV	24(R2),R1			; *,MXA
000222	001411 					BEQ	3$
000224	006300 					ASL	R0				;					1014
000226	060100 					ADD	R1,R0				; MXA,*
000230	016001  177776 				MOV	-2(R0),R1			; *,MXA
000234	001404 					BEQ	3$
000236	011302 					MOV	(R3),R2				;					1016
000240	020102 					CMP	R1,R2				; MXA,*
000242	003403 					BLE	5$
000244	000401 					BR	4$				;					1017
000246	011302 				3$:	MOV	(R3),R2				;					1021
000250	010201 				4$:	MOV	R2,R1				; *,MXA
000252	162705  000005 			5$:	SUB	#5,R5				; *,BUFLEN				1023
000256	006205 					ASR	R5
000260	010100 					MOV	R1,R0				; MXA,*
000262	020005 					CMP	R0,R5
000264	101401 					BLOS	6$
000266	010500 					MOV	R5,R0
000270	010001 				6$:	MOV	R0,R1				; *,NO.NODES
000272	005066  000002 				CLR	2(SP)				; I					1025
000276	000501 					BR	11$
000300	012700  077777 			7$:	MOV	#77777,R0			; *,TEMP				1029
000304	026601  000002 				CMP	2(SP),R1			; I,NO.NODES				1030
000310	003044 					BGT	10$
000312	016603  000004 				MOV	4(SP),R3			;					1032
000316	016367  000016  000000G			MOV	16(R3),KISAR6
000324	112466  000014 				MOVB	(R4)+,14(SP)			; PTR,X					1033
000330	112466  000015 				MOVB	(R4)+,15(SP)			; PTR,X
000334	016600  000014 				MOV	14(SP),R0			; X,TEMP
000340	010005 					MOV	R0,R5				; TEMP,COSTI				1034
000342	042705  176000 				BIC	#176000,R5			; *,COSTI
000346	072027  177766 				ASH	#-12,R0				; *,HOPI				1035
000352	042700  177740 				BIC	#177740,R0			; *,HOPI
000356	066605  000006 				ADD	6(SP),R5			; *,COSTI				1036
000362	005200 					INC	R0				; HOPI					1037
000364	020527  001777 				CMP	R5,#1777			; COSTI,*				1038
000370	101402 					BLOS	8$
000372	012705  001777 				MOV	#1777,R5			; *,COSTI				1039
000376	020027  000037 			8$:	CMP	R0,#37				; HOPI,*				1040
000402	101402 					BLOS	9$
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  25
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (7)

000404	012700  000037 				MOV	#37,R0				; *,HOPI				1041
000410	010003 				9$:	MOV	R0,R3				; HOPI,*				1043
000412	072327  000012 				ASH	#12,R3
000416	010300 					MOV	R3,R0				; *,HOPI
000420	060500 					ADD	R5,R0				; COSTI,TEMP				1045
000422	011603 				10$:	MOV	(SP),R3				;					1047
000424	016367  000006  000000G			MOV	6(R3),KISAR6
000432	016603  000002 				MOV	2(SP),R3			; I,*					1048
000436	005303 					DEC	R3
000440	011646 					MOV	(SP),-(SP)
000442	062716  000022 				ADD	#22,(SP)
000446	013605 					MOV	@(SP)+,R5
000450	005205 					INC	R5
000452	070503 					MUL	R3,R5
000454	005003 					CLR	R3
000456	016646  000010 				MOV	10(SP),-(SP)			; LINEB,*
000462	062716  000026 				ADD	#26,(SP)
000466	153603 					BISB	@(SP)+,R3
000470	060305 					ADD	R3,R5
000472	006305 					ASL	R5
000474	066605  000012 				ADD	12(SP),R5
000500	010015 					MOV	R0,(R5)				; TEMP,*
000502	005266  000002 			11$:	INC	2(SP)				; I					1025
000506	026602  000002 				CMP	2(SP),R2			; I,*
000512	003672 					BLE	7$
000514	004767  175520 				JSR	PC,ROUTES			;					1050
000520	016601  000010 			12$:	MOV	10(SP),R1			; LINEB,*				1058
000524	105361  000043 				DECB	43(R1)				; *(LINEB)
000530	016700  000002G				MOV	.CRDAT+2,R0
000534	105260  000035 				INCB	35(R0)				;					1059
000540	016600  000004 				MOV	4(SP),R0			;					1060
000544	112760  000004  000012 			MOVB	#4,12(R0)
000552	010004 					MOV	R0,R4				;					1061
000554	004767  000000G				JSR	PC,$SCHED
000560	062706  000016 				ADD	#16,SP				;					0871
000564	000207 					RTS	PC

; Routine Size:  187 words,	Routine Base:  $CODE$ + 1540
; Maximum stack depth per invocation:  11 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  26
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (8)

;	  1063	global routine COSTCH (LINE,COSTJ): CALL$ novalue =
;	  1064	
;	  1065	!++
;	  1066	! FUNCTIONAL DESCRIPTION:
;	  1067	!
;	  1068	!  Processes a cost change for a line
;	  1069	!
;	  1070	! FORMAL PARAMETERS
;	  1071	!
;	  1072	!	LINE	Line cost change is for
;	  1073	!	COSTJ	New cost for line
;	  1074	!
;	  1075	! IMPLICIT INPUTS
;	  1076	!
;	  1077	!	Cost, Lcv
;	  1078	!
;	  1079	! ROUTINE VALUE:
;	  1080	! COMPLETION CODES:
;	  1081	!
;	  1082	!	NONE.
;	  1083	!
;	  1084	! SIDE EFFECTS:
;	  1085	!
;	  1086	!	Updates Cost and Lcv; recalculates routing.
;	  1087	!
;	  1088	!--
;	  1089	
;	  1090	begin
;	  1091	
;	  1092	local LINEb;
;	  1093	require 'XPTSYM';
;	  1130	bind Hopcost = Hopcost_address: matrix;
;	  1131	
;	  1132	!
;	  1133	!  Validate new and old costs for line
;	  1134	!
;	  1135	
;	  1136	LINEb = $XPT_GET_LINE_DB(.LINE);        ! Address line data base entry
;	  1137	if (.COSTJ leq 0) or (.Lcv leq 0) then
;	  1138	    CALL$L(TERM_XPT)
;	  1139	
;	  1140	!
;	  1141	!  Update data base for cost change
;	  1142	!
;	  1143	
;	  1144	else begin
;	  1145	    bind DIF = .COSTJ - .Lcv;
;	  1146	    Lcv = .COSTJ;
;	  1147	    MAP$(HOPcost_bias);
;	  1148	    decr I from NN to 1 do			!Update Cost matrix as well
;	  1149		(Hopcost[.I,.LINE,NLN])<Cost_P,Cost_S> =
;	  1150		    .(Hopcost[.I,.LINE,NLN])<Cost_P,Cost_S> + DIF;
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  27
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (8)

;	  1151	    end;
;	  1152	
;	  1153	!
;	  1154	!  Make sure timer goes off to recalculate routes
;	  1155	!
;	  1156	
;	  1157	Routing_clock = 1;
;	  1158	
;	  1159	end;				!End of COSTCH


						.SBTTL	COSTCH
000000	016700  000002G			COSTCH::
					U.6:	MOV	.CRDAT+2,R0			;					1130
000004	016046  000010 				MOV	10(R0),-(SP)			;					1090
000010	016500  000002 				MOV	2(R5),R0			; LINE(.AP.),*				1136
000014	004767  000000G				JSR	PC,GTLINE
000020	010001 					MOV	R0,R1				; *,LINEB
000022	016502  000004 				MOV	4(R5),R2			; COSTJ(.AP.),*				1137
000026	003403 					BLE	1$
000030	005761  000020 				TST	20(R1)				; *(LINEB)
000034	003007 					BGT	2$
000036	005046 				1$:	CLR	-(SP)				;					1138
000040	012746  000000G				MOV	#TERM.XPT,-(SP)
000044	004767  000000G				JSR	PC,$CALL
000050	022626 					CMP	(SP)+,(SP)+
000052	000441 					BR	4$				;					1137
000054	010204 				2$:	MOV	R2,R4				;					1145
000056	166104  000020 				SUB	20(R1),R4			; *(LINEB),*
000062	010261  000020 				MOV	R2,20(R1)			; *,*(LINEB)				1146
000066	016703  000002G				MOV	.CRDAT+2,R3			;					1147
000072	016367  000006  000000G			MOV	6(R3),KISAR6
000100	016300  000016 				MOV	16(R3),R0			; *,I					1148
000104	003424 					BLE	4$
000106	010002 				3$:	MOV	R0,R2				; I,*					1149
000110	005302 					DEC	R2
000112	016301  000022 				MOV	22(R3),R1
000116	005201 					INC	R1
000120	070102 					MUL	R2,R1
000122	066501  000002 				ADD	2(R5),R1			; LINE(.AP.),*
000126	006301 					ASL	R1
000130	061601 					ADD	(SP),R1
000132	011102 					MOV	(R1),R2				;					1150
000134	042702  176000 				BIC	#176000,R2
000140	060402 					ADD	R4,R2
000142	042702  176000 				BIC	#176000,R2
000146	042711  001777 				BIC	#1777,(R1)
000152	050211 					BIS	R2,(R1)
000154	077024 					SOB	R0,3$				; I,*					0000
000156	016700  000002G			4$:	MOV	.CRDAT+2,R0			;					1151
000162	012760  000001  000072 			MOV	#1,72(R0)			;					1157
000170	005726 					TST	(SP)+				;					1063
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  28
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (8)

000172	000207 					RTS	PC

; Routine Size:  62 words,	Routine Base:  $CODE$ + 2326
; Maximum stack depth per invocation:  4 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  29
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (9)

;	  1160	global routine OPENT (CCB): CALL$ novalue =
;	  1161	
;	  1162	!++
;	  1163	! FUNCTIONAL DESCRIPTION:
;	  1164	!
;	  1165	!  Opens a transport port to identify a local transport user.
;	  1166	!
;	  1167	! FORMAL PARAMETERS
;	  1168	!
;	  1169	!	CCB	Function CCB for the open.
;	  1170	!
;	  1171	! IMPLICIT INPUTS
;	  1172	!
;	  1173	!	User,Hop,Cost
;	  1174	!
;	  1175	! ROUTINE VALUE: Acceptance or rejection of the open
;	  1176	! COMPLETION CODES:
;	  1177	!
;	  1178	!	TRUE - Open accepted.
;	  1179	!	FALSE - Open rejected.
;	  1180	!
;	  1181	! SIDE EFFECTS:
;	  1182	!
;	  1183	!	Updates User,Hop and Cost; recalculates routing.
;	  1184	!
;	  1185	!--
;	  1186	
;	  1187	begin
;	  1188	map CCB: ref block field (C_FIELDS);
;	  1189	local NODEb;
;	  1190	require 'XPTSYM';
;	  1227	bind Hopcost = Hopcost_address: matrix;
;	  1228	
;	  1229	!
;	  1230	!  Validate routing data base
;	  1231	!
;	  1232	
;	  1233	CHECK();
;	  1234	NODEb = $XPT_GET_NODE_DB(.CCB[C_PRM1]); ! Address node data base entry
;	  1235	
;	  1236	if .Local_node                          ! Address already in use -
;	  1237	then return SIGNAL_STOP (CE_ERR);       !  reject request
;	  1238	
;	  1239	!
;	  1240	!  Update data base entries for this user
;	  1241	!
;	  1242	
;	  1243	Local_node = TRUE;
;	  1244	User = .CCB[C_PIX];                     ! Save process ID for user
;	  1245	Hopcost[.CCB[C_PRM1],0,NLN] = 0;        ! Free to get to local user
;	  1246	ROUTES();                               ! Recalculate routing
;	  1247	CCB [C_STS] = CS_SUC;
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  30
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (9)

;	  1248	
;	  1249	!
;	  1250	!  Terminate function CCB
;	  1251	!
;	  1252	
;	  1253	CCB[C_FNC] = FC_CCP;
;	  1254	$MCB_SCHEDULE_CCB(.CCB);
;	  1255	end;				!End of OPENT


						.SBTTL	OPENT
000000	016700  000002G			OPENT::
					U.7:	MOV	.CRDAT+2,R0			;					1227
000004	016002  000010 				MOV	10(R0),R2			;					1187
000010	004767  175754 				JSR	PC,U.2				;					1233
000014	016504  000002 				MOV	2(R5),R4			; CCB(.AP.),*				1234
000020	016400  000024 				MOV	24(R4),R0
000024	004767  000000G				JSR	PC,GTNODE
000030	010001 					MOV	R0,R1				; *,NODEB
000032	032711  000400 				BIT	#400,(R1)			; *,NODEB				1236
000036	001410 					BEQ	1$
000040	012746  177760 				MOV	#-20,-(SP)			;					1237
000044	012746  000001 				MOV	#1,-(SP)
000050	004767  000000G				JSR	PC,$STOP
000054	022626 					CMP	(SP)+,(SP)+
000056	000207 					RTS	PC
000060	052711  000400 			1$:	BIS	#400,(R1)			; *,NODEB				1243
000064	116411  000011 				MOVB	11(R4),(R1)			; *,NODEB				1244
000070	016401  000024 				MOV	24(R4),R1			;					1245
000074	005301 					DEC	R1
000076	016700  000002G				MOV	.CRDAT+2,R0
000102	016005  000022 				MOV	22(R0),R5
000106	005205 					INC	R5
000110	070501 					MUL	R1,R5
000112	006305 					ASL	R5
000114	060205 					ADD	R2,R5
000116	005015 					CLR	(R5)
000120	004767  175132 				JSR	PC,ROUTES			;					1246
000124	012764  000001  000014 			MOV	#1,14(R4)			;					1247
000132	112764  000022  000012 			MOVB	#22,12(R4)			;					1253
000140	004767  000000G				JSR	PC,$SCHED			;					1254
000144	000207 					RTS	PC				;					1160

; Routine Size:  51 words,	Routine Base:  $CODE$ + 2522
; Maximum stack depth per invocation:  3 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  31
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (10)

;	  1256	global routine CLOSET (CCB): CALL$ novalue =
;	  1257	
;	  1258	!++
;	  1259	! FUNCTIONAL DESCRIPTION:
;	  1260	!
;	  1261	!  Processes close of a port for a transport user.
;	  1262	!
;	  1263	! FORMAL PARAMETERS
;	  1264	!
;	  1265	!	CCB	Function CCB for the close.
;	  1266	!
;	  1267	! IMPLICIT INPUTS
;	  1268	!
;	  1269	!	User,Hop,Cost
;	  1270	!
;	  1271	! ROUTINE VALUE:
;	  1272	! COMPLETION CODES:
;	  1273	!
;	  1274	!	NONE.
;	  1275	!
;	  1276	! SIDE EFFECTS:
;	  1277	!
;	  1278	!	Updates User,Hop,Cost; recalculates routing.
;	  1279	!
;	  1280	!--
;	  1281	
;	  1282	begin
;	  1283	
;	  1284	local NODEb;
;	  1285	require 'XPTSYM';
;	  1322	require 'MCBCOM';
;	  1356	bind Hopcost = Hopcost_address: matrix;
;	  1357	local RET;
;	  1358	
;	  1359	!
;	  1360	!  Validate routing data base
;	  1361	!
;	  1362	
;	  1363	CHECK();
;	  1364	NODEb = $XPT_GET_NODE_DB(.CCB[C_PRM1]); ! Address node data base entry
;	  1365	
;	  1366	if not .Local_node                      ! Continue only if port is local
;	  1367	then return SIGNAL_STOP (CE_ERR);       ! Invalid node address - abort function
;	  1368	
;	  1369	!
;	  1370	!  Update routing data base
;	  1371	!
;	  1372	
;	  1373	Local_node = FALSE;
;	  1374	User = 0;
;	  1375	Hopcost[.CCB[C_PRM1],0,NLN] =           ! Can't get there
;	  1376	    ((Infh^Hop_P) or (Infc^Cost_P));    !  from here
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  32
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (10)

;	  1377	ROUTES();                               ! Recalculate routing
;	  1378	CCB [C_STS] = CS_SUC;
;	  1379	
;	  1380	!
;	  1381	!  Terminate function CCB
;	  1382	!
;	  1383	
;	  1384	CCB[C_FNC] = FC_CCP;
;	  1385	$MCB_SCHEDULE_CCB(.CCB);
;	  1386	end;				!End of CLOSET


						.SBTTL	CLOSET
000000	016700  000002G			CLOSET::
					U.8:	MOV	.CRDAT+2,R0			;					1356
000004	016002  000010 				MOV	10(R0),R2			;					1282
000010	004767  175606 				JSR	PC,U.2				;					1363
000014	016504  000002 				MOV	2(R5),R4			; CCB(.AP.),*				1364
000020	016400  000024 				MOV	24(R4),R0
000024	004767  000000G				JSR	PC,GTNODE
000030	010001 					MOV	R0,R1				; *,NODEB
000032	032711  000400 				BIT	#400,(R1)			; *,NODEB				1366
000036	001010 					BNE	1$
000040	012746  177760 				MOV	#-20,-(SP)			;					1367
000044	012746  000001 				MOV	#1,-(SP)
000050	004767  000000G				JSR	PC,$STOP
000054	022626 					CMP	(SP)+,(SP)+
000056	000207 					RTS	PC
000060	042711  000400 			1$:	BIC	#400,(R1)			; *,NODEB				1373
000064	105011 					CLRB	(R1)				; NODEB					1374
000066	016401  000024 				MOV	24(R4),R1			;					1375
000072	005301 					DEC	R1
000074	016700  000002G				MOV	.CRDAT+2,R0
000100	016005  000022 				MOV	22(R0),R5
000104	005205 					INC	R5
000106	070501 					MUL	R1,R5
000110	006305 					ASL	R5
000112	060205 					ADD	R2,R5
000114	012715  077777 				MOV	#77777,(R5)
000120	004767  174764 				JSR	PC,ROUTES			;					1377
000124	012764  000001  000014 			MOV	#1,14(R4)			;					1378
000132	112764  000022  000012 			MOVB	#22,12(R4)			;					1384
000140	004767  000000G				JSR	PC,$SCHED			;					1385
000144	000207 					RTS	PC				;					1256

; Routine Size:  51 words,	Routine Base:  $CODE$ + 2670
; Maximum stack depth per invocation:  3 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  33
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (11)

;	  1387	global routine DECTIM: CALL$ novalue =
;	  1388	
;	  1389	!++
;	  1390	! FUNCTIONAL DESCRIPTION:
;	  1391	!
;	  1392	!  Processes a timer call for the Decision Module.  A call here does
;	  1393	!  not necessarily mean any timer has expired.
;	  1394	!
;	  1395	! FORMAL PARAMETERS
;	  1396	!
;	  1397	!	NONE.
;	  1398	!
;	  1399	! IMPLICIT INPUTS
;	  1400	!
;	  1401	!	LINEflags, Routing_clock
;	  1402	!
;	  1403	! ROUTINE VALUE:
;	  1404	! COMPLETION CODES:
;	  1405	!
;	  1406	!	NONE.
;	  1407	!
;	  1408	! SIDE EFFECTS:
;	  1409	!
;	  1410	!	If Routing_clock has expired, set each Srm flag, restart the timer
;	  1411	!	and recalculate routing.
;	  1412	!
;	  1413	!--
;	  1414	
;	  1415	begin
;	  1416	require 'XPTSYM';
;	  1453	CHECK();				! Make sure the data base's OK
;	  1454	SET_EACH_Srm_FLAG();                    ! Ask that routing messages be sent
;	  1455	ROUTES();				! Recalculate routing
;	  1456	end;                                    ! End of DECTIM


						.SBTTL	DECTIM
000000	004767  175450 			DECTIM::
					U.9:	JSR	PC,U.2				;					1453
000004	004767  000000V				JSR	PC,U.10				;					1454
000010	004767  174726 				JSR	PC,ROUTES			;					1455
000014	000207 					RTS	PC				;					1387

; Routine Size:  7 words,	Routine Base:  $CODE$ + 3036
; Maximum stack depth per invocation:  1 word
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  34
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (12)

;	  1457	routine SET_EACH_Srm_FLAG: novalue =
;	  1458	
;	  1459	!++
;	  1460	! FUNCTIONAL DESCRIPTION:
;	  1461	!
;	  1462	!  Set the bit on each line requesting a routing message to be sent.
;	  1463	!
;	  1464	! FORMAL PARAMETERS
;	  1465	!
;	  1466	!	None
;	  1467	!
;	  1468	! IMPLICIT INPUTS
;	  1469	!
;	  1470	!	None
;	  1471	!
;	  1472	! ROUTINE VALUE: Success/failure
;	  1473	! COMPLETION CODES:
;	  1474	!
;	  1475	!	None
;	  1476	!
;	  1477	! SIDE EFFECTS:
;	  1478	!
;	  1479	!	None
;	  1480	!
;	  1481	!--
;	  1482	
;	  1483	begin
;	  1484	require 'XPTSYM';
;	  1521	
;	  1522	$XPT_for_each_LINEb_do_begin
;	  1523	    Srm = true;                         ! Signal "send a routing message"
;	  1524	$XPT_next_LINEb_end;
;	  1525	
;	  1526	end;				!End of SET_EACH_Srm_FLAG


						.SBTTL	SET.EACH.SRM.FLAG
000000	010146 				; SET.EACH.SRM.FLAG
					U.10:	MOV	R1,-(SP)			;					1457
000002	016700  000002G				MOV	.CRDAT+2,R0			;					1520
000006	016001  000020 				MOV	20(R0),R1			; *,LINEB
000012	016000  000022 				MOV	22(R0),R0			; *,$XPT$LINEB.CNT
000016	001405 					BEQ	2$
000020	052721  020000 			1$:	BIS	#20000,(R1)+			; *,LINEB				1523
000024	062701  000102 				ADD	#102,R1				; *,LINEB
000030	077005 					SOB	R0,1$				; $XPT$LINEB.CNT,*			0000
000032	012601 				2$:	MOV	(SP)+,R1			;					1457
000034	000207 					RTS	PC

; Routine Size:  15 words,	Routine Base:  $CODE$ + 3054
; Maximum stack depth per invocation:  2 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  35
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (13)

;	  1527	routine SIGNAL_REACHABILITY (NODE,STATUS): novalue =
;	  1528	
;	  1529	!++
;	  1530	! FUNCTIONAL DESCRIPTION:
;	  1531	!
;	  1532	!  Logs a reachability event
;	  1533	!  and cleans up links for the node if transition to unreachable.
;	  1534	!
;	  1535	! FORMAL PARAMETERS
;	  1536	!
;	  1537	!	NODE - Number of unreachable node
;	  1538	!	STATUS - 0/transition to reachable, 1/transition to unreachable
;	  1539	!
;	  1540	! IMPLICIT INPUTS
;	  1541	!
;	  1542	!	None
;	  1543	!
;	  1544	! ROUTINE VALUE: Success/failure
;	  1545	! COMPLETION CODES:
;	  1546	!
;	  1547	!	None
;	  1548	!
;	  1549	! SIDE EFFECTS:
;	  1550	!
;	  1551	!	None
;	  1552	!
;	  1553	!--
;	  1554	
;	  1555	begin
;	  1556	require 'XPTSYM';
;	  1593	$NM_LOG_BEGIN();
;	  1594	PARAMETER_C_1(7,STATUS);
;	  1595	$NM_LOG_END(4^6+$XPT$E_NRC,.NODE);
;	  1596	if .STATUS neq 0
;	  1597	then
;	  1598	    begin
;	  1599	    $XPECLN(.NODE,0);
;	  1600	    MAP$(HOPcost_bias);
;	  1601	    end;
;	  1602	end;				!End of SIGNAL_REACHABILITY


						.GLOBL	$DPC1


						.SBTTL	SIGNAL.REACHABILITY
000000	010146 				; SIGNAL.REACHABILITY
					U.11:	MOV	R1,-(SP)			;					1527
000002	004767  000000G				JSR	PC,$NLBEG			;					1593
000006	012746  000007 				MOV	#7,-(SP)			;					1594
000012	116600  000006 				MOVB	6(SP),R0			; STATUS,*
000016	004767  000000G				JSR	PC,$DPC1
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  36
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (13)

000022	012700  100416 				MOV	#-77362,R0			;					1595
000026	016601  000010 				MOV	10(SP),R1			; NODE,*
000032	004767  000000G				JSR	PC,$NLEND
000036	005766  000006 				TST	6(SP)				; STATUS				1596
000042	001420 					BEQ	1$
000044	005016 					CLR	(SP)				;					1599
000046	016646  000010 				MOV	10(SP),-(SP)			; NODE,*
000052	012746  000002 				MOV	#2,-(SP)
000056	012746  000000G				MOV	#$XPECLN,-(SP)
000062	004767  000000G				JSR	PC,$CALL
000066	016700  000002G				MOV	.CRDAT+2,R0			;					1600
000072	016067  000006  000000G			MOV	6(R0),KISAR6
000100	062706  000006 				ADD	#6,SP				;					1598
000104	005726 				1$:	TST	(SP)+				;					1555
000106	012601 					MOV	(SP)+,R1			;					1527
000110	000207 					RTS	PC

; Routine Size:  37 words,	Routine Base:  $CODE$ + 3112
; Maximum stack depth per invocation:  6 words
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  37
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (14)

;	  1603	routine VALID_BUFFER (CCB,BUFPTR,BUFLEN) =
;	  1604	
;	  1605	!++
;	  1606	! FUNCTIONAL DESCRIPTION:
;	  1607	!
;	  1608	!  Validates a routing message:
;	  1609	!	1) Checks the control header
;	  1610	!	2) Validates the checksum
;	  1611	!	3) Determines that the message contains no more than NN entries,
;	  1612	!	  except for unreachable ones.
;	  1613	!  In cases 1 and 2, an invalid message brings down the line it came
;	  1614	!  over.  In case 3, entries after NN are ignored anyway, and reachable
;	  1615	!  entries (Hops neq Infh or Cost neq Infc) will cause an error to be
;	  1616	!  logged.
;	  1617	!
;	  1618	! FORMAL PARAMETERS
;	  1619	!
;	  1620	!	BUFPTR - character pointer to buffer to be examined
;	  1621	!	BUFLEN - length of message in buffer (equal to 2*N+5 where N
;	  1622	!		 is the number of routing entries in the message)
;	  1623	!
;	  1624	! IMPLICIT INPUTS
;	  1625	!
;	  1626	!	Nid
;	  1627	!
;	  1628	! ROUTINE VALUE: Success/failure
;	  1629	! COMPLETION CODES:
;	  1630	!
;	  1631	!	TRUE - message is valid
;	  1632	!	FALSE - message is flawed; do not use it.
;	  1633	!
;	  1634	! SIDE EFFECTS:
;	  1635	!
;	  1636	!	If the buffer is not valid, an error will be logged;
;	  1637	!	if it is really bad (tests 1 or 2 fail) its line will
;	  1638	!	be dropped.
;	  1639	!
;	  1640	!--
;	  1641	
;	  1642	begin
;	  1643	
;	  1644	local LINEb;
;	  1645	require 'XPTSYM';
;	  1682	require 'MCBCOM';
;	  1716	local CTLHDR,NO_NODES,PTR,RET,SUM;
;	  1717	
;	  1718	LINEb = $XPT_GET_LINE_DB(.CCB[C_LIN]);  ! Address line table entry
;	  1719	PTR = .BUFPTR;				! Initialize work pointer
;	  1720	CTLHDR = getb(PTR);			! Pick up transport control header
;	  1721	if biton(.CTLHDR,%o'360') then RET = 1	! Reserved bits on
;	  1722	else if getw(PTR) neq .Nid then		! Invalid source node
;	  1723	    RET = 3
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  38
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (14)

;	  1724	else begin
;	  1725	    local P;
;	  1726	    P = .PTR;
;	  1727	    NO_NODES = (.BUFLEN-5)^-1;		!Calculate number of cells in message
;	  1728	    SUM = 0;				!Initialize checksum
;	  1729	    decr I from .NO_NODES to 1 do	!Calculate
;	  1730		checksum(SUM,getw(P));          !  checksum
;	  1731	    if .SUM neq getw(P) then RET = 2	!Checksum doesn't match one in message
;	  1732	    else if .NO_NODES leq NN then	!Message doesn't overextend data base,
;	  1733		RET = 0				!  message is valid
;	  1734	    else begin				!Message reports on extra nodes:
;	  1735		local NNN;
;	  1736		NNN = 0;			!  Assume no reachable nodes past NN
;	  1737		P=ch$plus(ch$plus(.PTR,NN),NN);	!  Point past nodes we know about
;	  1738		incr I from NN+1 to .NO_NODES do!  Scan for the
;	  1739		    (if (getw(P) neq		!    greatest node
;	  1740		    ((Infh^Hop_P) or (Infc^Cost_P)))!address that
;	  1741			then NNN = .I);		!    is reachable
;	  1742		if .NNN eql 0 then		!All extra entries
;	  1743		    RET = 0			!  are unreachable
;	  1744		else RET = 4 + .NNN		!Some entry is real - that's bad
;	  1745		end
;	  1746	    end;
;	  1747	
;	  1748	!
;	  1749	!  Message is no good - signal an event and maybe restart the line
;	  1750	!
;	  1751	
;	  1752	if .RET neq 0 then begin
;	  1753	
;	  1754	    $NM_LOG_BEGIN();
;	P 1755	    $NM_LOG_END (4^6+    
;	P 1756	    (selectone .RET of
;	P 1757	    set
;	P 1758	
;	P 1759	    [1]:	begin			! Routing message format error:
;	P 1760		COUNTER_INCREMENT(XPTDB,XPTfmt_loss); !   Increment packet counter
;	P 1761		CALL$L(PKTA_HDR,.BUFPTR);       !   Log packet hdr in Event Buffer
;	P 1762		$XPT$E_FMT
;	P 1763			end;
;	P 1764	
;	P 1765	    [2]:	begin			! Checksum error:
;	P 1766		bind THREE = uplit(3);
;	P 1767		COUNTER_INCREMENT(LINEb,XPTlinedn);!   Increment "line downs" counter
;	P 1768		PARAMETER_C_1(5,THREE);
;	P 1769		CALL$L(PKTA_HDR,.BUFPTR);       !   Move in packet header
;	P 1770		$XPT$E_LSF
;	P 1771			end;
;	P 1772	
;	P 1773	    [3]:	begin			! Invalid source node:
;	P 1774		COUNTER_INCREMENT(LINEb,XPTlinedn);!   Increment "line downs" counter
;	P 1775		PARAMETER_CM(4,1);		!   Move in as
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  39
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (14)

;	P 1776		PARAMETER_DU_2(,Nid);		!     expected node ID
;	P 1777		PARAMETER_C_1(5,uplit(4));      !   Move in reason code
;	P 1778		CALL$L(PKTA_HDR,.BUFPTR);       !   Move in packet header
;	P 1779		$XPT$E_LOF
;	P 1780			end;
;	P 1781	
;	P 1782	    [otherwise]:	begin		! Partial update loss:
;	P 1783		local NNN;
;	P 1784		COUNTER_INCREMENT(XPTDB,XPTrout_loss); !   Increment counter
;	P 1785		CALL$L(PKTA_HDR,.BUFPTR);       !   Move packet header into buffer
;	P 1786		NNN = .RET-4;			!   Move in highest reachable
;	P 1787		PARAMETER_DU_2(2,NNN);		!     node address
;	P 1788		$XPT$E_RUL
;	P 1789			end;
;	P 1790	
;	  1791	    tes),.NMXid);
;	  1792		    
;	  1793	    if .RET lss 4                       ! Message is really bad:
;	  1794	    then begin                          ! Re-initialize.
;	  1795	         Service_line = true;
;	  1796	         return FALSE
;	  1797	         end;
;	  1798	
;	  1799	    end;
;	  1800	
;	  1801	TRUE                                    ! Acceptable message - give OK
;	  1802	end;                                    ! End of VALID_BUFFER



000000						.PSECT	$PLIT$,  RO ,  D  
000000	000003 				P.AAA:	.WORD	3
000002	000004 				P.AAB:	.WORD	4


						.GLOBL	$IC8, PKTA.HDR, $DPDU2


	000000'				; THREE
					U.52=		    P.AAA


						.SBTTL	VALID.BUFFER
003224						.PSECT	$CODE$,  RO 

000000	004167  000000G			; VALID.BUFFER
					U.12:	JSR	R1,$SAVE5			;					1603
000004	162706  000010 				SUB	#10,SP
000010	016601  000032 				MOV	32(SP),R1			; CCB,*					1718
000014	005000 					CLR	R0
000016	156100  000010 				BISB	10(R1),R0
000022	004767  000000G				JSR	PC,GTLINE
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  40
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (14)

000026	010066  000002 				MOV	R0,2(SP)			; *,LINEB
000032	016666  000030  000004 			MOV	30(SP),4(SP)			; BUFPTR,*				1719
000040	016601  000004 				MOV	4(SP),R1			; *,PTR
000044	005000 					CLR	R0				; CTLHDR				1720
000046	152100 					BISB	(R1)+,R0			; PTR,CTLHDR
000050	032700  000360 				BIT	#360,R0				; *,CTLHDR				1721
000054	001403 					BEQ	1$
000056	012704  000001 				MOV	#1,R4				; *,RET
000062	000514 					BR	10$
000064	112166  000006 			1$:	MOVB	(R1)+,6(SP)			; PTR,X					1722
000070	112166  000007 				MOVB	(R1)+,7(SP)			; PTR,X
000074	016600  000006 				MOV	6(SP),R0			; X,*
000100	016602  000002 				MOV	2(SP),R2			; LINEB,*
000104	020062  000004 				CMP	R0,4(R2)			; *,*(LINEB)
000110	001403 					BEQ	2$
000112	012704  000003 				MOV	#3,R4				; *,RET					1723
000116	000476 					BR	10$				;					1722
000120	010103 				2$:	MOV	R1,R3				; PTR,P					1726
000122	016600  000026 				MOV	26(SP),R0			; BUFLEN,*				1727
000126	162700  000005 				SUB	#5,R0
000132	010016 					MOV	R0,(SP)				; *,NO.NODES
000134	006216 					ASR	(SP)				; NO.NODES
000136	005002 					CLR	R2				; SUM					1728
000140	011605 					MOV	(SP),R5				; NO.NODES,I				1729
000142	003412 					BLE	4$
000144	112366  000006 			3$:	MOVB	(R3)+,6(SP)			; P,X					1730
000150	112366  000007 				MOVB	(R3)+,7(SP)			; P,X
000154	016600  000006 				MOV	6(SP),R0			; X,*
000160	060002 					ADD	R0,R2				; *,SUM
000162	010200 					MOV	R2,R0				; SUM,*
000164	005502 					ADC	R2				; SUM
000166	077512 					SOB	R5,3$				; I,*					0000
000170	112366  000006 			4$:	MOVB	(R3)+,6(SP)			; P,X					1731
000174	112366  000007 				MOVB	(R3)+,7(SP)			; P,X
000200	016600  000006 				MOV	6(SP),R0			; X,*
000204	020200 					CMP	R2,R0				; SUM,*
000206	001403 					BEQ	5$
000210	012704  000002 				MOV	#2,R4				; *,RET
000214	000437 					BR	10$
000216	016700  000002G			5$:	MOV	.CRDAT+2,R0			;					1732
000222	016000  000016 				MOV	16(R0),R0
000226	021600 					CMP	(SP),R0				; NO.NODES,*
000230	003424 					BLE	8$				;					1733
000232	005002 					CLR	R2				; NNN					1736
000234	060001 					ADD	R0,R1				;					1737
000236	060001 					ADD	R0,R1
000240	010103 					MOV	R1,R3				; *,P
000242	000412 					BR	7$				;					1738
000244	112366  000006 			6$:	MOVB	(R3)+,6(SP)			; P,X					1739
000250	112366  000007 				MOVB	(R3)+,7(SP)			; P,X
000254	016601  000006 				MOV	6(SP),R1			; X,*
000260	020127  077777 				CMP	R1,#77777
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  41
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (14)

000264	001401 					BEQ	7$
000266	010002 					MOV	R0,R2				; I,NNN					1741
000270	005200 				7$:	INC	R0				; I					1738
000272	020016 					CMP	R0,(SP)				; I,NO.NODES
000274	003763 					BLE	6$
000276	005702 					TST	R2				; NNN					1742
000300	001002 					BNE	9$
000302	005004 				8$:	CLR	R4				; RET					1743
000304	000403 					BR	10$				;					1742
000306	010204 				9$:	MOV	R2,R4				; NNN,RET				1744
000310	062704  000004 				ADD	#4,R4				; *,RET
000314	001002 				10$:	BNE	11$				;					1752
000316	000167  000406 				JMP	17$
000322	004767  000000G			11$:	JSR	PC,$NLBEG			;					1754
000326	020427  000001 				CMP	R4,#1				; RET,*					1791
000332	001022 					BNE	12$
000334	016700  000002G				MOV	.CRDAT+2,R0
000340	062700  000133 				ADD	#133,R0
000344	004767  000000G				JSR	PC,$IC8
000350	016646  000004 				MOV	4(SP),-(SP)
000354	012746  000001 				MOV	#1,-(SP)
000360	012746  000000G				MOV	#PKTA.HDR,-(SP)
000364	004767  000000G				JSR	PC,$CALL
000370	022626 					CMP	(SP)+,(SP)+
000372	012700  000004 				MOV	#4,R0
000376	000532 					BR	15$
000400	020427  000002 			12$:	CMP	R4,#2				; RET,*
000404	001030 					BNE	13$
000406	016600  000002 				MOV	2(SP),R0			; LINEB,*
000412	062700  000102 				ADD	#102,R0
000416	004767  000000G				JSR	PC,$IC8
000422	012746  000005 				MOV	#5,-(SP)
000426	116700  000000'				MOVB	U.52,R0
000432	004767  000000G				JSR	PC,$DPC1
000436	016616  000006 				MOV	6(SP),(SP)
000442	012746  000001 				MOV	#1,-(SP)
000446	012746  000000G				MOV	#PKTA.HDR,-(SP)
000452	004767  000000G				JSR	PC,$CALL
000456	022626 					CMP	(SP)+,(SP)+
000460	012700  000010 				MOV	#10,R0
000464	000477 					BR	15$
000466	020427  000003 			13$:	CMP	R4,#3				; RET,*
000472	001044 					BNE	14$
000474	016600  000002 				MOV	2(SP),R0			; LINEB,*
000500	062700  000102 				ADD	#102,R0
000504	004767  000000G				JSR	PC,$IC8
000510	012746  000004 				MOV	#4,-(SP)
000514	012700  000001 				MOV	#1,R0
000520	004767  000000G				JSR	PC,$DPCM
000524	016601  000004 				MOV	4(SP),R1			; LINEB,*
000530	016100  000004 				MOV	4(R1),R0			; *(LINEB),*
000534	004767  000000G				JSR	PC,$TPDU2
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  42
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (14)

000540	012716  000005 				MOV	#5,(SP)
000544	116700  000002'				MOVB	P.AAB,R0
000550	004767  000000G				JSR	PC,$DPC1
000554	016616  000006 				MOV	6(SP),(SP)
000560	012746  000001 				MOV	#1,-(SP)
000564	012746  000000G				MOV	#PKTA.HDR,-(SP)
000570	004767  000000G				JSR	PC,$CALL
000574	022626 					CMP	(SP)+,(SP)+
000576	012700  000011 				MOV	#11,R0
000602	000430 					BR	15$
000604	016700  000002G			14$:	MOV	.CRDAT+2,R0
000610	062700  000134 				ADD	#134,R0
000614	004767  000000G				JSR	PC,$IC8
000620	016646  000004 				MOV	4(SP),-(SP)
000624	012746  000001 				MOV	#1,-(SP)
000630	012746  000000G				MOV	#PKTA.HDR,-(SP)
000634	004767  000000G				JSR	PC,$CALL
000640	022626 					CMP	(SP)+,(SP)+
000642	010400 					MOV	R4,R0				; RET,NNN
000644	162700  000004 				SUB	#4,R0				; *,NNN
000650	012716  000002 				MOV	#2,(SP)
000654	004767  000000G				JSR	PC,$DPDU2
000660	012700  000005 				MOV	#5,R0
000664	062700  000400 			15$:	ADD	#400,R0
000670	016602  000004 				MOV	4(SP),R2			; LINEB,*
000674	016201  000034 				MOV	34(R2),R1			; *(LINEB),*
000700	004767  000000G				JSR	PC,$NLEND
000704	020427  000004 				CMP	R4,#4				; RET,*					1793
000710	002006 					BGE	16$
000712	052776  040000  000004 			BIS	#40000,@4(SP)			; *,LINEB				1795
000720	005726 					TST	(SP)+				;					1793
000722	005000 					CLR	R0				;					1794
000724	000403 					BR	18$
000726	005726 				16$:	TST	(SP)+				;					1752
000730	012700  000001 			17$:	MOV	#1,R0				;					1603
000734	062706  000010 			18$:	ADD	#10,SP
000740	000207 					RTS	PC

; Routine Size:  241 words,	Routine Base:  $CODE$ + 3224
; Maximum stack depth per invocation:  14 words


;	  1803	end					!End of module XPTDEC
;	  1804	eludom



;					OTS external references
						.GLOBL	$SAVE5, $CALL, $STOP, $IGNAL


;					PSECT SUMMARY
XPTDEC								25-Jan-1983 09:55:36	TOPS-20 Bliss-16 2A(530)	    Page  43
X01390								30-Dec-1982 21:25:59	NETPKG:<XPT>XPTDEC.BLI.8 (14)

;
;	Psect Name			Words	  Attributes
;	 $CODE$				 1083	    RO ,  I  ,  LCL,  REL,  CON
;	 $PLIT$				    2	    RO ,  D  ,  LCL,  REL,  CON




;				LIBRARY STATISTICS
;
;					     -------- Symbols --------    Blocks
;	File				     Total    Loaded   Percent      Read
;
;  NETPKG:<MCB>XPORTX.L16.15		       599         0         0         0
;  NETPKG:<MCB>MCBLIB.L16.15		       372        31         8         0
;  NETPKG:<MCB>NMXLIB.L16.13		       200        10         5         0
;  NETPKG:<XPT>XPTLIB.L16.3		       510       212        41         0





; Size:		1083 code + 2 data words
; Run Time:	00:20.7
; Elapsed Time:	01:19.0
; Memory Used:	59 pages
; Compilation Complete
ADDRESS				 247+	 249+	 250+	 252+	 253+	 255+	 256+	 262+	 263+	 266+	 267+	 268+
ADR				1007	1010#	1014
BITON				1721
BPT				 276+#	 288+#	 610
BUFCHK				 280+	 281+#	 290+	 291+#
BUFLEN				 974	 996	 999	1023	1603	1727
BUFPTR				 974	 996	 999	1009	1603	1719	1761	1769	1778	1785
CALL$L				 610	 847	 998	1138	1761	1769	1778	1785
CALL$				 301	 302	 303	 304	 305	 306	 307	 331	 613#	 744#	 871#	1063#
				1160#	1256#	1387#
CCB				 613	 711+	 718	 740#	 741#	 742	 744	 773	 815	 866#	 867#	 868
				 871	 970+	 988	 996	 999	1032	1060#	1061	1160	1188	1234	1244
				1245	1247#	1253#	1254	1256	1353+	1364	1375	1378#	1384#	1385	1603
				1713+	1718
CCBFIELDS			 706+	 708+#	 965+	 967+#	1348+	1350+#	1708+	1710+#
CE_ERR				1237	1367
CHECKSUM			1730
CHECK				 300	 520*	 716	 813	 982	1233	1363	1453
CHKBUF				 283+*	 284+
CLN_RETRY			 332	 733
CLOSET				 306	1256*
CNT				 443	 444#	 445	 459	 462#
COST				 430	 441#	 455	 458#	 469	 471#	 503	 508
COSTCH				 304	1063*
COSTI				1027	1034#	1036#	1038	1039#	1042#	1045
COSTJ				1063	1137	1145	1146
COST_P				 454	 607	 729	 845	1029	1034	1042	1149	1150	1376	1740
COST_S				 454	1034	1149	1150
COUNTER_INCREMENT		1760	1767	1774	1784
CS_SUC				 741	 867	1247	1378
CTLHDR				1716	1720#	1721
C_BIAS				1032
C_FIELDS			 708+	 711+	 967+	 970+	1188	1350+	1353+	1710+	1713+
C_FNC				 740	 866	1060	1253	1384
C_LIN				 718	 815	 988	1718
C_PIX				1244
C_PRM1				1234	1245	1364	1375
C_STS				 741	 867	1247	1378
C_XPT_FIELDS			 773
DECTIM				 307	1387*
DIF				1145#	1150
DLLQUOTA			1059#
FALSE				 427	 499	 605	 609	 721	 722	 723	 724	 735	 736	 827	1373
				1796
FC_CCP				1253	1384
FC_RCE				 740	 866	1060
FULL				 837
GETB				1720
GETQ				 247+#
GETW				 226+#	 249+	 250+	1010	1033	1722	1730	1731	1739
HELLO_CLOCK			 725#	 855#
HELLO_TIMER			 855
HOPCOST				 420#	 445	 592#	 600	 714#	 728#	 841#	 845#	 973#	1048#	1130#	1149
				1150	1227#	1245#	1356#	1375#
HOPCOST_ADDRESS			 420	 592	 714	 841	 973	1130	1227	1356
HOPCOST_BIAS			 422	 595	1047	1147	1600
HOPI				1028#	1035#	1037#	1040	1041#	1043#	1044
HOPS				 430	 440#	 451#	 464	 466#	 503	 507
HOP_P				 450	 607	 729	 845	1029	1035	1043	1376	1740
HOP_S				 450	1035
I				 271+	 273+	 421	 423#	 424	 433	 438#	 445	 481	 491	 500	 514
				 596	 599	 600	 727	 728	1025	1030	1048	1148	1149	1150	1729
				1738	1741
INCN				 426#	 434#
INDEX				 430	 439#	 459#	 467#	 472#	 474#	 476#	 477#	 483#	 484	 511
INFC				 441	 471	 607	 729	1029	1038	1039	1376	1740
INFH				 440	 466	 607	 729	1029	1040	1041	1376	1740
INPUTCOUNT			1058#
J				 271+	 273+
LCV				 843	 845	 997	1036	1137	1145	1146#
LIMIT				 593#	 600
LINE				1063	1136	1149	1150
LINEBLOCK			 410+	 582+	 670+	 802+	 929+	1120+	1217+	1312+	1443+	1511+	1583+	1672+
LINEB				 408+	 410+	 580+	 582+	 642	 668+	 670+	 718#	 733	 774	 800+	 802+
				 815#	 901	 927+	 929+	 988#	1092	1118+	1120+	1136#	1215+	1217+	1310+
				1312+	1441+	1443+	1509+	1511+	1581+	1583+	1644	1670+	1672+	1718#	1767
				1774
LINEDN				 301	 613*
LINENUMBER			 728	 835	 845	1048
LINESTATE			 821	 990
LINEUP				 302	 744*
LINE_UP				 721#	 856#
LOCAL_NODE			 510	 602	1236	1243#	1366	1373#
M				 271+	 272+
MAP$				 422	 595	1032	1047	1147	1600
MAPBUF				 996
MATRIX				 271+#	 273+	 420	 592	 714	 841	 973	1130	1227	1356
MAXC				 469
MAXH				 464
MAXN				 423	 433#	 518#
MCB$GAW_PROCESS_DATA_BASE	 413+	 414+	 417+	 585+	 586+	 589+	 673+	 674+	 677+	 805+	 806+	 809+
				 932+	 933+	 936+	1123+	1124+	1127+	1220+	1221+	1224+	1315+	1316+	1319+
				1446+	1447+	1450+	1514+	1515+	1518+	1586+	1587+	1590+	1675+	1676+	1679+
MINCOST				 503	 508#
MINHOP				 503	 507#
MXA				1008#	1012#	1014#	1016	1017#	1019#	1021#	1023
N				 271+	 272+
NID				 719	 734	 826	 845	 860	1722	1776
NL				 271+	 273+
NLN				 444	 477	 593	 728	 845	1048	1149	1150	1245	1375
NMXID				 861	1791
NN				 514	 596	 727	1016	1017	1019	1021	1025	1148#	1732	1737	1738
NNN				1735	1736#	1741#	1742	1744	1783	1786#	1787
NODE				1527	1595	1599
NODEBLOCK			 405+	 430	 480	 577+	 597	 665+	 797+	 924+	1115+	1212+	1307+	1438+
				1506+	1578+	1667+
NODEB				 403+	 405+	 430	 480	 481#	 575+	 577+	 597	 599#	 642	 663+	 665+
				 719#	 774	 795+	 797+	 826#	 922+	 924+	1113+	1115+	1189	1210+	1212+
				1234#	1284	1305+	1307+	1364#	1436+	1438+	1504+	1506+	1576+	1578+	1665+
				1667+
NODEMAXIMUM_ADDRESS_VECTOR	1012
NOP				 288+	 289+	 291+
NO_LINEB			 409+	 581+	 669+	 801+	 928+	1119+	1216+	1311+	1442+	1510+	1582+	1671+
NO_NODEB			 404+	 576+	 664+	 796+	 923+	1114+	1211+	1306+	1437+	1505+	1577+	1666+
NO_NODES			 974	1008	1023#	1030	1716	1727#	1729	1732	1738
NTY				 829	 849
OL				 483	 511#	 835#
OPENT				 305	1160*
P				1725	1726#	1730	1731	1737#	1739
PARAMETER_CM			 859	1775
PARAMETER_C_1			1594	1768	1777
PARAMETER_DU_2			 860	1776	1787
PHASE2_NODE			 482	 731	 736#	 827#	 833#
PHTWO				 831
PKTA_HDR			1761	1769	1778	1785
POINTER				 975
PTR				 226+	 229+	 230+	 233+	 236+	 237+	 243+	 244+	 247+	 249+	 250+	 252+
				 255+	 256+	 257+	 258+	 262+	 263+	 975	1009#	1010	1033	1716	1719#
				1720	1722	1726	1737
PUTQ				 252+#
PUTW				 233+#	 262+	 263+
RCVROU				 303	 871*
REACH				 487	 490#	 496	 499#	 735#	 834#
RET				1357	1716	1721#	1723#	1731#	1733#	1743#	1744#	1752	1756	1786	1793
ROUTES				 299	 334*	 739	 863	1050	1246	1377	1455
ROUTESADDR			 435
ROUTING_CHANGED			 427#	 506#	 516
ROUTING_CLOCK			1157#
RU				 990
SEND_HELLO			 723#	 838#	 850#
SERVICE_LINE			 724#	1795#
SET_EACH_SRM_FLAG		 308	 516	 854	1454	1457*
SIGNAL_REACHABILITY		 309	 491	 500	1527*
SMALL				 849
SRM				 722#	1523#
STATUS				1527	1594	1596
SUM				1716	1728#	1730	1731
SYNCHBLK			 435
TC				 821
TEMP				1027	1028	1029#	1033#	1034	1035	1044#	1045#	1048
TERM_XPT			 333	 610	 847	 998	1138
THREE				1766#	1768
TRUE				 490	 506	 604	 608	 833	 834	 838	 850	 856	1243	1523	1795
				1801
UNIT				 271+#	 272+	 273+
USER				1244#	1374#
VALID_BUFFER			 310	 999	1603*
VALUE				 233+	 234+	 236+	 237+	 242+
X				 228+	 229+#	 230+#	 231+	 241+	 242+#	 243+	 244+	 443	 445#	 449	 452
				 453#	 598	 600#	 603	 607
XPT$_CHECK			 610
XPTDBBLOCK			 419+	 591+	 679+	 811+	 938+	1129+	1226+	1321+	1452+	1520+	1592+	1681+
XPTDB				 416+	 417+#	 418+	 588+	 589+#	 590+	 676+	 677+#	 678+	 808+	 809+#	 810+
				 935+	 936+#	 937+	1126+	1127+#	1128+	1223+	1224+#	1225+	1318+	1319+#	1320+
				1449+	1450+#	1451+	1517+	1518+#	1519+	1589+	1590+#	1591+	1678+	1679+#	1680+
				1760	1784
XPTDEC				   1#
XPTFMT_LOSS			1760
XPTLINEDN			1767	1774
XPTROUT_LOSS			1784
Y				 448	 449#	 450#	 451	 452#	 454#	 455	 458
ZEROQ				 266+#
_SYNQH				 328	 431
$MCB_PAUSE			 435
$MCB_SCHEDULE_CCB		 742	 868	1061	1254	1385
$NM_LOG_BEGIN			 858	1593	1754
$NM_LOG_END			 861	1595	1755
$XPECLN				 331*	 734	1599
$XPT$E_FMT			1762
$XPT$E_LOF			1779
$XPT$E_LSF			1770
$XPT$E_LUP			 861
$XPT$E_NRC			1595
$XPT$E_RUL			1788
$XPT_FOR_EACH_LINEB_DO_BEGIN	1522
$XPT_GET_LINE_DB		 718	 815	 988	1136	1718
$XPT_GET_NODE_DB		 481	 599	 719	 826	1234	1364
$XPT_NEXT_LINEB_END		1524
%CTCE				 234+	 253+
%REMAINING			 278+