User Tools

Site Tools


cdc:nos2.source:nam5871:npregll

NPREGLL

Table Of Contents

  • [00015] PRGM NPREGLL
  • [00124] PROC KPUT
  • [00125] PROC MCLRIL
  • [00126] PROC MGETS
  • [00127] PROC MGROW
  • [00128] PROC MRELS
  • [00129] PROC MSETIL
  • [00130] PROC NXBLINK
  • [00131] PROC OMSG
  • [00132] PROC OVLCALL
  • [00133] PROC RELCONN
  • [00134] PROC XTRACE
  • [00135] FUNC XCDD C(10)

Source Code

NPREGLL.txt
  1. *DECK NPREGLL
  2. USETEXT CET
  3. USETEXT KDIS
  4. USETEXT KHDRX
  5. USETEXT LLCB
  6. USETEXT NBT
  7. USETEXT NHEADER
  8. USETEXT NIPDEF
  9. USETEXT OVERLAY
  10. USETEXT PARAMP
  11. USETEXT PARAMS
  12. USETEXT PT
  13. USETEXT SUPMSG
  14. USETEXT TNT
  15. PRGM NPREGLL;
  16. # PROCESS SUPERVISORY MESSAGE REG/LL #
  17.  
  18. STARTIMS;
  19. #
  20. *1DC NPREGLL
  21. *
  22. * 1. PROC NAME AUTHOR DATE
  23. * NPREGLL E. GEE 86/10/01
  24. *
  25. * 2. FUNCTIONAL DESCRIPTION
  26. * THIS ROUTINE IS RESPONSIBLE FOR PROCESSING THE SUPERVISORY
  27. * MESSAGE REG/LL.
  28. *
  29. * 3. METHOD USED
  30. * CALL OMSG TO ISSUE DAYFILE MSG TO RECORD RECEIPT OF REG/LL MSG.
  31. * IF SPECIAL CDCNET REG/LL/R SUPERVISORY MESSAGE,
  32. * CREATE REG/LL/N SUPERVISORY MESSAGE.
  33. * CALL NXBLINK TO QUEUE REG/LL/N SUPERVISORY MESSAGE.
  34. * CHECK IF LOGICAL LINK CONTROL BLOCK ALREADY EXISTS,
  35. * IF NO LOGICAL LINK CONTROL BLOCK EXISTS,
  36. * VERIFY TERMINAL NODE IS ACCEPTABLE.
  37. * SET BAD REG/LL FLAG IF TERMINAL NODE IS UNACCEPTABLE.
  38. * IF TERMINAL NODE IS ACCEPTABLE,
  39. * IF BUFFER LEVEL IS NONZERO,
  40. * IF TERMINAL NODE TABLE NEEDS TO BE EXPANDED,
  41. * CALL MSETIL TO SET NIP/PIP INTERLOCK BEFORE EXPANSION.
  42. * CALL MGROW TO EXPAND TERMINAL NODE TABLE.
  43. * CALL MCLRIL TO CLEAR NIP/PIP INTERLOCK AFTER EXPANSION.
  44. * CALL OVERLAY BLDLLCB TO BUILD LOGICAL LINK CONTROL BLOCK.
  45. * ELSE (LOGICAL LINK CONTROL BLOCK ALREADY EXISTS),
  46. * IF CS SUPERVISION BROKEN,
  47. * CALL OVERLAY HCSUPCB TO SEND SUP/CB SUP MSG TO CS.
  48. * IF BUFFER LEVEL IS ZERO,
  49. * IF THIS IS THE FIRST TIME, NIP WAS INFORMED ABOUT LLK DOWN,
  50. * CALL RELCONN TO BREAK ALL CONNECTIONS ON THIS LLK.
  51. * IF NO CONNECTIONS REMAIN ON THIS LOGICAL LINK,
  52. * CALL OVERLAY RELLLCB TO RELEASE LLCB.
  53. * ELSE (PRU CONNECTIONS REMAIN TO BE CLEANED UP),
  54. * SET RELEASE LLCB FLAG.
  55. * ELSE (BUFFER LEVEL IS NONZERO),
  56. * CLEAR RELEASE LLCB FLAG.
  57. * IF REGULATION LEVEL CHANGED,
  58. * CALL OVERLAY NPREGCN TO PROCESS REGULATION CHANGE.
  59. * IF NAM ST DISPLAY NEEDS TO BE UPDATED,
  60. * CALL KPUT TO UPDATE NAM ST DISPLAY.
  61. *
  62. * 4. ENTRY PARAMETERS
  63. * NBTIDX INDEX OF NBT ENTRY BEING PROCESSED
  64. * PARAMP1 DATA BLOCK HEADER ADDRESS
  65. *
  66. * 5. EXIT PARAMETERS
  67. * PARAMS5 TRUE IF REG/LL SUP MSG REJECTED BECAUSE A
  68. * BAD TERMINAL NODE WAS SPECIFIED IN THE
  69. * NETWORK HEADER.
  70. *
  71. * 6. COMDECKS CALLED
  72. * CET COUPLER EQUIPMENT TABLE
  73. * KDIS K-DISPLAY TABLE
  74. * KHDRX K-DISPLAY HEADER TABLE
  75. * LLCB LOGICAL LINK CONTROL BLOCK TEMPLATE
  76. * NBT NETWORK BUFFER TABLE
  77. * NHEADER NETWORK BLOCK HEADER TEMPLATE
  78. * NIPDEF CONSTANT DEFINITIONS
  79. * OVERLAY OVERLAY TABLE
  80. * PARAMP BUFFER FOR PASSING PARAMS TO/FROM PRI OVL
  81. * PARAMS BUFFER FOR PASSING PARAMS TO/FROM SEC OVL
  82. * PT GLOBAL VARIABLES AND POINTERS
  83. * SUPMSG SUPERVISORY MESSAGE TEMPLATE
  84. * TNT TERMINAL NODE TABLE
  85. *
  86. * 7. ROUTINES AND OVERLAYS CALLED
  87. * BLDLLCB OVL CREATE LOGICAL LINK CONTROL BLOCK
  88. * HCSUPCB OVL GENERATE SUPERVISORY MESSAGE SUP/CB
  89. * KPUT UPDATE NAM K-DISPLAY BUFFER
  90. * MCLRIL CLEAR NIP/PIP INTERLOCK
  91. * MGETS GET BUFFER
  92. * MGROW INCREASE SIZE OF BUFFER
  93. * MSETIL SET NIP/PIP INTERLOCK
  94. * NPREGCN OVL PROCESS CONNECTION REGULATION
  95. * NXBLINK LINK DOWNLINE MSG TO OUTBOUND CHAIN
  96. * OMSG ISSUE DAYFILE MESSAGE
  97. * OVLCALL LOAD AND EXECUTE OVERLAY
  98. * RELCONN RELEASE CONNECTIONS ON A LOGICAL LINK
  99. * RELLLCB OVL RELEASE LOGICAL LINK CONTROL BLOCK
  100. * XCDD CONVERT INTEGER TO DECIMAL DISPLAY
  101. * XTRACE TRACE CALLS
  102. *
  103. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION.
  104. * *** EST XXX - NIP/REGLL DN=AAA,SN=BBB,RL=L. ***
  105. *
  106. * THIS PROGRAM IS A PRIMARY OVERLAY LOADED BY SUBROUTINE
  107. * OVLCALL. WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO
  108. * LOCATION RJMAIN TO THE CALLING PROGRAM.
  109. *
  110. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE PRIMARY
  111. * OVERLAY BUFFER SIZE MINUS 5 (560B WORDS).
  112. *
  113. * THIS OVERLAY IS CALLED BY NPNIPSM.
  114. *
  115.  #
  116. STOPIMS;
  117.  
  118. #
  119. **** EXTERNAL ENTRY POINTS
  120. #
  121.  
  122. XREF
  123. BEGIN
  124. PROC KPUT ; # UPDATE K-DISPLAY BUFFER #
  125. PROC MCLRIL ; # CLEAR NIP/PIP INTERLOCK #
  126. PROC MGETS; # GET BUFFER #
  127. PROC MGROW ; # EXPAND TNT TABLE #
  128. PROC MRELS; # RELEASE BUFFER SPACE #
  129. PROC MSETIL ; # SET PIP/NIP INTERLOCK #
  130. PROC NXBLINK; # QUEUE DOWNLINE MSG FOR PIP #
  131. PROC OMSG; # ISSUE ERROR DAYFILE MESSAGE #
  132. PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
  133. PROC RELCONN ; # RELEASE NETWORK CONNECTION #
  134. PROC XTRACE; # RECORD PROCEDURE CALL #
  135. FUNC XCDD C(10) ; # CONVERT INTEGER TO DEC DISPLAY#
  136. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  137. END
  138.  
  139. # LOCAL VARIABLES #
  140.  
  141. ARRAY DFMSG1 P(5) ;
  142. BEGIN
  143. ITEM DFMSGH C(00,00,40) =
  144. ["EST XXX - NIP/REGLL DN= ,SN= ,RL= ."];
  145. ITEM DFEST U(00,24,18); # EST ORDINAL OF FRONT END #
  146. ITEM DFDN C(02,18,3); # DESTINATION NODE NUMBER #
  147. ITEM DFSN C(03,00,3); # SOURCE NODE NUMBER #
  148. ITEM DFRL C(03,42,1); # BUFFER REGULATION LEVEL #
  149. ITEM DFZERO U(04,00,60) = [0];
  150. END
  151.  
  152. ITEM BUFADDR; # BUFFER FOR REG/LL/N SUP MSG #
  153. ITEM I; # LOOP CONTROL VARIABLE #
  154. ITEM IDXHN; # HOST NODE NUMBER #
  155. ITEM IDXTN; # TERMINAL NODE NUMBER #
  156. ITEM KN U;
  157.  
  158. #**********************************************************************#
  159.  
  160. BEGIN # BEGIN NPREGLL CODE #
  161.  
  162. CONTROL IFEQ DEBUG,1 ; # RECORD PROCEDURE CALL #
  163. XTRACE("NPRLL") ;
  164. CONTROL FI;
  165.  
  166. PARAMS5 = FALSE; # INITIALIZE FOR REG/LL NOT #
  167. # REJECTED #
  168. #
  169.   ISSUE REGULATION LEVEL DAYFILE MESSAGE
  170. #
  171. P<NHEADER> = PARAMP1 + DBHSIZE; # LOCATION OF NETWORK HEADER #
  172. P<SMNIP> = P<NHEADER> + NBHSIZE; # LOCATION OF REG/LL SUP MSG #
  173. IDXTN = SN[0]; # TNT ENTRY INDEX #
  174. IDXHN = DN[0]; # HOST NODE NUMBER #
  175. I = XCDD(IDXHN); # DESTINATION NODE #
  176. DFDN[0] = C<7,3>I;
  177. I = XCDD(IDXTN); # SOURCE NODE #
  178. DFSN[0] = C<7,3>I;
  179. I = XCDD(REGB[0]); # REGULATION LEVEL #
  180. DFRL[0] = C<9,1>I;
  181. DFEST[0] = (NBTEST1[NBTIDX]+27)*64*64 + (NBTEST2[NBTIDX]+27)*64 +
  182. NBTEST3[NBTIDX]+27; # EST ORDINAL #
  183. OMSG(DFMSG1,0);
  184. #
  185.   CHECK FOR SPECIAL CDCNET REG/LL SUPERVISORY MESSAGE
  186. #
  187. IF (IDXTN EQ 0) AND
  188. (IDXHN EQ 0)
  189. THEN # SPECIAL CDCNET REG/LL SUP MSG #
  190. BEGIN
  191. #
  192.   SEND REG/LL/N SUP MSG BACK TO MDI WITH APPROPRIATE NODE NUMBER
  193. #
  194. IDXHN = NBTHN[NBTIDX]; # HOST NODE NUMBER #
  195. IDXTN = NBTTN[NBTIDX+1]; # TERMINAL NODE FOR CDCNET LLK #
  196. DN[0] = IDXHN; # HOST NODE FOR LOGICAL LINK #
  197. SN[0] = IDXTN; # TERMINAL NODE FOR LOGICAL LINK#
  198. MGETS(LREG + BLKHSIZE + NBHSIZE, BUFADDR,TRUE); # GET BUFFER #
  199. P<NHEADER> = BUFADDR + BLKHSIZE; # NETWORK ADDRESS WORD #
  200. DN[0] = IDXTN; # TERMINAL NODE FOR CDCNET LLK #
  201. SN[0] = IDXHN; # HOST NODE FOR LOGICAL LINK #
  202. BT[0] = NETCMD; # NETWORK CHARACTER TYPE #
  203. NHACT[0] = CT8ASCII; # CHAR TYPE IS 8 BIT ASCII #
  204. CC[0] = NREGLLN; # LENGTH OF REG/LL/N SUP MSG #
  205. P<SUPMSG> = BUFADDR + BLKHSIZE + NBHSIZE; # ADDR OF SM TEXT #
  206. SPMSG0[0] = REGLLW0[0]; # WORD ZERO OF SUP MSG #
  207. RB[0] = TRUE; # SET NORMAL RESPONSE BIT #
  208. NXBLINK(BUFADDR,NBTIDX+OSTFET);# QUEUE REG/LL/N SUP MSG #
  209. END
  210. #
  211.   CHECK FOR ALREADY EXISTING LOGICAL LINK CONTROL BLOCK
  212. #
  213. P<LLCB> = 0; # INIT TO NO LLK EXISTS #
  214. PARAMS2 = 0; # INIT LINK ADDR FOR BLDLLCB #
  215. IF IDXTN LQ TNTBS[0] - TNTHSIZE
  216. THEN # SN IS WITHIN TNT TABLE SIZE #
  217. BEGIN
  218. P<LLCB> = TNTLLAD[IDXTN]; # TNT ENTRY FOR SPECIFIED SN #
  219. FOR I = I WHILE (P<LLCB> NQ 0 ) AND # MORE LLCBS TO CHECK #
  220. (LLCBHN[0] NQ IDXHN) # NOT THE CORRECT LLCB#
  221. DO
  222. BEGIN
  223. PARAMS2 = P<LLCB>; # SAVE FOR CALL TO BLDLLCB #
  224. P<LLCB> = LLCBFP[0]; # CHECK NEXT LLCB IN CHAIN #
  225. END
  226. END
  227. IF P<LLCB> EQ 0
  228. THEN # NO EXISTING LLCB FOUND #
  229. BEGIN
  230. #
  231.   VERIFY TERMINAL NODE IS ACCEPTABLE, I.E. IT CAN NOT BE THE SAME
  232.   AS HOST NODE. ALSO FOR CDCNET IT CANNOT BE THE SAME AS ANY
  233.   OTHER HOST NODE NUMBER IN CET TABLE.
  234. #
  235. IF IDXTN EQ IDXHN
  236. THEN # BAD REG/LL SUP MSG #
  237. BEGIN
  238. PARAMS5 = TRUE; # SET FLAG FOR BAD NETWORK MSG #
  239. END
  240. ELSE # DN IS NOT THE SAME AS SN #
  241. BEGIN
  242. IF NBTET[NBTIDX] EQ "NQ"
  243. THEN # CDCNET FRONT END #
  244. BEGIN
  245. FOR I= CETHSIZE STEP 1 UNTIL CETBS[0] - 1
  246. DO # LOOP THROUGH CET TABLE #
  247. BEGIN
  248. IF CETHN[I] EQ IDXTN
  249. THEN # HN IN CET TABLE MATCHES SN #
  250. BEGIN
  251. PARAMS5 = TRUE; # ERROR IN CONFIGURATION #
  252. END
  253. END
  254. END
  255. END
  256. IF NOT PARAMS5
  257. THEN # ACCEPTABLE SN WAS SPECIFIED #
  258. BEGIN
  259. IF REGB[0] NQ BUFLCD
  260. THEN # NONZERO BUFFER LEVEL - LLK UP #
  261. BEGIN
  262. IF IDXTN GR TNTBS - TNTHSIZE
  263. THEN # NEED TO EXPAND TNT #
  264. BEGIN
  265. MSETIL(0) ; # REQ INTERLOCK,TNT MAY BE MOVED#
  266. MGROW(P<TNT>,IDXTN + TNTHSIZE,TRUE); # EXPAND TNT #
  267. PTTNT[0] = P<TNT> ; # RESET TNT PTR #
  268. MCLRIL ; # CLEAR THE NIP/PIP INTERLOCK #
  269. END
  270. #
  271.   CREATE NEW LOGICAL LINK CONTROL BLOCK
  272. #
  273. OVLNAME = BLDLLCBP; # NAME OF OVERLAY TO LOAD #
  274. PARAMS1 = PARAMP1 + DBHSIZE; # NETWORK BLOCK HEADER ADDRESS#
  275. OVLCALL;
  276. END
  277. END
  278. END
  279. ELSE # LLCB ALREADY EXISTS #
  280. BEGIN
  281. #
  282.   CHECK FOR CS SUPERVISION BROKEN. IF SO, NEED TO INFORM CS
  283. #
  284. IF (LLCBCS[0] ) AND # CS THINKS IT HAS SUPERVISION #
  285. (NOT REGC ) AND # CS NO LONGER HAS SUPERVISION #
  286. (PROCAN[CSORD] NQ 0) # CS IS RUNNING IN THIS HOST #
  287. THEN # TELL CS IT LOST SUPERVISION #
  288. BEGIN
  289. #
  290.   SEND SUP/CB SUPERVISORY MESSAGE TO CS
  291. #
  292. OVLNAME = HCSUPCBP; # NAME OF OVERLAY TO LOAD #
  293. PARAMS1 = IDXHN; # HOST NODE OF THIS LLK #
  294. PARAMS2 = IDXTN; # TERMINAL NODE OF THIS LLK #
  295. OVLCALL ; # LOAD AND EXECUTE OVERLAY #
  296. END
  297. IF REGB[0] EQ BUFLCD
  298. THEN # ZERO BUFFER LEVEL - LLK DOWN #
  299. BEGIN
  300. #
  301.   LOGICAL LINK IS DOWN. BREAK ALL CONNECTIONS IF THIS IS THE
  302.   FIRST TIME NIP RECEIVED REG/LL FOR THIS LOGICAL LINK WITH
  303.   BUFFER LEVEL = 0.
  304. #
  305. IF NOT LLCBWOF[0]
  306. THEN # 1ST NOTIFICATION OF LLK DOWN #
  307. BEGIN
  308. RCBRK = RCCB"LLF" ; # LL FAILED = 15 FOR CR/CB/U #
  309. RELCONN(P<LLCB>,LLFAIL); # BREAK ALL CONS ON THIS LLK #
  310. END
  311. IF LLCBNPC[0] EQ 0
  312. THEN # NO CONNECTIONS ON LLK #
  313. BEGIN
  314. #
  315.   RELEASE LOGICAL LINK CONTROL BLOCK
  316. #
  317. PARAMS2 = P<LLCB>; # ADDR OF LLCB TO RELEASE #
  318. OVLNAME = RELLLCBP; # NAME OF OVERLAY TO LOAD #
  319. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  320. END
  321. ELSE # PRU CONNECTIONS TO RELEASE #
  322. BEGIN
  323. LLCBWOF[0] = TRUE; # SET FLAG FOR LLCB TO RELEASE #
  324. END
  325. END
  326. ELSE # NONZERO BUFFER LEVEL - LLK UP #
  327. BEGIN
  328. LLCBWOF[0] = FALSE; # CLEAR FLAG TO RELEASE LLK #
  329. IF LLCBNRL[0] NQ REGB
  330. THEN # REGULATION LEVEL CHANGED #
  331. BEGIN
  332. IF LLCBNRL[0] GR REGB
  333. THEN # LOWERING REGULATION LEVEL #
  334. BEGIN
  335. PARAMS3 = 1; # SET FLAG FOR PUTTING CN IN REG#
  336. END
  337. ELSE # RAISING REGULATION LEVEL #
  338. BEGIN
  339. PARAMS3 = 0; # SET FLAG FOR TAKING CN OUT OF #
  340. END # REGULATION #
  341. #
  342.   CALL NPREGCN TO PUT CONNECTIONS IN REGULATION OR TAKE THEM
  343.   OUT OF REGULATION
  344. #
  345. PARAMS1 = P<LLCB> ; # ADDRESS OF LLCB #
  346. PARAMS2 = REGB ; # NEW REGULATION LEVEL #
  347. OVLNAME = NPREGCNP ; # NAME OF OVERLAY TO LOAD #
  348. OVLCALL ; # LOAD AND EXECUTE OVERLAY #
  349. END
  350.  
  351. LLCBCS[0] = REGC; # UPDATE CS INDICATOR #
  352. LLCBNS[0] = REGN; # UPDATE NS INDICATOR #
  353. LLCBNRL[0] = REGB; # UPDATE NETWORK REGULATION LVL #
  354. IF KDST[0] AND # NAM ST DISPLAY IS UP #
  355. LLCBKNDX[0] NQ 0 AND
  356. LLCBKNDX[0] GQ KDLGLST[0] AND
  357. LLCBKNDX[0] LQ KDLGLND[0]
  358. THEN
  359. BEGIN
  360. #
  361.   UPDATE LOGICAL LINK STATUS ON NAM ST DISPLAY
  362. #
  363. IF KDESTST[0] EQ 0
  364. THEN
  365. BEGIN
  366. KN = LLCBKNDX[0] - KDLGLST[0];
  367. END
  368. ELSE
  369. BEGIN
  370. IF KDAPPST[0] EQ 0
  371. THEN
  372. BEGIN
  373. KN = LLCBKNDX[0] + KDESTND[0] - KDESTST[0];
  374. END
  375. ELSE
  376. BEGIN
  377. KN = LLCBKNDX[0] + KDESTND[0] + KDAPPND[0] - KDAPPST[0];
  378. END
  379. END
  380. KPUT(KHDRNP[0],KN,KPLGN,LLCBNRL[0]); # UPDATE NAM ST DISPLY#
  381. IF LLCBCS[0]
  382. THEN # CS USING LLK TO SUPERVISE NPU #
  383. BEGIN
  384. KPUT(KHDRNP[0],KN,KPLGS,"S"); # UPDATE NAM ST DISPLAY #
  385. END
  386. ELSE # NO CS SUPERVISION ON THIS LLK #
  387. BEGIN
  388. KPUT(KHDRNP[0],KN,KPLGS," "); # UPDATE NAM ST DISPLAY #
  389. END
  390. END
  391. END
  392. END
  393. GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
  394.  
  395. END # NPREGLL #
  396.  
  397. TERM
cdc/nos2.source/nam5871/npregll.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator