User Tools

Site Tools


cdc:nos2.source:nam5871:ns_nsm

NS$NSM

Table Of Contents

  • [00012] PROC NS$NSM(ERRCODE)
  • [00014] NS$NSM - PROCESS NETWORK SM.
  • [00018] PROCESS NETWORK SM.
  • [00069] PROC NS$DBG
  • [00075] PROC MOVEOK
  • [00076] FUNC NS$FEC U
  • [00077] PROC NS$MSG
  • [00078] PROC NS$NSS
  • [00079] PROC TSBINFO

Source Code

NS$NSM.txt
  1. *DECK NS$NSM
  2. USETEXT COM$NS
  3. USETEXT DEF$NS
  4. USETEXT ERR$NS
  5. USETEXT NAT$NS
  6. USETEXT NCT$NS
  7. USETEXT NPT$NS
  8. USETEXT PFC$NS
  9. USETEXT SMB$NS
  10. USETEXT SMD$NS
  11.  
  12. PROC NS$NSM(ERRCODE); # PROCESS NETWORK SUPERVISORY MESSAGE #
  13.  
  14. # TITLE NS$NSM - PROCESS NETWORK SM. #
  15.  
  16. BEGIN # NS$NSM #
  17. #
  18. ** NS$NSM - PROCESS NETWORK SM.
  19. *
  20. * J.C. LEE 1981
  21. *
  22. * THIS ROUTINE PROCESSES NETWORK SM.
  23. *
  24. * PROC NS$NSM(ERRCODE)
  25. *
  26. * ENTRY:
  27. * NONE.
  28. *
  29. * EXIT:
  30. * ERRCODE.
  31. *
  32. * METHOD:
  33. * VALIDATE ABH (ABT/ACT/TLC).
  34. * IDENTIFY NETWORK SM.
  35. * CASE ON PFC/SFC OF SM:
  36. * 1) NPU/IN/R
  37. * IF LOAD TYPE VALID:
  38. * REQUEST TO LOAD LOCAL/REMOTE NPU.
  39. * ELSE, FLAG ERROR AND EXIT.
  40. * 2) NPU/DT/N, NPU/DT/A
  41. * IF COMMAND CODE NOT VALID:
  42. * FLAG ERROR AND EXIT.
  43. * ALL NON-ERROR CASES COMES HERE.
  44. * ASSIGN STIMULUS-CODE.
  45. * LOCATE NPU-TABLE ENTRY.
  46. * IF ERRCODE EQ 0:
  47. * ACCESS NPU-TABLE ENTRY.
  48. * IF NAT-TSBN NQ 0:
  49. * IF NETWORK-SM IS A RESPONSE-SM:
  50. * CHECK RESPONSE-SM FOR MATCH ON
  51. * CURRENT ACTIVITY.
  52. * IF NOT MATCH:
  53. * DISCARD SM AND EXIT.
  54. * EXTRACT NPU-STATE FROM NCT.
  55. * MAP NPU-STATE INTO STATE-ORDINAL.
  56. * ELSE, SET STATE-ORDINAL TO ZERO.
  57. * IF A VALID STATE ORDINAL:
  58. * EXECUTE NETWORK STIMULUS/STATE ACTION.
  59. * ELSE, DISPATCH MESSAGE AND ABORT.
  60. * IF NETWORK-SM INVALID, FLAG ERROR.
  61. *
  62. #
  63.  
  64. ITEM ERRCODE U; # ERROR CODE #
  65.  
  66. $BEGIN
  67. XREF
  68. BEGIN
  69. PROC NS$DBG;
  70. END
  71. $END
  72.  
  73. XREF
  74. BEGIN
  75. PROC MOVEOK; # ALLOW TSB TO MOVE #
  76. FUNC NS$FEC U; # FORMAT ERROR CODE #
  77. PROC NS$MSG; # DISPATCH MESSAGE #
  78. PROC NS$NSS; # NPU STATE TABLE PROCESSOR #
  79. PROC TSBINFO; # LOCATE TSB #
  80. END
  81.  
  82. ITEM HN U; # DESTINATION NODE NUMBER IN ABH #
  83. ITEM FOUND B; # INDICATES IF NPU TABLE ENTRY IS FOUND #
  84. ITEM INDEX I; # LOOP INDEX #
  85. ITEM NCTORD U; # NODE CONNECTION TABLE ORDINAL #
  86. ITEM NODEID U; # NEIGHBOR NODE NUMBER OF ADDRESSED NPU #
  87. ITEM PN U; # PORT NUMBER OF TRUNK #
  88. ITEM SMPFC U; # PFC OF SM #
  89. ITEM SMPFCSFC U; # PFC/SFC OF SM #
  90. ITEM SN U; # SOURCE NODE NUMBER IN ABH #
  91. ITEM STATE U; # NPU STATE #
  92. ITEM STIMULUS U; # STIMULUS TO STATE TABLE #
  93. ITEM TSBFWA U; # TSB FWA #
  94. ITEM TSBSIZE U; # TSB SIZE #
  95.  
  96. #
  97.   TABLE OF PFC/SFC CODES FOR LEGAL NETWORK SUPERVISORY MESSAGES
  98. #
  99. DEF ENDNSMT # 8 #;
  100. ARRAY NPFCSFCTAB [0:ENDNSMT] S(1);
  101. BEGIN
  102. ITEM NSM$PFCSFC U(0,0,16) = [ # VALID NETWORK SM PFC/SFC #
  103. NPUDTN,
  104. NPUDTA,
  105. NPUDTN,
  106. NPUDTA,
  107. NPUDTN,
  108. NPUDTA,
  109. NPUIN,
  110. NPUIN,
  111. 0,
  112. ];
  113. ITEM NSM$NWSTIM S:NWSTIM(0,42,18) = [ # NETWORK STIMULUS CODE #
  114. S"NR$NPUDTD", # NPU/DT/N (DUMP) #
  115. S"AR$NPUDTD", # NPU/DT/A (DUMP) #
  116. S"NR$NPUDTL", # NPU/DT/N (LOAD) #
  117. S"AR$NPUDTL", # NPU/DT/A (LOAD) #
  118. S"NR$NPUDTS", # NPU/DT/N (START) #
  119. S"AR$NPUDTS", # NPU/DT/A (START) #
  120. S"RQ$SAMLOAD", # NPU/IN/C (SAM LOAD) #
  121. S"RQ$NPULOAD", # NPU/IN/R (NPU LOAD) #
  122. S"DUMMY", # UNRECOGNIZED SM #
  123. ];
  124. END
  125. #
  126.   TABLE OF VALID NPU STATES ON ACTIVE NPUS
  127. #
  128. DEF L$NSTATES # 13 #;
  129. ARRAY NPUSTATES [1:L$NSTATES] S(1);
  130. BEGIN
  131. ITEM ST$NPU U(0,0,7); # NPU STATE #
  132. ITEM ST$PRIMARY S:PRISTATE(0,0,3) = [ # NPU PRIMARY STATE #
  133. S"NPS$DNDCB",
  134. S"NPS$LNPU",
  135. S"NPS$LNPU",
  136. S"NPS$LNPU",
  137. S"NPS$LNPU",
  138. S"NPS$LNPU",
  139. S"NPS$LNPU",
  140. S"NPS$DNPU",
  141. S"NPS$DNPU",
  142. S"NPS$DNPU",
  143. S"NPS$LSAM",
  144. S"NPS$LSAM",
  145. 0,
  146. ];
  147. ITEM ST$SECOND S:SECSTATE(0,3,3) = [ # NPU SECONDARY STATE #
  148. 0,
  149. S"NSS$WLOAD",
  150. S"NSS$WSTART",
  151. S"NSS$WDUMP",
  152. S"NSS$WLOAD",
  153. S"NSS$WSTART",
  154. S"NSS$WNDCB",
  155. S"NSS$WDUMP",
  156. S"NSS$WLOAD",
  157. S"NSS$WSTART",
  158. S"NSS$WLOAD",
  159. S"NSS$WSTART",
  160. 0,
  161. ];
  162. ITEM ST$SUDBIT B(0,6,1) = [ # SUD BIT SETTING #
  163. FALSE,
  164. TRUE,
  165. TRUE,
  166. TRUE,
  167. FALSE,
  168. FALSE,
  169. FALSE,
  170. FALSE,
  171. FALSE,
  172. FALSE,
  173. FALSE,
  174. FALSE,
  175. FALSE,
  176. ];
  177. ITEM ST$ORDINAL S:NPUSTATE(0,42,18) = [ # NPU STATE ORDINAL #
  178. S"DUMPNDCB", # WAITING FOR DUMP NDCB RESPONSE #
  179. S"LOADSUD", # WAIT FOR LOAD SUD RESPONSE #
  180. S"STARTSUD", # WAITING FOR START SUD RESPONSE #
  181. S"DUMPSUD", # WAIT FOR DUMP SUD RESPONSE #
  182. S"LOADNPU", # WAITING FOR LOAD NPU RESPONSE #
  183. S"STARTNPU", # WAITING FOR START NPU RESPONSE #
  184. S"LOADNDCB", # WAITING FOR LOAD NDCB RESPONSE #
  185. S"DUMPNPU", # WAIT FOR DUMP NPU RESPONSE #
  186. S"LOADDBS", # WAITING FOR LOAD DUMP BOOTSTRAP RESPONSE#
  187. S"STARTDBS", # WAITING FOR START DUMP BOOTSTRAP RESP #
  188. S"LOADSAM", # WAITING FOR LOAD SAM RESPONSE #
  189. S"STARTSAM", # WAITING FOR START SAM RESPONSE #
  190. S"BADSTATE", # UNRECOGNIZABLE NPU STATE #
  191. ];
  192. END
  193.  
  194. DEF L$NSMABT # 2 #;
  195. DEF DM$NSMABT # DM$LOCAL+DM$ABORT #; # ROUTING OPTIONS #
  196. ARRAY MSG$NSMABT [0:0] S(L$NSMABT);
  197. BEGIN
  198. ITEM NSMA$TEXT C(0,0,18) = # MESSAGE TEXT #
  199. ["INVALID NPU STATE."];
  200. ITEM NSMA$END U(01,48,12) = [0]; # END OF TEXT #
  201. END
  202.  
  203. SWITCH NSMCASE # NETWORK SM PFC/SFC SWITCH #
  204. NSMNPUDTN,
  205. NSMNPUDTA,
  206. NSMNPUDTN,
  207. NSMNPUDTA,
  208. NSMNPUDTN,
  209. NSMNPUDTA,
  210. NSMNPUIN,
  211. NSMNPUIN,
  212. NSMERROR,
  213. ;
  214. CONTROL EJECT;
  215.  
  216. $BEGIN
  217. NS$DBG("NSM"); # TRACE CALL #
  218. $END
  219.  
  220. HN = ABHDN[0];
  221. SN = ABHSN[0];
  222. ERRCODE = 0;
  223. #
  224.   VALIDATE ABH
  225. #
  226. IF ABHABT[0] EQ APPPN
  227. AND HN NQ 0
  228. AND SN NQ 0
  229. AND ABHCN[0] EQ 0
  230. AND ABHBT[0] EQ NETCMD
  231. AND ABHACT[0] EQ CT8ASCII
  232. THEN # VALID APPLICATION BLOCK HEADER #
  233. BEGIN
  234. #
  235.   IDENTIFY NETWORK SUPERVISORY MESSAGE
  236. #
  237. SMPFC = PFC[0];
  238. SMPFCSFC = PFCSFC[0]; # PFC/SFC OF SM #
  239. NSM$PFCSFC[ENDNSMT] = SMPFCSFC; # GURANTEE PFC/SFC MATCH #
  240.  
  241. FOR INDEX = 0 WHILE NSM$PFCSFC[INDEX] NQ SMPFCSFC
  242. DO # SEARCH FOR PFC/SFC MATCH #
  243. BEGIN
  244. INDEX = INDEX + 1;
  245. END
  246.  
  247. GOTO NSMCASE[INDEX]; # CASE ON PFC/SFC #
  248.  
  249. NSMNPUIN: # NPU/IN/R #
  250. IF NPULT[0] LQ LOADTYPE"LT$REMOT"
  251. THEN # VALID LOAD TYPE #
  252. BEGIN
  253. IF NPULT[0] NQ LOADTYPE"LT$SAM"
  254. THEN # REQUEST TO LOAD LOCAL OR REMOTE NPU #
  255. INDEX = INDEX + 1; # ADJUST INDEX VALUE #
  256. GOTO NSMP1;
  257. END
  258.  
  259. ELSE # INVALID LOAD TYPE #
  260. GOTO NSMERROR;
  261.  
  262. NSMNPUDTN: # NPU/DT/N #
  263. NSMNPUDTA: # NPU/DT/A #
  264. IF NPUCC[0] LQ CMDCODE"CC$STRTR"
  265. THEN # VALID COMMAND CODE #
  266. BEGIN
  267. INDEX = INDEX + NPUCC[0]*2; # ADJUST INDEX TO COMMAND CODE#
  268. GOTO NSMP1;
  269. END
  270.  
  271. ELSE # INVALID COMMAND CODE #
  272. GOTO NSMERROR;
  273.  
  274. NSMERROR: # NETWORK SM ERROR #
  275. ERRCODE = NS$FEC(EC"ERR$SM",SMEC"NSM$FMT");
  276. GOTO NSMEXIT; # RETURN #
  277.  
  278. #
  279.   ASSIGN NETWORK STIMULUS CODE
  280. #
  281. NSMP1:
  282. STIMULUS = NSM$NWSTIM[INDEX]; # NETWORK STIMULUS CODE #
  283. #
  284.   LOCATE NPU TABLE ENTRY
  285. #
  286. NTORD = 0;
  287. FOUND = FALSE;
  288. NODEID = SN; # SOURCE NODE OF SUPERVISORY MESSAGE #
  289.  
  290. IF SMPFC EQ NPU
  291. THEN # NPU/IN/R OR NPU/DT/N OR NPU/DT/A #
  292. BEGIN # SEARCH NODE CONNECTION LIST FOR MATCH #
  293.  
  294. IF HN EQ SN
  295. THEN # DUMPING/LOADING LOCAL NPU, LOADING SAM #
  296. PN = 0; # PORT NUMBER NOT APPLICABLE FOR COUPLER #
  297.  
  298. ELSE # DUMPING/LOADING REMOTE NPU #
  299. PN = NPUPO[0]; # PORT NUMBER OF TRUNK #
  300.  
  301. NCTORD = NCT$LISTHP[0]; # ORDINAL OF FIRST ENTRY IN NCT LIST #
  302. FOR INDEX = 0 WHILE NOT FOUND
  303. AND NCTORD NQ 0
  304. DO
  305. BEGIN
  306.  
  307. IF NCT$NODE[NCTORD] EQ NODEID # SOURCE NODE MATCH #
  308. AND NCT$PN[NCTORD] EQ PN # PORT NUMBER MATCH #
  309. THEN # FOUND NPU NODE NEIGHBOR TO SOURCE NODE #
  310. BEGIN
  311. NTORD = NCT$NTORD[NCTORD]; # NPU TABLE ORDINAL OF NPU #
  312. NPT$NCTORD[NTORD] = NCTORD; # SAVE NCT ORDINAL IN NPT #
  313. FOUND = TRUE;
  314. END
  315.  
  316. ELSE # TRY NEXT NCT ENTRY IN NCT LIST#
  317. NCTORD = NCT$LISTFP[NCTORD]; # NCT ORDINAL OF NEXT ENTRY #
  318.  
  319. END
  320. END
  321.  
  322. IF NTORD NQ 0
  323. THEN # NPU TABLE ENTRY FOR THIS SM LOCATED #
  324. BEGIN
  325. NATTSBN = NPT$NATTSB[NTORD]; # TSB NUMBER OF CURRENT NAT #
  326. NPNAM = NPT$NPNAME[NTORD]; # SAVE CURRENT NPU NAME #
  327.  
  328. IF NATTSBN NQ 0
  329. THEN # NAT EXISTS #
  330. BEGIN
  331. TSBINFO(TSBSIZE,TSBFWA,NATTSBN); # LOCATE NAT, NON-MOVABLE #
  332. P<NAT> = TSBFWA; # SET NAT FWA, NAT BECOMES NON-MOVABLE #
  333.  
  334. IF EB[0]
  335. OR RB[0]
  336. THEN # IF A SM RESPONSE #
  337. BEGIN # CHECK FOR MATCH WITH CURRENT ACTIVITY #
  338.  
  339. IF HN NQ NAT$HN[0]
  340. OR SN NQ NAT$SN[0] # LOAD PATH MISMATCH #
  341. OR (SMPFC EQ NPU # SM IS NPU/DT/N OR NPU/DT/A #
  342. AND (NPULS[0] NQ NAT$LSN[0] # LSN MISMATCH #
  343. OR NCTORD NQ NAT$NCTORD[0])) # TRUNK MISMATCH #
  344. THEN # DISCARD SM #
  345. BEGIN
  346. GOTO NSMEXIT; # RETURN #
  347. END
  348.  
  349. END
  350.  
  351. #
  352.   ASSIGN ORDINAL FOR CURRENT NPU STATE
  353. #
  354. STATE =NAT$STATE[0]; # CURRENT NPU STATE #
  355. ST$NPU[L$NSTATES] = STATE; # GURANTEE STATE MATCH #
  356.  
  357. FOR INDEX = 1 WHILE STATE NQ ST$NPU[INDEX]
  358. DO # VALID STATE #
  359. BEGIN
  360. INDEX = INDEX + 1;
  361. END
  362.  
  363. STATE = ST$ORDINAL[INDEX]; # NPU STATE ORDINAL #
  364. END
  365.  
  366. ELSE # NAT NOT EXISTS #
  367. STATE = NPUSTATE"IDLE"; # SET NPU STATE ORDINAL TO IDLE #
  368.  
  369. IF STATE NQ NPUSTATE"BADSTATE"
  370. THEN # NPU IS IN VALID STATE #
  371. BEGIN # CALL NPU STATE TABLE PROCESSOR #
  372. NS$NSS(STATE,STIMULUS,ERRCODE);
  373. END
  374.  
  375. ELSE # ABORT NS, INVALID NPU STATE #
  376. BEGIN
  377. NS$MSG(MSG$NSMABT,L$NSMABT,DM$NSMABT);
  378. END
  379.  
  380. NATTSBN = NPT$NATTSB[NTORD]; # GET TSB NUMBER OF NAT #
  381. IF NATTSBN NQ 0
  382. THEN # NAT EXISTS #
  383. MOVEOK(NATTSBN); # ALLOW NAT TO MOVE #
  384. END
  385.  
  386. ELSE # NPU TABLE ENTRY NOT FOUND #
  387. BEGIN # NETWORK SM ERROR - BAD NETWORK ADDRESS #
  388. ERRCODE = NS$FEC(EC"ERR$SM",SMEC"NSM$ADDR");
  389. END
  390.  
  391. END
  392.  
  393. ELSE # INVALID ABH #
  394. BEGIN # NETWORK SM ERROR - BAD ABH #
  395. ERRCODE = NS$FEC(EC"ERR$SM",SMEC"NSM$ABH");
  396. END
  397.  
  398. NSMEXIT:
  399. RETURN;
  400. END # NS$NSM #
  401. TERM
cdc/nos2.source/nam5871/ns_nsm.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator