User Tools

Site Tools


cdc:nos2.source:nam5871:cssans

CSSANS

Table Of Contents

  • [00007] PROC CSSANS
  • [00008] CSSANS - ACQUIRE NPU SUPERVISION.
  • [00013] ACQUIRE NPU SUPERVISION.
  • [00039] PROC MESSAGE
  • [00040] PROC ABORT
  • [00041] PROC SSBCBW
  • [00042] PROC SSBSBW
  • [00043] PROC SSBTBW
  • [00044] PROC SSCCTR
  • [00045] PROC SSTAQE
  • [00046] FUNC XCHD U

Source Code

CSSANS.txt
  1. *DECK CSSANS
  2. USETEXT TEXTSS
  3. USETEXT TXTSUSS
  4. USETEXT TEXTCS
  5. USETEXT TXTAPSS
  6. USETEXT TXTSMCS
  7. PROC CSSANS;
  8. # TITLE CSSANS - ACQUIRE NPU SUPERVISION. #
  9.  
  10. BEGIN # CSSANS #
  11.  
  12. #
  13. ** CSSANS - ACQUIRE NPU SUPERVISION.
  14. *
  15. * C.BRION 82/02/13.
  16. * C.BRION 82/04/28.
  17. *
  18. * THIS PROCEDURE PROCESSES THE SUPERVISION REQUEST SMS FROM NPUS.
  19. *
  20. * PROC CSSANS
  21. *
  22. * ENTRY:
  23. * WCBUF = WORD COUNT WORD FOR ENTRY.
  24. * ABHBUF = APPLICATION BLOCK HEADER WORD.
  25. * MSGBUF = ENTRY BODY OF SUP/IN/R SM.
  26. *
  27. * EXIT:
  28. * THE NPU SUPERVISION REQUEST IS PROCESSED AND THE NPU
  29. * IS EITHER GRANTED OR DENIED SUPERVISION PRIVILEDGES.
  30. *
  31. #
  32.  
  33. #
  34. **** PROC CSSANS XREF LIST
  35. #
  36.  
  37. XREF
  38. BEGIN
  39. PROC MESSAGE;
  40. PROC ABORT;
  41. PROC SSBCBW; # CLEAR BIT IN WORD #
  42. PROC SSBSBW; # STORE BIT IN WORD #
  43. PROC SSBTBW; # TEST BIT IN WORD #
  44. PROC SSCCTR; # CANCEL TIMER REQUEST #
  45. PROC SSTAQE; # ACCEPT QUEUE ENTRY #
  46. FUNC XCHD U;
  47. END
  48.  
  49. #
  50. ****
  51. #
  52.  
  53. #
  54. * PROC CSSANS DEFS
  55. #
  56.  
  57. DEF LDMSGL$ # 50 #; # LOST DATA MSG CHARLENGTH #
  58. DEF MISSNPUL$ # 20 #; # MISSING NPU MSG CHAR LEN #
  59. DEF SUPMSGL$ # 40 #; # SUPERVISION LOST/GAINED #
  60. # MESSAGE CHAR LENGTHS #
  61. DEF MATCHID$ # 99 #; # MATCH IDENTIFIER FOR END #
  62. # OF LIST MATCH #
  63.  
  64. #
  65. * ITEM DEFINITIONS
  66. #
  67.  
  68. ITEM DCDNPUNID C(3); # DCD NPU NODE ID #
  69. ITEM CCPLEVEL C(1); # CHARACTER FORM OF CCP LVL #
  70. ITEM LEVMATCH B; # FLAG MATCH OF NCF/CCP LVL #
  71. ITEM NPUINDX U; # NPU INDEX VAR #
  72. ITEM INTNPUNID I; # INTEGER NPU NODE ID #
  73. ITEM OCBORD I; # OCB ORDINAL VALUE #
  74. ITEM PENDING B; # PENDING COMMAND FLAG #
  75. ITEM I I; # LOOP VARIABLE #
  76. ITEM J I; # LOOP VARIABLE #
  77. ITEM TNAME C(10); # OPERATOR TERMINAL NAME #
  78. ITEM SUCCESS B; # FLAG SET AFTER TIMER CANCEL#
  79.  
  80. #
  81. * FLG$WORD - BASED ARRAY USED TO POINT TO THE REPORT BIT MAPS IN
  82. * THE NPUCB-S.
  83. #
  84. BASED ARRAY FLG$WORD [00:00] S(NPCBSZ$);
  85. BEGIN
  86. ITEM FW$WORD I(00,00,60);
  87. END
  88.  
  89.  
  90. #
  91. * SUPMSG - SUPERVISION GAINED MESSAGE ARRAY.
  92. *
  93. * THIS MESSAGE IS ISSUED WHEN SUPERVISION PRIVILEDGE ALLOWED.
  94. #
  95.  
  96. ARRAY SUPMSG [00:00] S(4);
  97. BEGIN
  98. ITEM SUP$TXT1 C(00,00,05) = ["NPU: "];
  99. ITEM SUP$NAME C(00,30,07); # NPU NAME #
  100. ITEM SUP$TXT2 C(01,12,01) = [","];
  101. ITEM SUP$NID C(01,18,03); # NPU NODE NUMBER #
  102. ITEM SUP$TXT3 C(01,36,20) = [",SUPERVISION GAINED."];
  103. ITEM SUP$ZERO U(03,36,24) = [0];
  104. END
  105.  
  106. #
  107. * SRJMSG - SUPERVISION REJECTED MESSAGE ARRAY.
  108. *
  109. * THIS MESSAGE IS ISSUED WHEN AN NPU IS REFUSED SUPERVISION.
  110. #
  111. ARRAY SRJMSG [00:00] S(4);
  112. BEGIN
  113. ITEM SRJ$TXT1 C(00,00,05) = ["NPU: "];
  114. ITEM SRJ$NAME C(00,30,07); # NPU NAME #
  115. ITEM SRJ$TXT2 C(01,12,01) = [","];
  116. ITEM SRJ$NID C(01,18,03); # NPU NODE ID #
  117. ITEM SRJ$TXT3 C(01,36,21) = [",NCF VERSION MISMATCH"];
  118. ITEM SRJ$ZERO U(03,42,18) = [0];
  119. END
  120.  
  121.  
  122. #
  123. * LDAMSG - LOST DATA MESSAGE.
  124. *
  125. * THIS MESSAGE IS ISSUED TO INFORM THE OPERATOR OF POSSIBLE DATA
  126. * LOSS OCCURRED.
  127. #
  128.  
  129. ARRAY LDAMSG [00:00] S(5);
  130. BEGIN
  131. ITEM LDA$TXT1 C(00,00,05) = ["NPU: "];
  132. ITEM LDA$NAME C(00,30,07); # NPU NAME #
  133. ITEM LDA$TXT2 C(01,12,01) = [","];
  134. ITEM LDA$NODE C(01,18,03); # NPU NODE NUMBER#
  135. ITEM LDA$TXT3 C(01,36,27) = [",MESSAGE MAY HAVE BEEN LOST"];
  136. ITEM LDA$ZERO U(04,18,42) = [0];
  137. END
  138.  
  139. #
  140. * DUPSUP - MSG ARRAY FOR DUPLICATE SUP/IN FROM SAME NPU ON SAME
  141. * LOGICAL LINK AS PREVIOUS SUP/IN.
  142. #
  143.  
  144. ARRAY DUPSUP [00:00] S(4);
  145. BEGIN
  146. ITEM DUP$TXT1 C(00,00,20) = ["CSSANS-DUPLICATE SUP"];
  147. ITEM DUP$TXT2 C(02,00,10) = ["/IN FROM "];
  148. ITEM DUP$NAME C(03,00,07);
  149. ITEM DUP$ZERO U(03,42,18) = [0];
  150. END
  151.  
  152.  
  153.  
  154. #
  155. * MAIN PROC START
  156. #
  157.  
  158.  
  159. NPUINDX = 0; # INITIALIZE NPU INDEX #
  160.  
  161. #
  162. * LOCATE THE NPUCB WITH SAME NODE NUMBER AS THE INCOMING SM SOURCE
  163. * NODE NUMBER. NOTICE THAT A SEARCH MATCH IS ALWAYS SECURED BY
  164. * PLACING THE SEARCH NODE NUMBER AT THE END OF THE NPUCB ARRAY.
  165. #
  166.  
  167. NPU$NID[CSNPCNT] = ABHSN[0];
  168. NPU$STAT[CSNPCNT] = MATCHID$;
  169.  
  170. FOR I = 0 STEP 1 WHILE
  171. NPU$NID[I] NQ ABHSN[0]
  172.  
  173. DO
  174. BEGIN
  175. END
  176.  
  177. IF NPU$STAT[I] EQ MATCHID$
  178. THEN
  179. BEGIN
  180. WCB$SMID[0] = SMID"SUPINUN";
  181. SSTAQE(P<EVQ>,WCBUF[0],ABH[0],CSSM[0]);
  182. GOTO ENDEXIT;
  183. END
  184.  
  185. #
  186. * IF SUP/IN RECEIVED FROM NPU ON SAME LOGICAL LINK AS IS CURRENTLY
  187. * SUPERVISED, SEND MSG TO DAYFILE AND DISCARD SUP/IN SM.
  188. #
  189.  
  190. IF (NPU$HID[I] EQ ABHDN[0] AND
  191. NPU$STAT[I] EQ SUPSTAT"SUP")
  192. THEN
  193. BEGIN
  194. DUP$NAME[0] = NPU$NAME[I];
  195. MESSAGE(DUPSUP[0],0);
  196. GOTO ENDEXIT;
  197. END
  198.  
  199. ABHWORD[1] = 0; # CLEAR OUTGOING ABH WORD #
  200.  
  201. #
  202. * A MATCHING NPUCB HAS BEEN FOUND.
  203. * CHECK FOR AN ACTIVE SEND COMMAND ON THE NPUCB. IF SEND ACTIVE,
  204. * INFORM THE SEND OPERATOR OF A POSSIBLE LOST MESSAGE AND CLEAR
  205. * THE SEND OPERATOR ORDINAL OF THE NPUCB.
  206. #
  207.  
  208. IF NPU$OPSD[I] NQ 0
  209. AND NPU$OPSD[I] LQ MAXACN$
  210. THEN
  211. BEGIN
  212. FOR OCBORD=HOPORD$ STEP 1 UNTIL MAXACN$
  213. DO
  214. BEGIN
  215. P<FLG$WORD> = LOC(NPU$SDFLGS[I]);
  216. SSBTBW(FLG$WORD,OCBORD,PENDING);
  217.  
  218. IF PENDING
  219. THEN
  220. BEGIN
  221. SSBCBW(FLG$WORD,OCBORD);
  222.  
  223. OC$CNPU[OCBORD] = 0; # CLEAR NPU ORDINAL #
  224. LDA$NAME[0] = NPU$NAME[I];
  225. LDA$NODE[0] = NPU$DNID[I];
  226. ABHADR[1] = OCBORD;
  227. ABHTLC[1] = LDMSGL$ ;
  228. WCB$SMID[1] = SMID"TTEXT";
  229. WCB$IAF[1] = TRUE;
  230. WCB$WC[1] = 2 + (ABHTLC[1] / 10) + 1;
  231. OC$NCNT[OCBORD] = OC$NCNT[OCBORD] - 1;
  232. IF OC$NCNT[OCBORD] NQ 0
  233. THEN
  234. WCB$IAF[1] = FALSE;
  235. ELSE
  236. OC$UVERB[OCBORD] = 0;
  237. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],LDAMSG[0]);
  238. END
  239. END
  240. END
  241.  
  242. NPU$OPSD[I] = 0;
  243.  
  244. #
  245. * CHECK FOR ACTIVE STATUS COMMAND ON NPUCB. IF ACTIVE, PREMATURELY
  246. * END THE STATUS AND INFORM THE STATUS OPERATOR VIA THE STATUS
  247. * FINISHED EVENT TO THE EVENT QUEUE.
  248. #
  249.  
  250. IF NPU$OPST[I] NQ 0
  251. AND NPU$OPST[I] LQ MAXACN$
  252. THEN
  253. BEGIN
  254. FOR OCBORD=HOPORD$ STEP 1 UNTIL MAXACN$
  255. DO
  256. BEGIN
  257. P<FLG$WORD> = LOC(NPU$STFLGS[I]);
  258. SSBTBW(FLG$WORD,OCBORD,PENDING);
  259.  
  260. IF PENDING
  261. THEN
  262. BEGIN
  263. SSBCBW(FLG$WORD,OCBORD);
  264.  
  265. IF OC$CNPU[OCBORD] EQ I
  266. THEN
  267. OC$CNPU[OCBORD] = 0;
  268.  
  269. OC$NCNT[OCBORD] = OC$NCNT[OCBORD] - 1;
  270.  
  271. IF OC$NCNT[OCBORD] EQ 0
  272. THEN
  273. BEGIN
  274. ABHADR[1] = OCBORD;
  275. WCB$SMID[1] = SMID"STUFIN";
  276. WCB$WC[1] = 2;
  277. SSTAQE(P<EVQ>,WCBUF[1],ABH[1],CSSM[1]);
  278. OC$VERB[OCBORD] = " ";
  279. END
  280.  
  281. END # IF PENDING #
  282.  
  283. END # FOR OCBORD #
  284.  
  285. END # IF NPU$OPST #
  286.  
  287. NPU$OPST[I] = 0;
  288.  
  289. #
  290. *
  291. * CLEAR CURRENT OVERLAY OPERATOR FOR NPUCB.
  292. #
  293.  
  294. NPU$OVFLGS[I] = 0;
  295.  
  296. #
  297. * CLEAR GO RECEIVED FLAG.
  298. #
  299.  
  300. NPU$GFLAG[I] = FALSE;
  301.  
  302. #
  303. * THIS NPUCB MAY ALREADY BE SUPERVISED. IF SO, THEN THE SUPERVISION
  304. * REQUEST SM PRECEEDED THE SUPERVISION BROKEN SM (PROBABLY ON A
  305. * DIFFERENT LOGICAL LINK). SIMULATE A SUPERVISION LOST EVENT TO
  306. * THE EVENT QUEUE. WHEN A SUPERVISION BROKEN SM DOES GET PROCESSED
  307. * THE CHECK TO BE SURE THAT THE SM CAME ON THE PROPER LOGICAL
  308. * LINK IS PERFORMED (IN PROC CSSTNS).
  309. #
  310.  
  311. IF NPU$STAT[I] EQ SUPSTAT"SUP"
  312. THEN
  313. BEGIN
  314. ABHWORD[1] = ABHWORD[0];
  315. WCB$SMID[1] = SMID"SUPCB";
  316. WCB$WC[1] = 2;
  317. SSTAQE(P<EVQ>,WCBUF[1],ABH[1],CSSM[1]);
  318. END
  319.  
  320. #
  321. * INITIAILIZE THE NPUCB FROM THE SUPERVISION REQUEST SM.
  322. #
  323.  
  324. NPU$HID[I] = ABHDN[0]; # SET HOST NODE OF NPUCB #
  325. IF SUPRI[0] EQ 0 # SET REMOTE INDICATOR #
  326. THEN
  327. NPU$RIND[I] = FALSE;
  328. ELSE
  329. NPU$RIND[I] = TRUE;
  330. ABHWORD[1] = ABHWORD[0];
  331. ABHDN[1] = ABHSN[0]; # SET UP OUTGOING DESTINATION#
  332. ABHSN[1] = ABHDN[0]; # SET UP OUTGOING SOURCE #
  333.  
  334. # SET UP NCF/CCP LEVEL NUMBER COMPARISON #
  335.  
  336. CCPLEVEL = XCHD(SUPVCVE[0]);
  337. LEVMATCH = (B<12,6>CSNCFLEV EQ CCPLEVEL);
  338.  
  339. #
  340. * THE REPORTED NCF CHECKSUM VALUE NEEDS TO BE COMPARED WITH THE
  341. * CHECKSUM OF THE CORRESPONDING NPUCB. IF THE SELF-LOADING FLAG
  342. * (THE HI-ORDER BIT OF THE CHECKSUM FIELD) IS NOT SET THEN
  343. * THERE IS NO NEED TO DO THE COMPARE. OTHERWISE, THE FIELDS
  344. * MUST MATCH IN ORDER FOR SUPERVISION TO BE GRANTED.
  345. #
  346.  
  347. IF ( ( ( SUPVN[0] EQ NPU$CSUM[I] )
  348. AND LEVMATCH )
  349. OR NOT SUPSLF[0] )
  350. THEN
  351.  
  352. #
  353. * OK TO GRANT SUPERVISION. SET THE NPUCB STATE TO SUPERVISED,
  354. * SET UP THE SUPERVISION REQUEST NORMAL RESPONSE SM FOR OUTPUT.
  355. #
  356.  
  357. BEGIN
  358. NPU$STAT[I] = SUPSTAT"SUP";
  359. CSNPSUP = CSNPSUP + 1; # INCREMENT SUPER NPUS #
  360. PFCSFC[1] = SUPINN;
  361. WCB$SMID[1] = SMID"SUPINN";
  362. WCB$WC[1] = LSUPINN + 2;
  363. ABHTLC[1] = NSUPINN;
  364. END
  365.  
  366. ELSE
  367.  
  368. #
  369. * A NCF CHECKSUM MISMATCH HAS OCCURRED. SET THE STATE OF THE NPUCB
  370. * TO NCF MISMATCH. SET UP THE SUPERVISION REQUEST ABNORMAL RESPONSE
  371. * SM FOR OUTPUT.
  372. #
  373.  
  374. BEGIN
  375. IF LEVMATCH THEN
  376. NPU$STAT[I] = SUPSTAT"NCFMIS";
  377. ELSE
  378. NPU$STAT[I] = SUPSTAT"LEVMIS";
  379. PFCSFC[1] = SUPINA;
  380. IF NPU$LRF[I] # SET LOAD REQ FLAG #
  381. THEN
  382. SUPLR[1] = 1;
  383. ELSE
  384. SUPLR[1] = 0;
  385. IF NPU$DMPF[I]
  386. THEN
  387. SUPDP[1] = O"131"; # SET ASCII Y FOR DUMP FLAG #
  388. ELSE
  389. SUPDP[1] = O"116"; # SET ASCII N FOR DUMP FLAG #
  390.  
  391. ABHTLC[1] = NSUPINA;
  392. WCB$SMID[1] = SMID"SUPINA";
  393. WCB$WC[1] = LSUPINA + 2;
  394. END
  395.  
  396. #
  397. * SEND THE GENERATED SM FOR OUTPUT AND THE CORRESPONDING EVENT TO
  398. * THE EVENT PROCESSOR QUEUE.
  399. #
  400.  
  401. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],CSSM[1]);
  402.  
  403.  
  404. #
  405. * SET UP FOR SUP/IN EVENT TO EVENT PROCESSOR.
  406. #
  407.  
  408. WCB$WC[1] = WCB$WC[1] + 1;
  409. SSTAQE(P<EVQ>,WCBUF[1],ABH[1],CSSM[0]);
  410.  
  411. #
  412. * CLEAR THE NPUCB LOAD REQUEST FLAG AND DUMP FLAG.
  413. #
  414.  
  415. NPU$LRF[I] = FALSE;
  416. NPU$DMPF[I] = FALSE;
  417.  
  418. #
  419. * IF THERE IS AN OPERATOR WITH AUTO CONTROL STATUS, THEN SET
  420. * THAT OPERATOR TO BE THE CONTROLLING NOP AND SEND AN EVENT
  421. * INDICATING THAT CONTROL IS GAINED.
  422. #
  423. IF CSACNOP NQ 0
  424. THEN
  425. BEGIN
  426. NPU$CNOP[I] = CSACNOP;
  427.  
  428. WCB$WORD[1] = 3;
  429. WCB$SMID[1] = SMID"CTRLON";
  430. ABHSN[1] = I;
  431. TNAME = OC$TNAM[CSACNOP];
  432. SSTAQE(P<EVQ>,WCBUF[1],ABH[1],TNAME);
  433.  
  434. P<FLG$WORD> = LOC(NPU$RFLGS[I]);
  435. SSBSBW( FLG$WORD , CSACNOP );
  436. END
  437.  
  438. #
  439. * IF THERE IS AN OUTSTANDING GO REQUEST FOR THIS NPU, THEN CANCEL IT
  440. * AND CLEAR THE GO FLAG.
  441. #
  442. IF NPU$GFLAG[I]
  443. THEN
  444. BEGIN
  445. SSCCTR(NPU$CNUM[I],SUCCESS);
  446.  
  447. NPU$GFLAG[I] = FALSE;
  448. END
  449.  
  450. ENDEXIT:
  451.  
  452. END # CSSANS #
  453.  
  454. TERM
cdc/nos2.source/nam5871/cssans.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator