User Tools

Site Tools


cdc:nos2.source:nam5871:ns_bnpt

NS$BNPT

Table Of Contents

  • [00018] BUILD NPU TABLE (NPT).

Source Code

NS$BNPT.txt
  1. *DECK NS$BNPT
  2. USETEXT COM$NS
  3. USETEXT CYB$NS
  4. USETEXT DEF$NS
  5. USETEXT DIR$NS
  6. USETEXT FERR$NS
  7. USETEXT FET$NS
  8. USETEXT IOD$NS
  9. USETEXT NCF$NS
  10. USETEXT NCT$NS
  11. USETEXT NPT$NS
  12. PROC NS$BNPT; # BUILD CONFIGURED NPU TABLE #
  13.  
  14. # TITLE NS$BNPT - BUILD CONFIGURED NPU TABLE. #
  15.  
  16. BEGIN # NS$BNPT #
  17. #
  18. ** NS$BNPT - BUILD NPU TABLE (NPT).
  19. *
  20. * J.C. LEE 1981
  21. *
  22. * THIS ROUTINE IS PART OF THE INITIALIZATION PROCESS FOR NS.
  23. * ITS FUNCTION IS TO BUILD THE NPU TABLE.
  24. *
  25. * PROC NS$BNPT
  26. *
  27. * ENTRY:
  28. * NONE.
  29. *
  30. * EXIT:
  31. * APPROPRIATE ERROR MESSAGES SENT.
  32. *
  33. * METHOD:
  34. * SEARCH NCF INDEX RECORD FOR NPU CROSS REFERENCE TABLE RECORD
  35. * ENTRY.
  36. * IF FOUND:
  37. * ALLOCATE TSB FOR NPT.
  38. * FOR EACH NETRY IN NPU CROSS REFERENCE TABLE:
  39. * FORMAT A NPT ENTRY
  40. * INCREMENT NPU TABLE ORDINAL
  41. * SEARCH NCB RECORD FOR A MATCH ON NPU NODE NUMBER,
  42. * USE THIS NUMBER TO SEARCH NCT TO ACCESS THE
  43. * NETWORK NUMBER. SAVE THIS NETWORK NUMBER AS
  44. * THE NEIGHBOR NODE NUMBER IN NPT. SAVE CURRENT
  45. * NPU TABLE ORDINAL IN NCT.
  46. * ELSE
  47. * SEND ERROR MESSAGE.
  48. *
  49. #
  50.  
  51. XREF
  52. BEGIN
  53. PROC NS$MSG; # DISPATCH MESSAGE #
  54. PROC READ; # READ A RECORD #
  55. PROC RECALL; # WAIT FOR OPERATION TO FINISH #
  56. PROC REQTSB; # REQUEST TSB #
  57. PROC RETTSB; # RETURN TSB #
  58. PROC TSBINFO; # GET TSB ADDRESS #
  59. END
  60.  
  61. DEF MIN$NXR$WC # 3 #; # MINIMUM NPUXREF TABLE SIZE #
  62.  
  63. ITEM BUFL U; # CALCULATED NPUXREF TABLE BUFFER LENGTH #
  64. ITEM ERRCODE U; # ERROR CODE #
  65. ITEM FETTSBADDR U; # FET TSB ADDRESS #
  66. ITEM I U; # LOOP INDEX #
  67. ITEM J U; # LOOP INDEX #
  68. ITEM NCBDIRORD U; # NCB DIRECTORY ORDINAL #
  69. ITEM NCTTSBADDR U; # NCT TSB ADDRESS #
  70. ITEM NPTLENGTH U; # LENGTH OF NPU TABLE #
  71. ITEM NPTTSBADDR U; # NPU TABLE TSB ADDRESS #
  72. ITEM NXRDIRORD U; # NPUXREF TABLE NCF DIRECTORY ORDINAL #
  73. ITEM NXRTSBADDR U; # NPUXREF TABLE TSB ADDRESS #
  74. ITEM NXRTSBN U; # NPUXREF TSB NUMBER #
  75. ITEM SUCCESS B; # LOOP END INDICATOR #
  76. ITEM TEMP U; # TEMPORARY #
  77. ITEM TSBSIZE U; # TSB SIZE #
  78. ITEM UPI U; # LOOP LIMIT #
  79. ITEM UPJ U; # LOOP LIMIT #
  80.  
  81. DEF L$NCFER1 # 3 #;
  82. DEF DM$NCFER1 # DM$LOCAL+DM$ABORT+DM$NAMLOG #; # ROUTE OPTIONS #
  83. ARRAY MSG$NCFER1 [0:0] S(L$NCFER1);
  84. BEGIN
  85. ITEM NCFER1$TXT C(00,00,25) = # MESSAGE TEXT #
  86. ["BAD NCF NPUXREF RECORD."];
  87. ITEM NCFER1$END U(02,30,30) = [0]; # END OF TEXT #
  88. END
  89.  
  90. DEF L$NCFER2 # 3 #;
  91. DEF DM$NCFER2 # DM$LOCAL+DM$ABORT+DM$NAMLOG #; # ROUTE OPTIONS #
  92. ARRAY MSG$NCFER2 [0:0] S(L$NCFER2);
  93. BEGIN
  94. ITEM NCFER2$TXT C(00,00,27) = # MESSAGE TEXT #
  95. ["NCB ENTRY NOT FOUND IN NCF."];
  96. ITEM NCFER2$END U(02,42,18) = [0]; # END OF TEXT #
  97. END
  98.  
  99. CONTROL EJECT;
  100.  
  101. # BASED ARRAY POINTERS OF SIOFET AND DIR PRESET IN NS$NSI #
  102.  
  103. ERRCODE = 0;
  104. SUCCESS = FALSE;
  105. UPI = (DIR$WC[0] - 1)/DIR$ENTRYL;
  106. FOR I = 1 STEP 1 WHILE I LQ UPI
  107. AND NOT SUCCESS
  108. DO
  109. BEGIN # FIND NPUXREF TABLE DIRECTORY ENTRY #
  110. IF DIR$NCFRT[I] EQ DIR$RT$NX
  111. THEN # FOUND #
  112. BEGIN
  113. SUCCESS = TRUE; # END LOOP #
  114. NXRDIRORD = I;
  115. END
  116. END
  117. IF NOT SUCCESS
  118. THEN # NPUXREF TABLE DIRECTORY ENTRY NOT FOUND #
  119. NS$MSG(MSG$NCFER1,L$NCFER1,DM$NCFER1); # DAYFILE AND ABORT #
  120. BUFL = ((DIR$RL[NXRDIRORD] + PRUSIZE)/PRUSIZE)*PRUSIZE + 1;
  121. REQTSB(BUFL,NXRTSBADDR,NXRTSBN); # GET NPUXREF TABLE BUFFER #
  122. FETRAN[0] = TRUE; # RANDOM ACCESS FILE #
  123. FETFST[0] = NXRTSBADDR; # FIRST #
  124. FETIN[0] = NXRTSBADDR;
  125. FETOUT[0] = NXRTSBADDR;
  126. FETLMT[0] = NXRTSBADDR + BUFL; # LIMIT #
  127. FETRR[0] = DIR$RSA[NXRDIRORD]; # RANDOM REQUEST #
  128. READ(SIOFET); # READ NPUXREF TABLE #
  129. RECALL(SIOFET);
  130. P<NXR$NCF> = NXRTSBADDR; # FORMAT NPUXREF TABLE #
  131. IF FETSTAT[0] NQ RDEOR
  132. OR NXR$ID[0] NQ NXR$IDENT
  133. OR NXR$WC[0] LS MIN$NXR$WC
  134. THEN # BAD NPUXREF TABLE #
  135. NS$MSG(MSG$NCFER1,L$NCFER1,DM$NCFER1); # DAYFILE AND ABORT #
  136. TEMP = (NXR$WC[0] - 1)/NXR$ENTRYL; # NO. OF ENTRIES IN NXR #
  137. NPTLENGTH = TEMP*NPT$ENTRYL + NPT$HDRL;
  138. REQTSB(NPTLENGTH,NPTTSBADDR,NPTTSBN); # GET NPU TABLE BUFFER #
  139. P<NPT$HEADER> = NPTTSBADDR; # FORMAT NPU TABLE HEADER #
  140. NPT$ID[0] = NPT$IDENT; # SET TABLE IDENTIFIER #
  141. NPT$EC[0] = TEMP; # ENTRY COUNT #
  142. P<NPT$ENTRY> = NPTTSBADDR + NPT$HDRL; # FORMAT NPT ENTRIES #
  143. TSBINFO(TSBSIZE,NCTTSBADDR,NCTTSBN); # GET NCT #
  144. P<NCT$NS> = NCTTSBADDR;
  145. UPI = TEMP; # NO. OF ENTRIES IN NPUXREF #
  146. FOR I = 1 STEP 1 UNTIL UPI
  147. DO
  148. BEGIN # BUILD NPU TABLE ENTRIES #
  149. NPT$NPNAME[I] = NXR$NPNAME[I]; # NPU NAME #
  150. NPT$NN[I] = NXR$NPNID[I]; # NODE NUMBER #
  151. NPT$NPUVAR[I] = NXR$NPUVAR[I]; # NPU VARIANT NAME #
  152. NPT$F$DFDM[I] = NXR$F$F2[I]; # NPU DEFAULT DUMP FLAG #
  153.  
  154. UPJ = (DIR$WC[0] - 1)/DIR$ENTRYL;
  155. SUCCESS = FALSE;
  156. FOR J = 1 STEP 1 WHILE J LQ UPJ
  157. AND NOT SUCCESS
  158. DO
  159. BEGIN # SEARCH NCF OPLD FOR NCB WITH MATCHING NODE NUMBER #
  160. IF DIR$NCFRT[J] EQ DIR$RT$NC
  161. AND DIR$NCFNID[J] EQ NPT$NN[I]
  162. THEN # NCB DIRECTORY ENTRY FOUND #
  163. BEGIN
  164. SUCCESS = TRUE; # END LOOP #
  165. NCBDIRORD = J;
  166. END
  167. END
  168. IF NOT SUCCESS
  169. THEN # NCB DIRECTORY ENTRY NOT FOUND #
  170. NS$MSG(MSG$NCFER2,L$NCFER2,DM$NCFER2); # DAYFILE AND ABORT #
  171. NPT$NCBSZ[I] = DIR$NCBSZ[NCBDIRORD];
  172. NPT$NCBRI[I] = DIR$RSA[NCBDIRORD]; # NCB RSA #
  173. FOR J=1 STEP 1 UNTIL NCT$EC[0] DO
  174. BEGIN # FILL IN NEIGHBOR NODE NUMBERS #
  175. IF NCT$NNN[J] EQ NPT$NN[I]
  176. THEN # THIS IS A NEIGHBOR #
  177. BEGIN
  178. NCT$NTORD[J] = I; # PUT NPT ORDINAL IN NCT ENTRY #
  179. IF NPT$NBN1[I] EQ 0
  180. THEN # THERE IS ROOM FOR ANOTHER NEIGHBOR NODE #
  181. BEGIN
  182. NPT$NBRS[I] = NPT$NBRS[I]*LSHIFT8; # SHIFT NEIGHBORS #
  183. NPT$NBN6[I] = NCT$NODE[J]; # ADD NEIGHBOR NODE #
  184. END
  185. END
  186. END
  187. END
  188. RETTSB(NXRTSBN); # RETURN NPUXREF TABLE TSB #
  189. END TERM
cdc/nos2.source/nam5871/ns_bnpt.txt · Last modified: 2023/08/05 17:22 by Site Administrator