User Tools

Site Tools


cdc:nos2.source:nam5871:bldllcb

BLDLLCB

Table Of Contents

  • [00019] PRGM BLDLLCB
  • [00100] PROC MGETS
  • [00101] PROC BLINK
  • [00102] PROC OSCHAPP
  • [00104] PROC XTRACE
  • [00105] PROC MGROW
  • [00106] PROC MCLRIL
  • [00107] PROC MSETIL
  • [00108] PROC OMSG
  • [00109] PROC RELCONN
  • [00110] PROC BLDKWL
  • [00111] PROC DAYTIME
  • [00113] PROC ABORT

Source Code

BLDLLCB.txt
  1. *DECK BLDLLCB
  2. USETEXT AHEADER
  3. USETEXT APPSTAT
  4. USETEXT FREETAB
  5. USETEXT LLCB
  6. USETEXT MSGIDX
  7. USETEXT NBT
  8. USETEXT NHEADER
  9. USETEXT NIPDEF
  10. USETEXT PARAMS
  11. USETEXT PT
  12. USETEXT AT
  13. USETEXT SUPMSG
  14. USETEXT TNT
  15. USETEXT KDIS
  16. USETEXT KSTTAB
  17. USETEXT DUMPFLG
  18. USETEXT PIT
  19. PRGM BLDLLCB;
  20. # BUILD LOGICAL LINK CONTROL BLOCK #
  21.  
  22. STARTIMS;
  23. #
  24. *1DC BLDLLCB
  25. *
  26. * 1. PROC NAME AUTHOR DATE
  27. * BLDLLCB E.T. WAN 81/03/28
  28. *
  29. * 2. FUNCTIONAL DESCRIPTION
  30. * THIS ROUTINE BUILDS A LOGICAL LINK CONTROL BLOCK AND UPDATES
  31. * ITS HEADER.
  32. * ALSO, INFORM NVF ABOUT THE NEW LINK (FOR LID/PID)
  33. *
  34. * 3. METHOD USED
  35. * CALL MGETS TO GET BUFFER SPACE FOR THE LOGICAL LINK CONTROL
  36. * BLOCK AND UPDATE LIST POINTERS TO THE LLCB.
  37. * FILL IN THE HEADER OF THE LLCB.
  38. * SEARCH FOR MATCHING HOST NODE IN NBT WITH
  39. * DESTINATION NODE OF LOGICAL LINK. IF MATCHING
  40. * NBT ENTRY FOUND, THEN FILL IN LLCB ENTRY
  41. * INFORMATION. IF MATCHING ENTRY NOT FOUND
  42. * AND IN DEBUG MODE - ABORT NIP. UPDATE
  43. * K-DISPLAY STATUS INFORMATION IF NECESSARY.
  44. * UPDATE THE NUMBER OF LOGICAL LINKS IN THE TERMINAL NODE TABLE.
  45. *
  46. * 4. ENTRY PARAMETERS
  47. * PARAMS1 NETWORK BLOCK HEADER ADDRESS
  48. * PARAMS2 ADDRESS OF LOGICAL LINK CONTROL BLOCK
  49. * WHICH WILL LINK TO THE NEW CONTROL BLOCK
  50. * WITH ITS FORWARD POINTER.
  51. * IF NO SUCH A LLCB EXISTS, PARAMS2 IS ZERO.
  52. *
  53. * 5. EXIT PARAMETERS
  54. *
  55. * 6. COMDECKS CALLED
  56. * AHEADER
  57. * LLCB
  58. * NBT
  59. * NHEADER
  60. * NIPDEF
  61. * PARAMS
  62. * PT
  63. * SUPMSG
  64. * TNT
  65. * KDIS
  66. * OSSIZE
  67. *
  68. * 7. ROUTINES AND OVERLAYS CALLED
  69. * MGETS GET BUFFER SPACE
  70. * BLINK LINK A MESSAGE TO AN APPLICATION
  71. * OSCHAPP SCHEDULE APPLICATION
  72. * MGROW ALLOCATE EXTENDED BUFFER
  73. * OMSG OUTPUT DAYFILE MESSAGE
  74. * DAYTIME GET TIME IN DISPLAY
  75. * XTRACE TRACE CALLS
  76. * KADD ADD LINE TO STATUS DISPLY
  77. * KPUT UPDATE VALUE ON STATUS DISPLAY LINE
  78. *
  79. * 8. DAYFILE MESSAGES
  80. * "NIP INTERNAL ERROR - BLDLLCB"
  81. *
  82. * THIS PROGRAM IS A SECONDARY OVERLAY LOADED BY SUBROUTINE
  83. * OVLCALL. WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO
  84. * LOCATION RJMAIN TO RETURN TO THE CALLING PROGRAM.
  85. *
  86. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY
  87. *CALL OSSIZE
  88. *
  89. * THIS OVERLAY IS CALLED BY NPREGLL.
  90. *
  91.  #
  92. STOPIMS;
  93.  
  94. #
  95. **** EXTERNAL ENTRY POINTS
  96. #
  97.  
  98. XREF
  99. BEGIN
  100. PROC MGETS; # GET BUFFER SPACE #
  101. PROC BLINK ;
  102. PROC OSCHAPP ;
  103. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  104. PROC XTRACE; # RECORD TRACE #
  105. PROC MGROW ; # GROW TNT BUFFER #
  106. PROC MCLRIL ; # CLEAR INTERLOCK #
  107. PROC MSETIL ; # REQUEST INTERLOCK ROUTINE #
  108. PROC OMSG; # DAYFILE MESSAGE #
  109. PROC RELCONN ; # RELEASE CONNECTIONS #
  110. PROC BLDKWL; # FORMAT KWL TO ADD LLK TO STATUS DISPLAY #
  111. PROC DAYTIME ;
  112. CONTROL IFEQ DEBUG,1 ;
  113. PROC ABORT ;
  114. CONTROL FI ;
  115. END
  116.  
  117. #
  118. * LOCAL VARIABLES
  119. #
  120.  
  121. ITEM I; # LOOP CONTROL VARIABLE #
  122. ITEM IDXTN; # TNT WORD INDEX #
  123. ITEM INDX I ;
  124. ITEM BUFADDR ;
  125. ITEM NEWLLCB; # NEW LLCB #
  126. ITEM DTIME ;
  127. ITEM FOUND B ;
  128. ITEM KLGL U ; # POINTER TO STATUS DISPLAY BUFFER #
  129. ITEM KN U ; # INDEX INTO THE STATUS DISPLAY BUFFER #
  130.  
  131.  
  132. BEGIN # BLDLLCB #
  133. CONTROL IFEQ DEBUG,1 ;
  134. XTRACE("BLLCB") ;
  135. CONTROL FI;
  136.  
  137. IF SHUTDOWN
  138. THEN
  139. GOTO RJMAIN;
  140.  
  141. P<NHEADER> = PARAMS1; # LOCATION OF NETWORK HEADER #
  142. P<SMNIP> = P<NHEADER> + NBHSIZE; # LOCATION OF REG/LL SM #
  143. IDXTN = SN[0]; # TNT ENTRY INDEX #
  144.  
  145. MGETS(LLCBSIZE,NEWLLCB,TRUE); # GET SPACE FOR LLCB #
  146.  
  147. IF IDXTN GR TNTBS[0] - TNTHSIZE
  148. THEN
  149. BEGIN # NEED TO GROW TNT #
  150. MSETIL(0) ; # REQUEST INTERLOCK TO ALL PIP #
  151. MGROW(P<TNT>,IDXTN + TNTHSIZE,TRUE);
  152. PTTNT[0] = P<TNT> ; # UPDATE THE POINTER TABLE #
  153. MCLRIL ; # CLEAR INTERLOCK REQUESTED #
  154. END # NEED TO GROW TNT #
  155.  
  156. IF TNTNLL[IDXTN] NQ 0 # LLCB EXISTED BEFORE NEWLLCB IS CREATED #
  157. THEN
  158. BEGIN
  159. P<LLCB> = PARAMS2; # MOVE TO PREVIOUS LLCB #
  160. LLCBFP[0] = NEWLLCB; # LINK FORWARD PTR TO NEW LLCB #
  161. END
  162.  
  163. ELSE
  164. BEGIN
  165. TNTTN[IDXTN] = SN[0]; # INSERT TERMINAL NODE #
  166. TNTLLAD[IDXTN] = NEWLLCB; # INSERT ADDRESS OF NEWLLCB #
  167. END;
  168.  
  169. P<LLCB> = NEWLLCB; # MOVE TO NEW LLCB #
  170.  
  171. IF ATACBA[NVFAN] NQ 0
  172. THEN
  173. BEGIN # NVF ALREADY NETTED ON #
  174. #
  175.   GET A BUFFER FOR MESSAGE TO INFORM NVF
  176. #
  177. MGETS( LCRSLL + ABHSIZE + BLKHSIZE , BUFADDR , TRUE ) ;
  178. #
  179.   SET UP APPLICATION HEADER
  180. #
  181. P<AHEADER> = BUFADDR + BLKHSIZE ;
  182. ABHABT[0] = APPCMD ;
  183. ABHACT[0] = CT60TRANS ;
  184. ABHTLC[0] = LCRSLL ;
  185. #
  186.   SET-UP THE MESSAGE ITSELF
  187. #
  188. P<SUPMSG> = BUFADDR + ABHSIZE + BLKHSIZE ;
  189. # #
  190. PFCSFC[0] = CRSLL ;
  191. P<SMNVF> = P<SUPMSG> ;
  192. # #
  193. CRSLDN [0] = SN[0] ; # DESTINATION NODE NUMBER #
  194. CRSLSN [0] = DN[0] ; # SOURCE NODE NUMBER #
  195. CRSLST [0] = 1 ; # LOGICAL LINK UP SIGNAL #
  196. #
  197.   AND LINK MESSAGE TO NVF
  198. #
  199.  
  200. BLINK ( BUFADDR,ATACBA[NVFAN]) ; # QUEUE TO NVF #
  201. OSCHAPP (ATACBA[NVFAN]) ;
  202.  
  203. END # NVF ALREADY NETTED ON #
  204. #
  205. * FILL IN LOGICAL LINK CONTROL BLOCK HEADER. LLCB BLOCK SIZE HAS
  206. * BEEN FILLED IN BY MGETS.
  207. #
  208. LLCBID[0] = LLCBIDVALUE; # ID #
  209.  
  210.  
  211.  
  212. # IF THIS NEW LLCB IS THE ONLY ONE IN THE LLCB RING THEN #
  213. # PARAMS2 MUST BE ZERO (NO PREVIOUS LLCB ), FORWARD POINTER #
  214. # AND BACKWARD POINTER ARE ZERO. #
  215. # IF THE NEW LLCB IS TO BE LINKED TO THE EXISTING RING #
  216. # FP IS ZERO AND BP IS PARAMS2, THE PREVIOUS LLCB #
  217.  
  218. LLCBBP[0] = PARAMS2 ; # BACKWARD POINTER #
  219. LLCBFP[0] = 0 ; # FORWARD POINTER #
  220.  
  221. LLCBHN[0] = DN[0]; # HOST NODE #
  222. LLCBTN[0] = SN[0]; # TERMINAL NODE #
  223.  
  224. # LOOK FOR THE NBT THAT HAS THE HOST NUMBER MATCHING THE DN #
  225.  
  226. FOUND = FALSE ;
  227. FOR I=0 STEP NBTFETNO WHILE (I LQ NBTMAXID)
  228. AND NOT FOUND
  229. DO
  230. BEGIN
  231. IF NBTHN[I] EQ DN[0]
  232. THEN
  233. BEGIN
  234. FOUND = TRUE ;
  235. INDX = I ;
  236. END
  237. END
  238.  
  239. CONTROL IFEQ DEBUG,1 ;
  240. IF NOT FOUND
  241. THEN
  242. BEGIN
  243. D27M2[0] = "BLDLLCB";
  244. OMSG(DFMSG27,0); # DAYFILE "NIP INTERNAL ERROR" #
  245. ABORT(0,0) ;
  246. END
  247. CONTROL FI ;
  248.  
  249. I = INDX ;
  250.  
  251. #
  252. * THE CORRESPONDING NBT ENTRY WAS FOUND.
  253. #
  254. LLCBNBTE[0] = NBTINDX[I]; # GET INDEX OF CORRECT NBT ENTRY #
  255. LLCBCS[0] = REGC; # CS INDICATOR #
  256. LLCBNS[0] = REGN; # NS INDICATOR #
  257. LLCBHH[0] = REGH; # HOST TO HOST FLAG #
  258. LLCBNPC[0] = 0; # NUMBER OF PRU CONNECTIONS #
  259. LLCBHRL[0] = HRL; # HOST REGULATION #
  260. LLCBNRL[0] = REGB; # NPU REGULATION #
  261. LLCBNC[0] = 0; # NUMBER OF CONNECTIONS #
  262. LLCBCMTC[0] = 0; # CURRENT MESSAGE TRANSFER COUNT #
  263. LLCBLMTC[0] = 0; # LAST MESSAGE TRANSFER COUNT #
  264. LLCBPITIDX[0] = NBTPIP[I]; # SAVE PIP NUM IN LLCB #
  265. DAYTIME(DTIME);
  266. LLCBCRTM[0] = DTIME ;
  267.  
  268. IF KDST[0]
  269. THEN # STATUS DISPLAY ON, ADD LLK ENTRY TO DISPLAY #
  270. BLDKWL(KST"LLK",DN[0],SN[0],KADDIDVALUE);
  271.  
  272. TNTNLL[IDXTN] = TNTNLL[IDXTN] + 1; # INCREMENT LINK NUMBER #
  273. GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
  274.  
  275. END # BLDLLCB #
  276.  
  277. TERM
cdc/nos2.source/nam5871/bldllcb.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator