User Tools

Site Tools


cdc:nos2.source:nam5871:ns_bnct

NS$BNCT

Table Of Contents

  • [00016] BUILD NODE CONNECTION TABLE (NCT).

Source Code

NS$BNCT.txt
  1. *DECK NS$BNCT
  2. USETEXT COM$NS
  3. USETEXT DEF$NS
  4. USETEXT DIR$NS
  5. USETEXT FERR$NS
  6. USETEXT FET$NS
  7. USETEXT IOD$NS
  8. USETEXT NCF$NS
  9. USETEXT NCT$NS
  10. PROC NS$BNCT; # BUILD NODE CONNECTION TABLE #
  11.  
  12. # TITLE NS$BNCT - BUILD NODE CONNECTION TABLE. #
  13.  
  14. BEGIN # NS$BNCT #
  15. #
  16. ** NS$BNCT - BUILD NODE CONNECTION TABLE (NCT).
  17. *
  18. * J.C. LEE 1981
  19. *
  20. * THIS ROUTINE IS PART OF THE INITIALIZATION PROCESS FOR NS.
  21. * ITS FUNCTION IS TO BUILD THE NODE CONNECTION TABLE.
  22. *
  23. * PROC NS$BNCT
  24. *
  25. * ENTRY:
  26. * NONE.
  27. *
  28. * EXIT:
  29. * ERROR MESSAGE(S) SENT IF ERROR IS DETECTED.
  30. *
  31. * METHOD:
  32. * SEARCH NCF INDEX RECORD FOR PHYSICAL LINK CROSS REFERENCE
  33. * ENTRY TABLE RECORD.
  34. * IF FOUND:
  35. * FOR EACH ENTRY IN PHYSICAL LINK CROSS REFERENCE TABLE:
  36. * INCREMENT NCT ENTRY COUNT.
  37. * IF ENTRY IS A COUPLER ENTRY, MAKE A HOST NODE ENTRY IN
  38. * NCT.
  39. * ELSE
  40. * MAKE TWO NPU NODE ENTRIES IN NCT.
  41. * INCREMENT NCT ENTRY COUNT.
  42. * ELSE
  43. * SEND ERROR MESSAGES.
  44. *
  45. #
  46.  
  47. XREF
  48. BEGIN
  49. PROC EXREDUC; # REDUCE TSB SIZE #
  50. PROC NS$MSG; # DISPATCH MESSAGE #
  51. PROC READ; # READ A RECORD #
  52. PROC RECALL; # WAIT FOR OPERATION TO FINISH #
  53. PROC REQTSB; # REQUEST TSB #
  54. PROC RETTSB; # RETURN TSB #
  55. PROC TSBINFO; # GET TSB ADDRESS #
  56. END
  57.  
  58. DEF MIN$PHL$WC # 3 #; # MINIMUM PHYLINK TABLE WORD COUNT #
  59.  
  60. ITEM BUFL U; # CALCULATED PHYLINK TABLE BUFFER LENGTH #
  61. ITEM ERRCODE U; # ERROR CODE #
  62. ITEM FETTSBADDR U; # FET TSB ADDRESS #
  63. ITEM I U; # LOOP INDEX #
  64. ITEM NCTORD U; # NCT ORDINAL #
  65. ITEM NCTTSBADDR U; # NCT TSB ADDRESS #
  66. ITEM ORD U; # NCT ORDINAL #
  67. ITEM PHLDIRORD U; # NCF DIRECTORY ORDINAL OF PHYLINK TABLE #
  68. ITEM PHLTSBADDR U; # PHYLINK TABLE TSB ADDRESS #
  69. ITEM PHLTSBN U; # PHYLINK TABLE TSB NUMBER #
  70. ITEM SUCCESS B; # LOOP END INDICATOR #
  71. ITEM TSBSIZE U; # TSB SIZE #
  72. ITEM UP U; # LOOP LIMIT #
  73.  
  74. DEF L$NCFERR # 3 #;
  75. DEF DM$NCFERR # DM$LOCAL+DM$ABORT+DM$NAMLOG #; # ROUTE OPTIONS #
  76. ARRAY MSG$NCFERR [0:0] S(L$NCFERR);
  77. BEGIN
  78. ITEM NCFERR$TXT C(00,00,23) = # MESSAGE TEXT #
  79. ["BAD NCF PHYLINK RECORD."];
  80. ITEM NCFERR$END U(02,18,42) = [0]; # END OF TEXT #
  81. END
  82.  
  83. CONTROL EJECT;
  84.  
  85. # BASED ARRAY POINTERS OF SIOFET AND DIR PRESET IN NS$NSI #
  86.  
  87. ERRCODE = 0;
  88. SUCCESS = FALSE;
  89. UP = (DIR$WC[0] - 1)/DIR$ENTRYL; # NUMBER OF ENTRIES IN DIR #
  90. FOR I = 1 STEP 1 WHILE I LQ UP
  91. AND NOT SUCCESS
  92. DO
  93. BEGIN # FIND PHYLINK DIRECTORY ENTRY #
  94. IF DIR$NCFRT[I] EQ DIR$RT$PH
  95. THEN # FOUND #
  96. BEGIN
  97. SUCCESS = TRUE; # END LOOP #
  98. PHLDIRORD = I;
  99. END
  100. END
  101. IF NOT SUCCESS
  102. THEN # PHYLINK DIRECTORY ENTRY NOT FOUND #
  103. NS$MSG(MSG$NCFERR,L$NCFERR,DM$NCFERR); # DAYFILE AND ABORT #
  104. BUFL = ((DIR$RL[PHLDIRORD] + PRUSIZE)/PRUSIZE)*PRUSIZE + 1;
  105. REQTSB(BUFL,PHLTSBADDR,PHLTSBN); # GET PHYLINK TABLE BUFFER #
  106. FETRAN[0] = TRUE; # NCF IS A RANDOM ACCESS FILE #
  107. FETFST[0] = PHLTSBADDR; # FIRST #
  108. FETIN[0] = PHLTSBADDR;
  109. FETOUT[0] = PHLTSBADDR;
  110. FETLMT[0] = PHLTSBADDR + BUFL; # LIMIT #
  111. FETRR[0] = DIR$RSA[PHLDIRORD]; # RANDOM REQUEST #
  112. READ(SIOFET); # READ PHYLINK RECORD FROM NCF #
  113. RECALL(SIOFET);
  114. P<PHL$NCF> = PHLTSBADDR; # FORMAT PHYLINK TABLE #
  115. IF FETSTAT[0] NQ RDEOR
  116. OR PHL$ID[0] NQ PHL$IDENT
  117. OR PHL$WC[0] LS MIN$PHL$WC
  118. THEN # BAD PHYLINK RECORD #
  119. NS$MSG(MSG$NCFERR,L$NCFERR,DM$NCFERR); # DAYFILE AND ABORT #
  120. REQTSB(DIR$RL[PHLDIRORD],NCTTSBADDR,NCTTSBN); # GET NCT BUFFER #
  121. P<NCT$NS> = NCTTSBADDR; # FORMAT NCT #
  122. NCT$ID[0] = NCT$IDENT;
  123. NCTORD = 0; # INITIALIZE #
  124. UP = (PHL$WC[0] - 1)/PHL$ENTRYL; # NO. OF ENTRIES #
  125. FOR I = 1 STEP 1 UNTIL UP
  126. DO
  127. BEGIN # BUILD EACH NCT ENTRY #
  128. NCT$LISTFP[NCTORD] = NCTORD + 1; # SET FORWARD LIST POINTER #
  129. NCTORD = NCTORD + 1;
  130. IF NOT PHL$F$LTRK[I]
  131. THEN # ITS A COUPLER PHYLINK TABLE ENTRY #
  132. BEGIN
  133. NCT$NODE[NCTORD] = PHL$PLP1[I]; # COUPLER NODE NUMBER #
  134. NCT$NNN[NCTORD] = PHL$PLNID1[I]; # NPU NODE NUMBER #
  135. END
  136. ELSE # ITS A TRUNK PHYLINK TABLE ENTRY #
  137. BEGIN
  138. ORD = NCTORD; # CURRENT NCT ORDINAL #
  139. NCT$NODE[ORD] = PHL$PLNID1[I]; # NPU NODE NUMBER #
  140. NCT$PN[ORD] = PHL$PLP1[I]; # PORT NUMBER #
  141. NCT$NNN[ORD] = PHL$PLNID2[I]; # NEIGHBOR NODE NUMBER #
  142. NCT$LISTBP[ORD] = NCTORD - 1; # NCT BACKWARD PTR #
  143. NCT$LISTFP[ORD] = NCTORD + 1; # NCT FORWARD PTR #
  144. NCTORD = NCTORD + 1;
  145. NCT$NODE[NCTORD] = PHL$PLNID2[I]; # NPU NODE NUMBER #
  146. NCT$PN[NCTORD] = PHL$PLP2[I]; # PORT NUMBER #
  147. NCT$NNN[NCTORD] = PHL$PLNID1[I]; # NEIGHBOR NODE NUMBER #
  148. END
  149. NCT$LISTBP[NCTORD] = NCTORD - 1; # SET BACKWARD LIST POINTER #
  150. END
  151. NCT$LISTFP[NCTORD] = 0; # SET FORWARD PTR OF LAST NCT #
  152. NCT$LISTTP[0] = NCTORD; # LIST TAIL POINTER #
  153. NCT$EC[0] = NCTORD; # ENTRY COUNT #
  154. BUFL = DIR$RL[PHLDIRORD] - (NCTORD*NCT$ENTRYL + NCT$HDRL);
  155. EXREDUC(BUFL,NCTTSBN,0,NCTTSBADDR);
  156. RETTSB(PHLTSBN); # RETURN PHYLINK TABLE BUFFER #
  157. END TERM
cdc/nos2.source/nam5871/ns_bnct.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator