*DECK NDLNFTM USETEXT NDLDATT USETEXT NDLER2T USETEXT NDLFETT USETEXT NDLNCFT USETEXT NDLPS2T USETEXT NDLTBLT PROC NDLNFTM; BEGIN *IF,DEF,IMS # ** NDLNFTM - NCF TERMINATION ROUTINE. * * D.K. ENDO 81/10/12 * * THIS PROCEDURE DOES ALL THE FINAL PROCESSING IN THE CREATION OF * AN NCF. * * PROC NDLNFTM * * ENTRY NONE. * * EXIT NONE. * * METHOD * * CALL PROC THAT BUILDS NCB-S. * FOR EACH CROSS REFERENCE TABLE, * SORT THE TABLE. * WRITE TABLE TO NCF. * SORT THE LINE RECORD INDEX. * WRITE LINE RECORD INDEX TO NCF. * IF NO ERRORS, * THEN, * SET GOOD NCF FLAG. * OTHERWISE, * CLEAR GOOD NCF FLAG. * PUT ERROR MESSAGE IN PREFIX TABLE. * SORT NCF INDEX. * PUT PREFIX TABLE IN FRONT OF NCF INDEX. * WRITE INDEX TO NCF. * DE-ALLOCATE TABLE SPACE. * # *ENDIF # **** PROC NDLNFTM - XREF LIST BEGINS. # XREF BEGIN PROC SSTATS; # ALLOC SPECIFIED NUM OF WORDS TO TABLE # PROC NDLEM2; # MAKES ENTRIES IN PASS2 ERROR FILE # PROC MOVEI; # MOVES BLOCKS OF MEMORY IN FL # PROC NDLSST; # DOES A SORT OF TBL USING SHELL-S METHOD # PROC NDLWNCF; # WRITES RECORD/TABLE TO NCF # FUNC XCDD C(10); #CONVERTS INTEGER TO DISPALY CODE # END # **** # DEF NCF$EMSG #"ERRORS DETECTED IN THE CREATION OF THIS NCF."#; DEF PT$SIZE # 15 #; # TOTAL SIZE OF PRFX TABLE # ITEM BBP; # BEGINNING BIT POSITION # ITEM ENT$CNT; # ENTRY COUNT # ITEM FRST$WRD; # FIRST WORD TO BEGIN SORT ON # ITEM ITEMP; # INTEGER TEMPORARY # ITEM LENGTH; # LENGTH OF TABLE TO BE WRITTEN TO NCF # ITEM MASK; # MASK OF KEY TO BE SORTED ON # CONTROL EJECT; PROC CHKTRUNK; BEGIN *IF,DEF,IMS # ** * * CHKTRUNK - CHECKS PORT NUMBER ALLOCATION OF TRUNK STATEMENTS. * * Y. C. YIP 82/09/09 * * THIS PROC SEARCHES PHYSICAL LINK TABLE FOR TRUNK LINKS * AND CHECK IF PORTS ASSIGNED ARE VALID. * * Y.C. YIP 82/09/09 * * ENTRY - NONE * * EXIT - NONE * * METHOD * * FOR EVERY NODE ASSOCIATED WITH A TRUNK, GET ITS * MAXIMUM PORT NUMBER USED BY CALLING A LOCAL PROCEDURE * MAXPORT AND STORE THE MAXIMUM PORT NUMBER USED BY * BY THAT NODE IN MAXPORT. THEN IT CHECKS IF ALL PORT * NUMBERS 1 THROUGH MAXPORT ARE USED ELSE AN ERROR * MESSAGE IS GENERATED. * # *ENDIF # DATA DEFINITION # XREF BEGIN PROC NDLEM2; #PASS 2 ERROR MESSAGE GENERATOR# FUNC XCDD C(10); #CONVERTS INTEGER TO DISPLAY CODE # END ARRAY USEMAP[0:4] S(1); # FOR NODE MAP # BEGIN ITEM NMAP(0,0,60) = [5(0)] ; # CLEAR MAP # END ITEM INDIX1; # LOOP INDEX # DEF OVCH # -1 #; #LINE NUMBER FOR OVERALL ERROR CHECK# ITEM MPTNO; # MAXIMUM PORT NUMBER # ITEM WRDPTR ; # WORD POINTER # ITEM BITPTR ; # BIT POINTER # CONTROL EJECT; # FIRST LOCAL PROCEDURE # # # # # PROC MAXPORT(NODENO,PORTNO); *IF,DEF,IMS # ** * * MAXPORT - OBTAINS MAXIMUM PORT NUMBER AT A NPU NODE. * * Y.C. YIP 82/09/09 * * THIS PROCEDURE OBTAINS THE MAXIMUM PORT NUMBER USED BY A * NPU NODE AT EITHER END OF A TRUNK. * * PROC MAXPORT(NODENO,PORTNO) * * ENTRY - NODENO = NODE NUMBER TO BE CHECKED * * PORTNO = RETURN PARAMETER TO STORE THE MAXIMUM PORT * NUMBER SPECIFIED FOR THAT NODE * * EXIT - NODENO = UNCHANGED. * PORTNO = VALUE OF THE MAXIMUM PORT NUMBER. * * METHOD * * THE PHYSICAL LINK TABLE IS LOOPED TO FIND A MATCH OF THE * NODE NUMBER WITH THE NODE NUMBER AT EITHER END OF THE TRUNK. * IF A MATCH IS FOUND A MAXIMUM PORT NUMBER IS STORED AND * BE USED TO COMPARE WITH SUBSEQUENT PORT NUMBERS FOUND. * THE SEARCH STOPS AT THE END OF THE PHYSICAL LINK TABLE AND * PORTNO CONTAINS THE VALUE OF THE MAXIMUM PORT NUMBER. * # *ENDIF BEGIN ITEM PORTNO; # PORT NUMBER # ITEM NODENO; #NODE NUMBER # ITEM INDIX; # LOOP VARIABLE # # * * # FOR INDIX=1 STEP 1 UNTIL PLWC[0] # GO THROUGH PLLINK TABLE # DO BEGIN IF PLTYPE[INDIX] EQ 1 # A TRUNK LINK ? # THEN BEGIN IF PLNID1[INDIX] EQ NODENO # MATCH IN NODE NO # THEN BEGIN IF PLP1[INDIX] GR PORTNO THEN # GET HIGHER PORTNO # PORTNO=PLP1[INDIX]; # GET BIGGER OF PORTNO # END ELSE BEGIN IF PLNID2[INDIX] EQ NODENO # SAME FOR OTHER SIDE # THEN BEGIN IF PLP2[INDIX] GR PORTNO # GET HIGHER PORTNO # THEN PORTNO = PLP2[INDIX] ; END END END END RETURN; # RETURN TO CALLING PROCEDURE # END # END OF MAXPORT # CONTROL EJECT; # LOCAL PROCEDURE # PROC SETPTR(NODENO); *IF,DEF,IMS # ** * PROC SETPTR * * Y.C. YIP 82/09/09 * * THIS PROCEDURE SETS THE WORD AND BIT POINTER IN THE NODE MAP. * * PROC SETPTR(NODENO) * * ENTRY - NODENO = NODE NUMBER. * * EXIT - WRDPTR SET TO THE WORD NUMBER WITHIN THE NODE MAP * BITPTR SET TO THE BIT OF THAT SPECIFIC WORD INDICATED * BY WRDPTR. * * METHOD * * WORD NUMBER COMPUTED BY (NODENO - 1)/60 * BITPTR COMPUTED BY (NODENO - 1) - 60*WRDPTR # *ENDIF BEGIN ITEM NODENO; # NODE NUMBER# WRDPTR = (NODENO -1)/60; # SET WORD POINTER # BITPTR = (NODENO -1) -60*WRDPTR; # SETS BIT POINTER # RETURN; END # END OF SETPTR # CONTROL EJECT; # LOCAL PROCEDURE # PROC CHECKPORT(ERRORV,PORTNO,NODENO); BEGIN *IF,DEF,IMS # ** * * CHECKPORT - CHECKS IF A PORT NUMBER IS DEFINED IN THE * PHYSICAL LINK TABLE. * * Y.C. YIP 82/09/09 * * THIS PROCEDURE CHECKS FOR VALID PORT NUMBER * * PROC CHECKPORT(ERRORV,PORTNO,NODENO) * * ENTRY - ERRORV = ERROR FLAG * PORTNO = PORT NUMBER BEING CHECKED * NODENO = NODE NUMBER OF THE TRUNK * * EXIT - ERRORV SET TO TRUE IF THERE IS NO MATCH ELSE FALSE * PORTNO = UNCHANGED * NODENO = UNCHANGED * * METHOD * * ERRORV IS SET TO FALSE * THE PHYSICAL LINK TABLE IS SCANNED TO * FIND A MATCH FOR THE NODE NUMBER AND PORT NUMBER GIVEN AS * PARAMETERS. IF A MATCH IS FOUND ERRORV IS SET TO TRUE. * * # *ENDIF ITEM ERRORV B; # BOOLEAN FOR ERROR SIGNAL # ITEM PORTNO ; # PORTNO # ITEM NODENO ; # NODE NUMBER BEING CHECKED # ITEM INDIX; # LOOP VARIABLE # FOR INDIX=1 STEP 1 UNTIL PLWC[0] # SCAN PLLINK TABLE # DO BEGIN IF PLTYPE[INDIX] EQ 1 #LINK IS A TRUNK # THEN BEGIN IF PLNID1[INDIX] EQ NODENO # TRY TO MATCH NODE NO# THEN BEGIN IF PLP1[INDIX] EQ PORTNO # IF MATCH FOUND # THEN BEGIN ERRORV=FALSE; #NO ERROR # RETURN; END END ELSE BEGIN IF PLNID2[INDIX] EQ NODENO # IF MATCH FOUND # THEN BEGIN IF PLP2[INDIX] EQ PORTNO # IF PORTNO MATCH # THEN BEGIN ERRORV= FALSE ; # NO ERRROR # RETURN ; # RETURN CONTROL TO CALLING PROGRAM # END END END END END # END FOR LOOP # ERRORV=TRUE ; # NO MATCH FOUND # RETURN; END # END OF CHECKPORT # CONTROL EJECT; PROC CHECKERR (NODENO) ; *IF,DEF,IMS # ** * * CHECKERR - CHECKS FOR PORT NUMBER SPECIFICATION ERROR. * * Y.C. YIP 82/09/09 * * THIS PROC CHECKS VALIDITY OF ALL PORTS USED AT A NODE NUMBER * * PROC CHECKERR(NODENO) * * ENTRY - NODENO = NODE NUMBER BEING CHECKED * * EXIT - NODENO = UNCHANGED. * * METHOD * * CHECKERR CALLS MAXPORT TO FIND OUT THE MAXIMUM * PORT NUMBER FOR THAT NODE. IT THEN CALLS * CHECKPORT TO DETECT INVALID PORT NUMBERS USED * IN THE RANGE 1 THROUGH MAXPORT, IF SO, IT GENERATES * ERROR 157 WITH PORT NUMBER AS THE CLARIFIER WORD. * # *ENDIF BEGIN XREF BEGIN PROC NDLEM2; #REFERENCE TO PASS 2 ERROR ROUTINE # FUNC XCDD C(10); # CONVERSION FROM INTEGER TO DISPLAY CODE# END ITEM ERRORC B ; #BOOLEAN FOR ERROR CONDITION # ITEM CTEMP C(10) ; # TEMP FOR DISPLAY CODE # ITEM MPTNO ; #MAXIMUM PORT NUMBER # ITEM INDIX2 ; # LOOP VCARIABLE INDEX # ITEM CONT B; # BOOLEAN TO SKIP DUPLICATE ERROR MESSAGES # SETPTR(NODENO) ; # SETS BIT MAP # IF BNMAP[WRDPTR] EQ 0 THEN # NO CHECKED BEFORE # BEGIN BNMAP[WRDPTR]=1; # SET MASK # MPTNO=0; #CLEAR MAX PORT NUMBER FOR COMPARISON # MAXPORT(NODENO,MPTNO); # FIND OUT MAXIMUM PORT NUMBER # ERRORC=FALSE; #PRESET ERROR# CONT = TRUE; # SETTING CONTINUE FLAG TO TRUE # FOR INDIX2=MPTNO STEP -1 WHILE CONT DO BEGIN IF INDIX2 EQ 1 # IF LAST ENTRY # THEN BEGIN CONT = FALSE; # DISCONTINUE THE LOOP # END CHECKPORT(ERRORC,INDIX2,NODENO); IF ERRORC THEN #CALLS ERROR MESSAGE DISPLAY # BEGIN CTEMP=XCDD(NODENO); #CONVERTS TO DISPLAY CODE # NDLEM2(ERR157,OVCH,CTEMP); #ERROR MESSAGE# CONT = FALSE; # AVOID DUPLICATE ERROR MESSAGES# END END END RETURN; END # END OF CHECKERR# CONTROL EJECT; #* * CHKTRUNK CODE BEGINS HERE * * # FOR INDIX1=1 STEP 1 UNTIL PLWC[0] # SCAN PL TABLE # DO BEGIN IF PLTYPE[INDIX1] EQ 1 # IF LINK IS A TRUNK # THEN BEGIN CHECKERR(PLNID1[INDIX1]) ; #CHECKS NODE 1 # CHECKERR(PLNID2[INDIX1]) ; #CHECKS NODE 2 ON THE TRUNK # END END END # END OF CHKTRUNK # CONTROL EJECT; PROC BLDNCB; BEGIN *IF,DEF,IMS # ** BLDNCB - BUILD NPU CONFIGURE BLOCKS. * * D.K. ENDO 81/10/13 * * THIS PROCEDURE BUILDS AN NCB FOR EACH NPU DEFINED AND WRITES IT * TO THE NCF. * * PROC BLDNCB * * ENTRY NONE. * * EXIT NONE. * * METHOD * * IF NO FATAL ERRORS, * INITIALIZE TABLES AND TABLE HEADERS. * FOR EACH ENTRY IN THE NPU TABLE, * CLEAR TABLES. * ENTER NPU INFORMATION. * ENTER PHYSICAL LINK AND LOGICAL LINK INFORMATION. * ENTER SUPERVISOR INFORMATION. * DO FINAL STEP TO COMPLETE NCB. * DE-ALLOCATE TABLES. * # *ENDIF # **** PROC BLDNCB - XREF LIST BEGINS. # XREF BEGIN PROC SSTATS; # ALLOCATES SPACE FOR TABLES ON REQUEST # END # **** # DEF CKSM$ENT # 0 #; # INITIAL CHECK SUM ENTRY -- ZERO # DEF RT$RS$ONE # 1 #; # ROUTING TABLE STATUS -- DISABLED # DEF RT$RS$TWO # 2 #; # ROUTING TABLE STATUS -- ROUTE TO OWN DN # DEF RT$RS$ZERO # 0 #; # ROUTING TABLE STATUS -- ENABLED # ITEM CRNT$NPU; # POINTER TO CRNT NPU IN NPU XREF TABLE # ITEM CRNT$SUP; # POINTER TO CRNT SUPLINK ENTRY # ITEM SUP$INDX; # CURRENT INDEX INTO SUPLINK TABLE # ARRAY END$IND [0:0] S(1); BEGIN # END OF NCB INDICATOR # ITEM END$IDENT U(0,44,8) = [O"105"]; ITEM END$ZBYT U(0,52,8) = [0]; END DEF MXNDT # 3 #; DEF NFBFLNGTH # O"1000" #; ARRAY NCF$BUFFER [0:NFBFLNGTH] S(1); BEGIN ITEM NCFWB (0,0,60); # CIO BUFFER FOR WRITING NCB-S # END ARRAY NODE$TABLE [0:MXNDT] S(1); BEGIN ITEM NDTNAME U(0,44,8); ITEM NDT$ENT U(0,52,8); ITEM NDT$TYP U(0,44,2); ITEM NDT$NID U(0,52,8); ITEM NDT$WRD U(0,44,16); END DEF MXNIT # 0 #; ARRAY NPU$INFO [0:MXNIT] S(1); BEGIN ITEM NIT$DP B(0,46,1); ITEM NIT$OP B(0,47,1); ITEM NIT$WRD U(0,44,16); END CONTROL EJECT; PROC BLDCNFG(BC$BPOS,BC$WC); BEGIN *IF,DEF,IMS # ** BLDCNFG - BUILD LINE CONFIGURATION TABLE(C-TABLE). * * D.K. ENDO 81/10/13 * * THIS PROCEDURE BUILDS THE LINE CONFIGURE TABLE AND * PACKS IT INTO THE NCB. * * PROC BLDCNFG(BC$BPOS,BC$WPOS) * * ENTRY BC$BPOS = CURRENT BIT POSITION IN THE NCB BUFFER. * BC$WPOS = CURRENT NPU WORD COUNT. * * EXIT BC$WPOS = UPDATED WORD COUNT WITH C-TABLE. * * METHOD * * SEARCH LINE CONFIG FILE INDEX FOR ENTRY FOR CURRENT NPU. * IF ENTRY WAS FOUND, * READ IN RECORD WITH CURRENT NPU-S LINE CONFIGURE INFO. * PUT THE ENTRY COUNT IN C-TABLE HEADER. * PUT C-TABLE IN THE NCB. * IF ENTRY WAS FOUND, * FOR ENTRY IN THE RECORD, * IF -NI- VALUE IS ZERO, * THEN, * PUT ENTRY IN THE NCB. * OTHERWISE, * FOR EACH ITERATION OF THE PORT NUMBER UNTIL -NI- VALUE * PUT ENTRY IN THE NCB. * # *ENDIF ITEM BC$BPOS; # CURRENT BIT POSITION IN NCB BUFFER # ITEM BC$WC; # TOTAL SIZE OF NCB IN NPU WORDS # # **** PROC BLDCNFG - XREF LIST BEGINS HERE. # XREF BEGIN PROC SSTATS; # ALLOCATES MORE TABLE SPACE ON REQUEST # PROC READ; # READS RECORD INTO BUFFER # PROC READW; # READS SPECIFIED NUMBER OF WORDS # PROC RECALL; # RETURNS CONTROL WHEN RECALL BIT IS SET # END # **** # ITEM CRNT$ENT; # POINTER TO CRNT ENTRY IN LINE CONF REC # ITEM ENTRY$LENG; # LENGTH OF CURRENT LINE ENTRY # ITEM FOUND B; # SET WHEN ENTRY IN INDEX IS FOUND # ITEM I; # SCRATCH ITEM # ITEM ITEMP; # INTEGER TEMPORARY # ITEM ITEMP2; # SECOND INTEGER TEMPORARY # ITEM NI$VALUE; # -NI- VALUE OF CURRENT LINE ENTRY # ITEM STATIS; # STATUS RETURNED BY READ # ARRAY C$TABLE$HDR [0:0] S(1); BEGIN ITEM CTAB$ID U(0,44,8) = [O"103"]; ITEM CTAB$ENT U(0,52,8); ITEM CTABWORD (0,0,60); END CONTROL EJECT; # # # BLDCNFG CODE BEGINS HERE # # # FOUND = FALSE; CTAB$ENT[0] = 0; # CLEAR CONFIG TABLE ENTRY COUNT # FOR I=2 STEP LCRENTSZ WHILE NOT FOUND AND I LS LCRWC[1] DO # SEARCH FOR ENTRY IN INDEX # BEGIN IF LCRNAME[I] EQ NPNAME[CRNT$NPU] THEN # IF ENTRY IS FOUND # BEGIN FOUND = TRUE; # SET FOUND FLAG # LR$RR[0] = LCRRANINDX[I+1]; # INITIALIZE FET TO READ # LRFIRST[0] = LOC(LCRWB); # THE RECORD # LRIN[0] = LOC(LCRWB); LROUT[0] = LOC(LCRWB); LRLIMIT[0] = LOC(LCRWB) + PRULNGTH + 1; LRCODE[0] = 3; LRILNG[0] = LCRWC[1] + 1; LRIFWA[0] = LOC(LIN$CON$INDX); READ(LRFET); # READ THE RECORD # RECALL(LRFET); CTAB$ENT[0] = LCRENT[I]; # PUT ENTRY COUNT IN C-TABL# END # HEADER # END PACKWDS(LOC(C$TABLE$HDR),BC$BPOS,1,BC$WC); # HEADER -> NCB BUFFR # IF FOUND # IF THERE WERE LINES DEFINED ON THIS NPU # THEN BEGIN STATIS = TRNS$OK; # INITIALIZE STATUS # FOR CRNT$ENT=0 WHILE STATIS EQ TRNS$OK DO # FOR EACH ENTRY # BEGIN # MOVE TEMPLET TO ENTRY # READW(LRFET,LIN$CON$REC,1,STATIS); # READ HEADER OF ENTRY # IF STATIS EQ TRNS$OK # IF NOT END OF RECORD # THEN BEGIN ENTRY$LENG = LCWC[0]; # SAVE LENGTH OF ENTRY # NI$VALUE = LCNI[0]; # SAVE -NI- VALUE FOR ENTRY # READW(LRFET,LIN$CON$REC,ENTRY$LENG,STATIS); IF NI$VALUE EQ 0 # IF NOT A GROUP DEFINITION # THEN BEGIN # PUT ENTRY IN NCB BUFFER # PACKWDS(P,BC$BPOS,ENTRY$LENG,BC$WC); END ELSE # THIS ENTRY IS A GROUP # BEGIN ITEMP2 = LCPORT[0] + NI$VALUE - 1; FOR ITEMP=LCPORT[0] STEP 1 UNTIL ITEMP2 DO # FOR EACH ITERATION # BEGIN # PUT ENTRY IN NCB BUFFER # LCPORT[0] = ITEMP; # SET PORT FIELD # PACKWDS(P,BC$BPOS,ENTRY$LENG,BC$WC); END END END END END RETURN; # **** RETURN **** # END # BLDCNFG # CONTROL EJECT; PROC LINK$INFO; BEGIN *IF,DEF,IMS # ** LINK$INFO - MAKE ENTRIES FOR TRUNKS AND COUPLERS. * * D.K. ENDO 81/10/21 * * THIS PROCEDURE ENTERS COUPLER AND TRUNK INFORMATION INTO THE * NODE, LINK, AND ROUTING TABLES. * * PROC LINK$INFO * * ENTRY NONE. * * EXIT NONE. * * METHOD * * FOR EACH ENTRY IN THE PHYSICAL LINK XREF TABLE: * SELECT CASE THAT APPLIES: * CASE 1(COUPLER): * IF THIS COUPLER BELONGS TO CURRENT NPU, * MAKE ENTRY IN N-TABLE FOR THIS COUPLER. * MAKE ENTRY IN L-TABLE FOR THIS COUPLER. * ENTER THE LINK ORDINAL FOR THIS COUPLER INTO R-TABLE. * DETERMINE ROUTING STATUS FOR THIS COUPLER. * CASE 2(TRUNK): * IF CURRENT NPU IS REFERENCED BY THIS TRUNK, * MAKE ENTRY IN L-TABLE FOR THIS TRUNK. * FOR EACH ENTRY IN THE LOGLINK XREF TABLE: * IF BOTH LOGLINK NPU NODE ID = BOTH TRUNK NODE ID, * IF ORIGIN NODE ID OF NPU = CURRENT NPU NODE ID, * THEN, * ENTER LINK ORDINAL IN R-TABLE ENTRY FOR TERM NODE. * OTHERWISE, * ENTER LINK ORDINAL IN R-TABLE ENTRY FOR HOST NODE. * # *ENDIF # **** PROC LINK$INFO - XREF LIST BEGINS. # XREF BEGIN PROC SSTATS; # ALLOCATES TABLE SPACE ON REQUEST # END # **** # DEF LKT$ST$ONE # 1 #; # LINK TABLE STATUS -- DISABLED # DEF LKT$ST$TWO # 2 #; # LINK TABLE STATUS -- ENABLED, NO LOAD # DEF LKT$TYP$TRNK # 1 #;# LINK TABLE TYPE -- INDICATES A TRUNK # ITEM I; # SCRATCH ITEM # ITEM J; # SCRATCH ITEM # ITEM RS$POS; # POINTER TO CURRENT ROUTING STAT POSITION# SWITCH LINKJUMP COUPLER, TRUNK; # LINK$INFO CODE BEGINS HERE # # # RS$POS = 2; # POINT TO 2ND ROUTING STATUS POSITION # FOR I=1 STEP 1 UNTIL PLWC[0] DO # FOR EACH ENTRY IN THE PHYSICAL LINK TAB # BEGIN IF LKT$LENG LQ LKT$ENT[0] + 1 THEN # NEED TO ALLOCATE MORE TABLE SPACE # BEGIN SSTATS(P,5); END GOTO LINKJUMP[PLTYPE[I]]; # JUMP TO APPROPRIATE PARAGRAPH # COUPLER: IF PLNID1[I] EQ NPNID[CRNT$NPU] THEN # IF CRNT NPU SUPPORTS THIS COUP# BEGIN NDT$ENT[0] = NDT$ENT[0] + 1; # MAKE ENTRY IN L-TABL# NDT$NID[NDT$ENT[0]] = PLHNID[I]; LKT$ENT[0] = LKT$ENT[0] + 1; # MAKE ENTRY IN N-TABL# LKT$ADD[LKT$ENT[0]] = PLLOC[I] + 1; RT$LO[PLHNID[I]] = LKT$ENT[0]; # ENTER LO IN R-TABLE # BRT$RS[PLHNID[I]] = RT$RS$TWO; FOR J=1 STEP 1 UNTIL LLWC[0] DO # DETERMINE ROUTING STATUS BY # BEGIN # GOING THRU LOGLINK XREF # IF LLHNID1[J] EQ PLHNID[I] THEN # HOST NODE 1 MATCHES CRNT COUP # BEGIN IF LLST[J] # IF LOGLINK IS DISABLE # THEN BEGIN # SET CORRESPONDING ROUTING STAT# BRT$RS[LLHNID2[J]] = RT$RS$ONE; END ELSE # LOGLINK IS ENABLED # BEGIN # SET CORRESPONDING ROUTING STAT# BRT$RS[LLHNID2[J]] = RT$RS$ZERO; END END ELSE # HOST NODE 1 DOES NOT MATCH CRNT COUPLER # BEGIN IF LLHNID2[J] EQ PLHNID[I] THEN # HOST NODE 2 MATCHES CRNT COUP # BEGIN IF LLST[J] # IF LOGLINK IS DISABLED # THEN BEGIN # SET CORRESPONDING ROUTING STAT# BRT$RS[LLHNID1[J]] = RT$RS$ONE; END ELSE # LOGLINK IS ENABLED # BEGIN # SET CORRESPONDING ROUTING STAT# BRT$RS[LLHNID1[J]] = RT$RS$ZERO; END END END END RS$POS = RS$POS + 2; # POINT TO NEXT ROUTING STATUS # END # POSITION # TEST I; TRUNK: IF PLNID1[I] EQ NPNID[CRNT$NPU] OR PLNID2[I] EQ NPNID[CRNT$NPU] THEN # IF CRNT NPU SUPPORTS THIS TRNK# BEGIN # MAKE TRUNK ENTRY IN L-TABLE # LKT$ENT[0] = LKT$ENT[0] + 1; LKT$FRAME[LKT$ENT[0]] = PLFRAME[I] ; # ASSIGN FRAME CODE # LKT$TYP[LKT$ENT[0]] = LKT$TYP$TRNK; IF PLNID1[I] EQ NPNID[CRNT$NPU] THEN # IF CRNT NPU IS NODE ID 1 # BEGIN LKT$ADD[LKT$ENT[0]] = PLP1[I]; # PUT PORT NUM IN ENTRY # RT$LO[PLNID2[I]] = LKT$ENT[0]; # PUT LINK ORD IN ROUT TBL# IF PLST[I] # IF TRUNK IS DISABLED # THEN BEGIN LKT$ST[LKT$ENT[0]] = LKT$ST$ONE; # ENTER STATUS # END ELSE # TRUNK IS ENABLED # BEGIN IF PLNLD2[I] # IF NOLOAD2 IS SET # THEN BEGIN LKT$ST[LKT$ENT[0]] = LKT$ST$TWO; # ENTER STATUS # END END END ELSE # CRNT NPU IS NODE ID 2 # BEGIN LKT$ADD[LKT$ENT[0]] = PLP2[I]; # PUT PORT NUM IN ENTRY # RT$LO[PLNID1[I]] = LKT$ENT[0]; # PUT LINK ORD IN ROUT TBL# IF PLST[I] # IF TRUNK IS DISABLED # THEN BEGIN LKT$ST[LKT$ENT[0]] = LKT$ST$ONE; # ENTER STATUS # END ELSE # TRUNK IS ENABLED # BEGIN IF PLNLD1[I] # IF NOLOAD1 IS SET # THEN BEGIN LKT$ST[LKT$ENT[0]] = LKT$ST$TWO; # ENTER STATUS # END END END FOR J=1 STEP 1 UNTIL LLWC[0] DO # ENTER LINK ORDINAL IN R-TABLE # BEGIN # BY GOING THRU LOGLINK XREF # IF (LLNID1[J] EQ PLNID1[I] AND LLNID2[J] EQ PLNID2[I]) OR (LLNID2[J] EQ PLNID1[I] AND LLNID1[J] EQ PLNID2[I]) THEN BEGIN IF LLNID1[J] EQ NPNID[CRNT$NPU] THEN # IF ORIGIN NODE ID OF NPU # BEGIN # MATCHES CRNT NPU NODE ID # RT$LO[LLHNID2[J]] = LKT$ENT[0]; END # ENTER LO IN T-NODE ID ENTRY # ELSE # ORIGIN AND CRNT NPU NODE ID DO NOT MATCH# BEGIN # ENTER LO IN HOST NODE ID ENTRY# RT$LO[LLHNID1[J]] = LKT$ENT[0]; END END END END END RETURN; # **** RETURN **** # END # LINK$INFO # CONTROL EJECT; PROC NCBINIT; BEGIN *IF,DEF,IMS # ** NCBINIT - NCB INITIALIZATION. * * D.K. ENDO 81/10/22 * * THIS PROCEDURE ALLOCATES AND INITIALIZES TABLES FOR BUILDING NCB. * * PROC NCBINIT * * ENTRY NONE. * * EXIT NONE. * * METHOD * * POINT NCF FET TO CIO BUFFER. * INITIALIZE VERSION TABLE. * CLEAR NPU INFO ENTRY. * INITIALIZE NODE TABLE. * ALLOCATE AND INITIALIZE LINK TABLE. * SORT THE PHYSICAL LINK TABLE. * DETERMINE THE MAXIMUM NODE I.D. USED. * ALLOCATE AND INITIALIZE ROUTING TABLE (SIZE = MAX NODE I.D.). * ALLOCATE AND INITIALIZE SUPERVISOR TABLE. * ALLOCATE AND INITIALIZE HOST TABLE. * ALLOCATE BUFFER FOR PACKING NCB IN. * # *ENDIF # **** PROC NCBINIT - XREF LIST BEGINS. # XREF BEGIN PROC SSTATS; # ALLOCATES TABLE SPACE ON REQUEST # END # **** # ITEM I; # SCRATCH ITEM # ITEM MAX$NID; # HIGHEST NODE I.D. USED # DEF COUP$TYPE # 0 #; # VALUE IN PLINK TBL INDICATING A COUPLER # DEF HT$ID # O"110" #; # HOST TABLE IDENTIFIER -- ASCII -H- # DEF LKT$ID # O"114" #; # LINK TABLE IDENTIFIER -- ASCII -L- # DEF NDT$ID # O"116" #; # NODE TABLE IDENTIFIER -- ASCII -N- # DEF RT$ID # O"122" #; # ROUTING TABLE IDENTIFIER -- ASCII -R- # DEF ST$ID # O"123" #; # SUPERVISORY TABLE IDENT -- ASCII -S- # DEF RT$TYP$TNODE # 1 #;# ROUTING TABLE TYPE FOR TERMINAL NODE # # NCBINIT CODE BEGINS HERE # # # NCFFIRST[0] = LOC(NCFWB[0]); # POINT NCF FET TO BUFFER # NCFIN[0] = LOC(NCFWB[0]); NCFOUT[0] = LOC(NCFWB[0]); NCFLIMIT[0] = LOC(NCFWB[0]) + NFBFLNGTH + 1; # INITIALIZE NPU INFORMATION ENTRY # NIT$WRD[0] = 0; # CLEAR ENTRY # # INITIALIZE NODE TABLE # FOR I=0 STEP 1 UNTIL MXNDT DO BEGIN NDT$WRD[I] = 0; # CLEAR NODE TABLE # END NDTNAME[0] = NDT$ID; # ENTER TABLE IDENTIFIER # # INITIALIZE LINK TABLE # SSTATS(P,MXLKT); # ALLOCATE SPACE FOR LINK TABLE# FOR I=0 STEP 1 UNTIL MXLKT DO BEGIN LKTWORD[I] = 0; # CLEAR TABLE # END LKTNAME[0] = LKT$ID; # ENTER TABLE IDENTIFIER # # INITIALIZE ROUTING TABLE # MAX$NID = 0; # CLEAR MAXIMUM NODE I.D. # FOR I=1 STEP 1 UNTIL NPWC[0] DO # CHECK NPU XREF FOR MAX NODE I.D. # BEGIN IF NPNID[I] GR MAX$NID THEN BEGIN MAX$NID = NPNID[I]; END END # SORT PHYSICAL LINK XREF TABLE # NDLSST(PLINK$XREF,2,0,42,2,PLWC[0]/2); FOR I=1 STEP 1 UNTIL PLWC[0] DO # CHECK PHYSICAL LINK XREF FOR MAX NODE ID# BEGIN IF PLTYPE[I] EQ COUP$TYPE THEN BEGIN IF PLHNID[I] GR MAX$NID THEN BEGIN MAX$NID = PLHNID[I]; END END END # ALLOC SPACE FOR ROUTING TABLE # SSTATS(P,MAX$NID + 1); FOR I=0 STEP 1 UNTIL MAX$NID DO BEGIN RTWORD[I] = 0; # CLEAR TABLE # END RTNAME[0] = RT$ID; # ENTER ROUTING TABLE IDENTIFIER # RT$ENT[0] = MAX$NID; # SET ENTRY COUNT # FOR I=1 STEP 1 UNTIL NPWC[0] DO # IDENTIFY TERMINAL NODES IN TABLE # BEGIN RT$TYP[NPNID[I]] = RT$TYP$TNODE; END # INITIALIZE SUPERVISOR TABLE # SSTATS(P,MXSUPT); # ALLOCATE SPACE FOR TABLE # FOR I=0 STEP 1 UNTIL MXSUPT DO BEGIN ST$WRD[0] = 0; # CLEAR TABLE # END ST$NAM[0] = ST$ID; # ENTER TABLE IDENTIFIER # # INITIALIZE HOST TABLE # SSTATS(P,MXHT); # ALLOCATE SPACE FOR TABLE # FOR I=0 STEP 1 UNTIL MXHT DO BEGIN HTWORD[I] = 0; # CLEAR TABLE # END HTNAME[0] = HT$ID; # ENTER TABLE IDENTIFIER # # ALLOC SPACE FOR LINE CONFIG REC BUFFER # IF LC$LENG LS MXLC THEN # IF NOT ENOUGH SPACE FOR ONE ENTRY # BEGIN SSTATS(P,MXLC - LC$LENG); END # INITIALIZE NCB BUFFER # SSTATS(P,MXNCB); # ALLOCATE SPACE FOR BUFFER # # OTHER INITIALIZATION # CRNT$SUP = 1; # INITIALIZE POINTER INTO SUPERVISOR TABLE# RETURN; # **** RETURN **** # END # NCBINIT # CONTROL EJECT; PROC NCBTERM; BEGIN *IF,DEF,IMS # ** NCBTERM - NCB TERMINATION * * D.K. ENDO 81/10/22 * * THIS PROCEDURE PACKS THE NCB AND CALLS LFG PROCEDURES TO FORMAT * IT INTO NPU DATA SERVICE MESSAGES. * * PROC NCBTERM * * ENTRY NONE. * * EXIT NONE. * * METHOD * * SORT HOST TABLE. * PACK TABLES INTO NCB BUFFER. * CALCULATE THE NUMBER OF PACKETS THE NCB IS.(PACKET = 105 NPU WRDS) * FOR EACH PACKET: * CALCULATE THE CHECK SUM. * MOVE WORDS INTO SM BUFFER. * CREATE SM HEADER AND WRITE TO NCF. * # *ENDIF # **** PROC NCBTERM - XREF LIST BEGINS. # XREF BEGIN PROC ABORT; # CAUSES NDLP TO ABORT # PROC LFGCKSM; # CALCULATE CHECK SUM # PROC LFGHDRW; # CREATES HEADER AND WRITES SM TO FILE # PROC LFGMOVW; # MOVES WORD INTO SM BUFFER # PROC MESSAGE; # SENDS MESSAGE TO DAYFILE # END # **** # XDEF BEGIN BASED ARRAY WFET [0:0] S(5); BEGIN # BASED ARRAY USED TO POINT TO NCF FET # ITEM WFET$WRD (0,0,60); END BASED ARRAY OUTPUT [0:0] S(5); BEGIN # BASED ARRAY USED TO POINT TO OUTPUT FET # ITEM OUTPUT$WRD (0,0,60); END END DEF DEFBC$ # 64 #; # DEFAULT BATCH COUNT VALUE # DEF BPOS # 36 #; # BIT POSITION COUNTED FROM LEFT FOR SHIFT# DEF NCF$MEMINC # 20 #; # NCF$INDEX DYNMC MEMORY ALLOC INCREMENTS # DEF PSIZE16 # 105 #; # PACKET SIZE IN 16 BIT WORDS # DEF PSIZE60 # 28 #; # PACKET SIZE IN 60 BIT WORDS # DEF WPOS # 2 #; # WORD POSITION FOR SHIFTING # ITEM BIT$POS; # CURRENT BIT POSITION FOR PACKING NCB # ITEM CKSUM; # CHECK SUM VALUE # ITEM CRNT$WORD; # POINTER TO NEXT PACKET IN NCB BUFFER # ITEM DUMMY; # SCRATCH ITEM # ITEM EOP B; # END OF PARTITION FLAG # ITEM I; # SCRATCH ITEM # ITEM IW60; # NUMBER OF 60 BIT WORDS MOVED # ITEM J; # SCRATCH ITEM # ITEM LPAK; # NUMBER OF 16 BIT WORDS IN LAST PACKET # ITEM NEW$P B; # NEW PARTITION FLAG # ITEM NPAK; # NUMBER OF PACKETS # ITEM NWDS16; # NUMBER OF 16 BIT WORDS # ITEM SUCCESS B; # STATUS FLAG RETURNED BY LFGHDRW # ITEM WC16; # NUMBER OF 16 BIT WORDS IN NCB # ARRAY INDEX$ENTRY [0:0] S(1); BEGIN ITEM IE$TYPE U(0,0,12) = [O"1603"]; # RECORD TYPE # ITEM IENID U(0,12,8); # NPU NODE I.D. # ITEM IEWC U(0,20,16); # NCB 16-BIT WORD CNT # ITEM IEZFIL U(0,36,24) = [0]; # ZERO FILL WORD # ITEM IEWORD (0,0,60); END ARRAY NCBERR [0:0] S(3); BEGIN ITEM NCBMSG C(0,0,20) = [" NCB CREATION ERROR."]; ITEM NCBZBYT (2,0,60) = [0]; END ARRAY RECORD$HDR [0:0] S(1); BEGIN ITEM RHNAME C(0,0,7) = ["NCB"]; # RECORD NAME # ITEM RHZFIL U(0,42,18) = [0]; # ZERO FILL WORD # ITEM RHWORD (0,0,60); END # # # NCBTERM CODE BEGINS HERE # # # WC16 = 0; BIT$POS = 0; NCBWC[0] = 1; # PACK CHECK SUM ENTRY INTO NCB BUFFER # I = 0; # SAME AS CKSM$ENT # PACKWDS(LOC(I),BIT$POS,1,WC16); # PACK NPU INFORMATION INTO NCB BUFFER # PACKWDS(LOC(NPU$INFO),BIT$POS,1,WC16); # PACK NODE TABLE INTO NCB BUFFER # PACKWDS(LOC(NODE$TABLE),BIT$POS,NDT$ENT[0]+1,WC16); # PACK LINK TABLE INTO NCB BUFFER # PACKWDS(P,BIT$POS,LKT$ENT[0] + 1,WC16); # PACK ROUTING TABLE INTO NCB BUFFER # PACKWDS(P,BIT$POS,RT$ENT[0]+1,WC16); # SORT HOST TABLE # FRST$WRD = 1; # OFFSET OF FIRST WORD TO BE SORTED # BBP = 0; # BEGINNING BIT POSITION OF KEY # MASK = 42; # LENGTH IN BITS OF KEY # NDLSST(HOST$TABLE,FRST$WRD,BBP,MASK,HTENTSZ,HT$ENT[0]); # SORT HOST TABLE # # PACK HOST TABLE INTO NCB BUFFER # NWDS16 = (HT$ENT[0] * HTENTSZ) + 1; PACKWDS(P,BIT$POS,NWDS16,WC16); # PACK SUPERVISOR TABLE INTO NCB BUFFER # PACKWDS(P,BIT$POS,ST$ENT[0] + 1,WC16); # BUILD LINE CONFIG TABLE AND PACK INTO BUFF# BLDCNFG(BIT$POS,WC16); # PACK END INDICATOR INTO NCB BUFFER # PACKWDS(LOC(END$IND),BIT$POS,1,WC16); # CALCULATE REST OF CHECK SUM AND PUT IN NCB# # CHECK SUM NCB AND ADD TO TOTAL # LFGCKSM(LOC(NCBWORD[1]),43,WC16-1,CKSUM); NPCKSM[CRNT$NPU] = NPCKSM[CRNT$NPU] + CKSUM; # CHECK SUM NPU XREF ENTRY AND ADD TO TOTAL # LFGCKSM(LOC(NPWORD[CRNT$NPU]),59,7,CKSUM); NPCKSM[CRNT$NPU] = NPCKSM[CRNT$NPU] + CKSUM; # CHECK SUM VERSION/LEVEL AND ADD TO TOTAL # LFGCKSM(LOC(PT$PVER[0]),15,1,CKSUM); NPCKSM[CRNT$NPU] = NPCKSM[CRNT$NPU] + CKSUM; NPCSSB[CRNT$NPU] = TRUE; # SET CHECK SUM SIGN BIT # B<0,16>NCBWORD[1] = NPCKSM[CRNT$NPU]; # PUT CHECK SUM IN NCB # # FORMAT NCB INTO SM AND WRITE TO NCF # NPAK = WC16 / PSIZE16; # CALCULATE NUMBER OF PACKETS # LPAK = WC16 - (NPAK * PSIZE16); # CALCULATE REMAINDER # IF LPAK NQ 0 # IF REMAINDER IS NOT ZERO # THEN BEGIN NPAK = NPAK + 1; # INCREMENT NUMBER OF PACKETS # END CRNT$WORD = 1; # SET POINTER TO 1ST WORD OF BUF# NEW$P = TRUE; # SET NEW PARTITION FLAG # NWDS16 = PSIZE16; # SET NUMBER OF WORDS IN PACKET # IENID[0] = NPNID[CRNT$NPU]; # PUT NPU NODE ID IN INDEX WORD # IEWC[0] = WC16; # PUT WORD COUNT IN INDEX WORD # J = 0; # CLEAR SCRATCH ITEM FOR BEGINNING ADDR # P = LOC(NCFFET); # POINT ARRAY TO NCF FET # P = LOC(OUTFET); # POINT ARRAY TO OUTPUT FET # EOP = FALSE; # CLEAR END OF PARTITION FLAG # IF NCF$LENG LQ (NCFWC[0]+1)*NCFENTSZ THEN # ALLOCATE MORE MEMORY FOR NCF # BEGIN # INDEX IF NEEDED # SSTATS(P,NCF$MEMINC); END FOR I=1 STEP 1 UNTIL NPAK DO # FOR EACH PACKET # BEGIN IF I EQ NPAK # IF THIS IS LAST PACKET # THEN BEGIN EOP = TRUE; # SET END OF PARTITION FLAG # IF LPAK NQ 0 # IF LAST PACKET IS SMALLER THAN OTHER # THEN # PACKETS # BEGIN NWDS16 = LPAK; # SET NUMBER OF WORDS TO PACKET SIZE # END END # CALCULATE CHECK SUM # LFGCKSM(LOC(NCBWORD[CRNT$WORD]),59,NWDS16,CKSUM); # MOVE WORDS INTO SM BUFFER # LFGMOVW(CRNT$WORD,WPOS,BPOS,NWDS16,IW60,CKSUM,NCB$BUFFER); # CREATE HEADER AND WRITE TO NCF # LFGHDRW(IEWORD[0],RHWORD[0],IW60,NWDS16,NEW$P,TRUE,EOP,J,DUMMY, SUCCESS,0,0,0,DEFBC$,NCF$INDEX); IF NOT SUCCESS THEN # IF NCB WRITE WAS NOT SUCCESSFUL # BEGIN MESSAGE(NCBERR,0); # PUT MESSAGE INTO DAYFILE # ABORT; # ABORT JOB # END CRNT$WORD = CRNT$WORD + PSIZE60; # MOVE POINTER TO NEXT PACKET # END RETURN; # **** RETURN **** # END # NCBTERM # CONTROL EJECT; PROC NPUINFO; BEGIN *IF,DEF,IMS # ** NPUINFO - NPU INFORMATION. * * D.K. ENDO 81/10/22 * * THIS PROCEDURE ENTERS NPU INFORMATION INTO THE NODE TABLE AND NPU * INFORMATION ENTRY. IT ALSO SETS THE ROUTING STATUS AND BUILDS THE * HOST TABLE. * * PROC NPUINFO * * ENTRY NONE. * * EXIT NONE. * * METHOD * * CLEAR THE NODE, LINK, HOST AND SUPERVISOR TABLES. * SET ALL THE ROUTING STATUS FIELDS TO -LOCKED-. * MAKE OP ENTRY IN NPU INFORMATION ENTRY. * MAKE ENTRY IN NODE TABLE FOR CRNT NPU. * SET ROUTING STATUS FOR CRNT NPU TO -ROUTING TO SELF-. * FOR EACH ENTRY IN THE LOGLINK XREF TABLE: * IF CURRENT NPU NODE ID = TERMINAL NODE ID OF THIS LOGLINK, * IF LOGLINK IS DISABLED, * THEN, * SET THE STATUS CORRESPONDING TO THE HOST NODE TO -DISABLED-. * OTHERWISE, * SET THE STATUS CORRESPONDING TO THE HOST NODE TO -ENABLED-. * MAKE ENTRY IN HOST TABLE FOR THIS HOST. * # *ENDIF # **** PROC NPUINFO - XREF LIST BEGINS. # XREF BEGIN PROC SSTATS; # ALLOCATES MORE TABLE SPACE ON REQUEST # END # **** # DEF NDT$TNODE # 1 #; # VALUE INDICATING TERMINAL NODE # ITEM HT$PNTR; # POINTER INTO HOST TABLE # ITEM I; # SCRATCH ITEM # ITEM J; # SCRATCH ITEM # DEF MXAT # 45 #; ARRAY ASCII$TABLE [0:MXAT] S(1); # TABLE TO CONVERT DISPLAY CODE # BEGIN # TO ASCII # ITEM A$CHAR (0,0,60) = [O"72", # COLON # O"101", # A # O"102", # B # O"103", # C # O"104", # D # O"105", # E # O"106", # F # O"107", # G # O"110", # H # O"111", # I # O"112", # J # O"113", # K # O"114", # L # O"115", # M # O"116", # N # O"117", # O # O"120", # P # O"121", # Q # O"122", # R # O"123", # S # O"124", # T # O"125", # U # O"126", # V # O"127", # W # O"130", # X # O"131", # Y # O"132", # Z # O"060", # 0 # O"061", # 1 # O"062", # 2 # O"063", # 3 # O"064", # 4 # O"065", # 5 # O"066", # 6 # O"067", # 7 # O"070", # 8 # O"071", # 9 # ,,,,,,,, # +,-,*,/,(,>,$,= # O"040" # BLANK # ]; END CONTROL EJECT; # # # NPUINFO CODE BEGINS HERE # # # # CLEAR AND INITIALIZE TABLES # NIT$WRD[0] = 0; # CLEAR NPU INFO ENTRY # NDT$ENT[0] = 0; # CLEAR NODE TABLE ENTRY COUNT # FOR I=1 STEP 1 UNTIL MXNDT DO BEGIN NDT$WRD[I] = 0; # CLEAR NODE TABLE # END LKT$ENT[0] = 0; # CLEAR LINK TABLE ENTRY COUNT # FOR I=1 STEP 1 UNTIL LKT$LENG-1 DO BEGIN LKTWORD[I] = 0; # CLEAR ENTRY COUNT # END FOR I=1 STEP 1 UNTIL RT$ENT[0] DO BEGIN RT$RS[I] = O"77"; # SET ROUTING STATUS TO LOCKED # RT$LO[I] = 0; # CLEAR POINTERS TO LINK TABLE # END HT$ENT[0] = 0; # CLEAR HOST TABLE ENTRY COUNT # FOR I=1 STEP 1 UNTIL HT$LENG - 1 DO BEGIN HTWORD[I] = 0; # CLEAR HOST TABLE # END HT$PNTR = 1; # INITIALIZE CRNT POINTER INTO TABLE # ST$ENT[0] = 0; # CLEAR SUPERVISOR TABLE ENTRY COUNT # FOR I=1 STEP 1 UNTIL ST$LENG - 1 DO BEGIN ST$WRD[I] = 0; # CLEAR SUPERVISOR TABLE # END # ENTER NPU INFORMATION # NIT$DP[0] = NPDMP[CRNT$NPU]; # SET DUMP FLAG # NIT$OP[0] = NPOPGO[CRNT$NPU]; # SET OPERATOR GO STATUS # NDT$ENT[0] = 1; # SET NODE TABLE ENTRY COUNT # NDT$TYP[NDT$ENT[0]] = NDT$TNODE; # SET 1ST ENTRY TO TERMINAL NODE# NDT$NID[NDT$ENT[0]] = NPNID[CRNT$NPU]; # SET NODE I.D. # B<0,2>RT$RS[NPNID[CRNT$NPU]] = RT$RS$TWO; # SET STATUS # FOR I=1 STEP 1 UNTIL LLWC[0] DO # FOR EACH ENTRY IN THE LOGLINK # BEGIN # XREF TABLE # IF LLHNID2[I] EQ NPNID[CRNT$NPU] THEN # IF LOGLINK IS TO CRNT NPU # BEGIN # SET ROUTING STATUS # IF LLST[I] THEN BEGIN # SET STATUS TO DISABLED # B<0,2>RT$RS[LLHNID1[I]] = 1; END ELSE BEGIN # SET STATUS TO ENABLED # B<0,2>RT$RS[LLHNID1[I]] = 0; END HT$ENT[0] = HT$ENT[0] + 1; # INCREMENT HOST TABLE ENTRY CNT# IF HT$ENT[0] * HTENTSZ GQ HT$LENG THEN # IF NEED MORE TABLE SPACE # BEGIN SSTATS(P,HTENTSZ); # ALLOCATE MORE SPACE # END HT$SORT[HT$PNTR] = LLHNAME[I]; # ENTER HOST NAME TO BE # # SORTED # HT$RO[HT$PNTR] = LLHNID1[I]; # ENTER ROUTING ORDINAL # HT$CH2[HT$PNTR] = A$CHAR[C<0,1>LLHNAME[I]]; HT$PNTR = HT$PNTR + 1; FOR J=1 STEP 2 UNTIL 5 DO # CONVERT HOST NAME TO ASCII AND PUT IN # BEGIN # TABLE # HT$CH1[HT$PNTR] = A$CHAR[CLLHNAME[I]]; HT$CH2[HT$PNTR] = A$CHAR[CLLHNAME[I]]; HT$PNTR = HT$PNTR + 1; END END END RETURN; # **** RETURN **** # END # NPUINFO # CONTROL EJECT; PROC PACKWDS(TABLE,BIT,WC,TOTALWC); BEGIN *IF,DEF,IMS # ** PACKWDS - PACK WORDS INTO NCB BUFFER. * * D.K. ENDO 81/10/22 * * THIS PROCEDURE, GIVEN A TABLE, PACKS THE TABLE INTO THE NCB * BUFFER. * * PROC PACKWDS(TABLE,BIT,WC,TOTALWC) * * ENTRY TABLE = NCB TABLE TO BE PACKED. * BIT = CURRENT BIT TO BEGIN PACKING WORDS. * WC = TOTAL NUMBER OF NPU WORDS IN TABLE. * TOTALWC = TOTAL NUMBER OF NPU WORDS PACKED SO FAR. * * EXIT TOTALWC = TOTAL NUMBER OF NPU WORDS INCLUDING TABLE * JUST PACKED. * * METHOD * * FOR EACH NPU WORD: * IT CAN FIT AT LEAST ONE MORE NPU INTO CRNT CP WORD, * THEN, * PACK NPU WORD. * INCREMENT BIT POSITION. * OTHERWISE, * IF BIT POSITION POINTS TO END OF CP WORD, * THEN, * INCREMENT CP WORD COUNT. * POINT BIT POSITION TO BEGINNING OF NEW WORD. * PACK NPU WORD * INCREMENT BIT POSITION * OTHERWISE, * CALCULATE REMAINING SPACE IN CP WORD * PACK WHAT CAN FIT OF NPU WORD * INCREMENT CP WORD COUNT * POINT BIT POSITION TO BEGINNING OF NEW WORD. * PACK REMAINDER OF NPU WORD * RE-SET BIT POSITION. * # *ENDIF BASED ARRAY TABLE [1:1] S(1); BEGIN ITEM T$ENT U(0,44,16); END ITEM BIT; # CURRENT BIT POSITION # ITEM WC; # WORD COUNT OF TABLE # ITEM TOTALWC; # TOTAL WORD COUNT IN NCB # # # ITEM INDX; # INDEX FOR TABLE # ITEM J; # SCRATCH ITEM # ITEM K; # SCRATCH ITEM # CONTROL EJECT; # # # PACKWDS CODE BEGINS HERE # # # FOR INDX=1 STEP 1 UNTIL WC DO # FOR EACH ENTRY IN TABLE # BEGIN IF BIT LQ 44 # IF CAN FIT AT LEAST ONE MORE ENTRY # THEN BEGIN # PACK INTO NCB BUFFER # BNCBWORD[NCBWC[0]] = T$ENT[INDX]; BIT = BIT + 16; # INCREMENT BIT POSITION # END ELSE # CAN NOT FIT ONE ENTRY # BEGIN IF BIT EQ 60 # IF POINTER IS AT VERY END OF WORD # THEN BEGIN BIT = 0; # RESET BIT POSITION TO BEGIN # NCBWC[0] = NCBWC[0] + 1; # INCREMENT BUFFER WORD COUNT # IF NCBWC[0] GQ NCB$LENG # IF LENGTH REACHES TABLE SPACE # THEN BEGIN SSTATS(P,50); END BNCBWORD[NCBWC[0]] = T$ENT[INDX]; # PACK ENTRY # BIT = 16; # RESET BIT POSITION # END ELSE # MUST DIVIDE ENTRY OVER TWO WORDS # BEGIN J = 60 - BIT; # CALCULATE REMAINDER OF WORD # BNCBWORD[NCBWC[0]] = B<0,J>T$ENT[INDX]; # PACK ENTRY# NCBWC[0] = NCBWC[0] + 1; # INCREMENT NCB WORD COUNT # IF NCBWC[0] GQ NCB$LENG # IF LENGTH REACHES TABLE SPACE # THEN BEGIN SSTATS(P,50); END BIT = 0; # RESET BIT POSITION # K = 16 - J; # CALCULATE REMAINDER OF ENTRY # BNCBWORD[NCBWC[0]] = BT$ENT[INDX]; # PACK ENTRY# BIT = K; # RESET BIT POSITION # END END END TOTALWC = TOTALWC + WC; # INCREMENT TOTAL WORD COUNT # RETURN; # **** RETURN **** # END # PACKWDS # CONTROL EJECT; # # # BLDNCB CODE BEGINS HERE # # # IF ERRCNT EQ 0 # IF NO FATAL ERRORS WERE DETECTED # THEN BEGIN # INITIALIZE TABLES AND TABLE HEADERS # NCBINIT; FOR CRNT$NPU=1 STEP 1 UNTIL NPWC[0] DO BEGIN NPUINFO; # CLEAR TABLES AND ENTER NPU INFORMATION # LINK$INFO; # ENTER PHYSICAL LINK INFORMATION # FOR SUP$INDX=CRNT$SUP STEP 1 WHILE (SLTNID[SUP$INDX] EQ NPNID[CRNT$NPU]) AND NOT (SUP$INDX GR SLTWC[0]) DO # FOR EACH SUPERVISORY LINK FOR THIS NPU # BEGIN ST$ENT[0] = ST$ENT[0] + 1; # INCREMENT ENTRY COUNT # IF ST$ENT[0] GR ST$LENG # IF NEED MORE TABLE SPACE, # THEN # REQUEST FOR MORE # BEGIN SSTATS(P,5); END ST$TYP[ST$ENT] = SLTTYPE[SUP$INDX]; # ENTER TYPE # ST$RO[ST$ENT] = SLTHNID[SUP$INDX]; # ENTER ROUTING ORD # END CRNT$SUP = SUP$INDX; NCBTERM; # PACK TABLE, BUILD C-TABLE, FORMAT SM, # END # WRITE TO NCF # # RETURN TABLE SPACE # SSTATS(P,-LKT$LENG); SSTATS(P,-RT$LENG); SSTATS(P,-ST$LENG); SSTATS(P,-HT$LENG); SSTATS(P,-NCB$LENG); SSTATS(P,-LC$LENG); END RETURN; # **** RETURN **** # END # BLDNCB # CONTROL EJECT; # # # NDLNFTM CODE BEGINS HERE # # # CHKTRUNK ; #CALLS PROC THAT CHECKS PORTS # BLDNCB; # CALL PROC THAT BUILDS NCB-S # # # FRST$WRD = 2; # SET POINTER TO 1ST WORD TO BE SORTED # BBP = 0; # SET BEGINNING BIT POSITION POINTER # MASK = 42; # SET NUMBER OF BITS TO BE USED AS KEY # # SORT NPU XREF TABLE AND WRITE TO NCF # NDLSST(NPU$XREF,FRST$WRD,BBP,MASK,NPENTSZ,NPWC[0]); # SORT TABLE # NPWC[0] = (NPWC[0] * NPENTSZ) + 1; # CALCULATE WORD COUNT # LENGTH = NPWC[0]+1; # SAVE LENGTH OF TABLE # NDLWNCF(TABLE"NX",P,LENGTH); # WRITE NPU XREF TO NCF # # SORT PHYS LINK XREF TBL AND WRITE TO NCF # NDLSST(PLINK$XREF,FRST$WRD,BBP,MASK,PLENTSZ,PLWC[0]); #SORT TABLE# PLWC[0] = (PLWC[0] * PLENTSZ) + 1; # CALCULATE WORD COUNT # LENGTH = PLWC[0] + 1; # SAVE LENGTH OF TABLE # NDLWNCF(TABLE"PH",P,LENGTH); #WRT PHYS LNK TBL TO NCF# # SORT LOGLINK XREF TABLE AND WRITE TO NCF # NDLSST(LOGLINK$XREF,FRST$WRD,BBP,MASK,LLENTSZ,LLWC[0]); LLWC[0] = (LLWC[0] * LLENTSZ) + 1; # CALCULATE WORD COUNT # LENGTH = LLWC[0] + 1; # SAVE LENGTH OF TABLE # NDLWNCF(TABLE"LL",P,LENGTH); #WRITE LL XREF TO NCF# # SORT LINE XREF TABLE AND WRITE TO NCF # ENT$CNT = LCTWC[1] - 1; # CALCULATE ENTRY SIZE # NDLSST(LINE$XREF,FRST$WRD,BBP,MASK,LCTENTSZ,ENT$CNT); LENGTH = LCTWC[1] + 1; # SAVE LENGTH OF TABLE # NDLWNCF(TABLE"LX",P,LENGTH); # WRITE LINE XREF TO NCF# # SORT DEVICE XREF TABLE AND WRITE TO NCF # ENT$CNT = DCWC[1] - 1; # CALCULATE ENTRY COUNT # NDLSST(DEVICE$XREF,FRST$WRD,BBP,MASK,DCENTSZ,ENT$CNT); LENGTH = DCWC[1] + 1; # SAVE LENGTH OF TABLE # NDLWNCF(TABLE"DX",P,LENGTH); #WRITE DEV XREF TO NCF# # SORT LINE RECORD INDEX AND WRITE TO NCF # MASK = 24; #CHANGE MASK, FRST$WRD AND BBP REMAIN SAME# ENT$CNT = LIWC[1] - 1; # CALCULATE ENTRY COUNT # NDLSST(LIN$REC$INDX,FRST$WRD,BBP,MASK,LIENTSZ,ENT$CNT); LENGTH = LIWC[1] + 1; # SAVE LENGTH OF TABLE # NDLWNCF(TABLE"LI",P,LENGTH); #WRTE LREC INDX TO NCF# # # IF ERRCNT EQ 0 # NO FATAL ERRORS HAVE BEEN DETECTED # THEN BEGIN NCFGOOD[0] = TRUE; # SET FLAG INDICATING NCF IS GOOD # END ELSE # FATAL ERRORS DETECTED # BEGIN NCFGOOD[0] = FALSE; # CLEAR GOOD NCF FLAG # PT$TITLE[0] = NCF$EMSG; # PUT ERROR MSG IN RECORD HEADER# END MASK = 20; # SET MASK FOR SORT ON NCF INDEX # NDLSST(NCF$INDEX,FRST$WRD,BBP,MASK,NCFENTSZ,NCFWC[0]); NCFWC[0] = (NCFWC[0] * NCFENTSZ) + 1; # CONVERT TO WORD COUNT # ITEMP = NCFWC[0]; # SAVE INDEX WORD COUNT IN TEMPORARY # MOVEI(NCFWC[0]+1,LOC(NCF$INDEX),LOC(NCF$INDEX)+PT$SIZE); MOVEI(PT$SIZE,LOC(PRFX$TABLE),LOC(NCF$INDEX)); NDLWNCF(TABLE"NI",P,PT$SIZE + ITEMP + 1); NDLEM2(0,0,0); # FLUSH OUT PASS 2 ERROR FILE BUFFER # # RETURN TABLE SPACE NOT NEEDED # SSTATS(P,-CM$LENG); SSTATS(P,-CT$LENG); SSTATS(P,-DC$LENG); SSTATS(P,-LCR$LENG); SSTATS(P,-LC$LENG); SSTATS(P,-LI$LENG); SSTATS(P,-LR$LENG); SSTATS(P,-LCT$LENG); SSTATS(P,-LLT$LENG); SSTATS(P,-LL$LENG); SSTATS(P,-NCF$LENG); SSTATS(P,-NT$LENG); SSTATS(P,-NP$LENG); SSTATS(P,-PL$LENG); SSTATS(P,-SLT$LENG); SSTATS(P,-TNI$LENG); RETURN; # **** RETURN **** # END # NDLNFTM # TERM