User Tools

Site Tools


cdc:nos2.source:nam5871:cssaco

CSSACO

Table Of Contents

  • [00008] PROC CSSACO
  • [00009] CSSACO - ACTION CONTROL COMMAND
  • [00041] PROC SSBCBW
  • [00042] PROC SSBSBW
  • [00043] PROC SSTAQE
  • [00144] PROC FORMSTAT(ORDINAL)
  • [00145] FORMSTAT - FORMAT NPU STATUS LINE.

Source Code

CSSACO.txt
  1. *DECK CSSACO
  2. USETEXT TEXTCS;
  3. USETEXT TEXTSS;
  4. USETEXT TXTSMCS;
  5. USETEXT TXCMDCS;
  6. USETEXT TXTAPSS;
  7. USETEXT TXTSUSS;
  8. PROC CSSACO;
  9. # TITLE CSSACO - ACTION CONTROL COMMAND #
  10.  
  11. BEGIN # CSSACO #
  12. #
  13. ** PROC CSSACO
  14. *
  15. * C. BRION 82/04/30.
  16. * D. K. ENDO 83/02/09 ADD MULTIPLE NOPS.
  17. *
  18. * THIS PROC PROCESSES THE CONTROL COMMAND FOR CS.
  19. *
  20. * PROC CSSACO
  21. *
  22. * ENTRY
  23. * 1. HDRCMD[0] = HEADER WORD FOR FORMATTED COMMAND BLOCK.
  24. * 2. PARMS[0] = COMMAND BLOCK CONTAINING THE ORIGINAL TYPEIN
  25. * AND STRUCTURED FORMATTED PARAMETERS.
  26. *
  27. * EXIT
  28. * 1. CSCNOP = ACN VALUE OF CONTROLLING NOP UPDATED.
  29. * 2. TERMINAL TEXT TO THE CONNECTION TRAFFIC QUEUE FOR THE
  30. * REQUESTING NOP.
  31. * 3. CONTROL OFF/ON ENTRY TO THE EVENT QUEUE.
  32. *
  33. #
  34.  
  35. #
  36. **** PROC CSSACO XREF LIST
  37. #
  38.  
  39. XREF
  40. BEGIN
  41. PROC SSBCBW; # SS-CLEAR BIT IN WORD #
  42. PROC SSBSBW; # SS-SET BIT IN WORD #
  43. PROC SSTAQE; # SS-ACCEPT QUEUE ENTRY #
  44. END
  45.  
  46. #
  47. ****
  48. #
  49.  
  50. #
  51. * PROC CSSACO DEFS
  52. #
  53. DEF MODEIDX # HDR$TXWCNT[0]+3 #;# MODE INDEX INTO PARM LIST #
  54. DEF NORIDX # HDR$TXWCNT[0]+4 #;# NPU ORDINAL INDEX #
  55. DEF NPIDX # HDR$TXWCNT[0]+2 #;# NPU INDEX INTO PARM LIST #
  56.  
  57. #
  58. * PROC CSSACO ITEMS
  59. #
  60.  
  61. ITEM I;
  62. ITEM CTRLCNT; # NUMBER OF NPUS CONTROLLED #
  63. ITEM NPUORD; # NPUCB ORDINAL #
  64. ITEM ONFLAG B; # OFF KEYWORD INDICATOR #
  65. ITEM TNAME C(10); # TERMINAL NAME #
  66.  
  67.  
  68. #
  69. * FLG$WORD - BASED ARRAY USED TO POINT TO THE REPORT BIT MAP
  70. * IN THE NPUCB-S.
  71. #
  72. BASED ARRAY FLG$WORD [00:00] S(NPCBSZ$);
  73. BEGIN
  74. ITEM FW$WORD I(00,00,60);
  75. END
  76.  
  77.  
  78. #
  79. * RESCMD - MESSAGE ARRAY FOR RESTRICTED CMD MESSAGE.
  80. #
  81.  
  82. ARRAY RESCMD [00:00] S(5);
  83. BEGIN
  84. ITEM RES$TXT0 C(00,00,20) = ["COMMAND RESTRICTED T"];
  85. ITEM RES$TXT1 C(02,00,20) = ["O NETWORK OPERATORS "];
  86. ITEM RES$TXT2 U(04,00,60) = [0];
  87. END
  88.  
  89. #
  90. * ALLCTRL - ALL NPU-S ARE CONTROLLED MESSAGE ARRAY.
  91. #
  92. ARRAY ALLCTRL [00:00] S(5);
  93. BEGIN
  94. ITEM ACT$TXT1 C(00,00,20) = ["ALL NPUS ARE BEING C"];
  95. ITEM ACT$TXT2 C(02,00,23) = ["ONTROLLED BY OTHER NOPS"];
  96. ITEM ACT$ZBYT U(04,12,48) = [0];
  97. END
  98.  
  99. #
  100. * AUCTRL - AUTO CONTROL STATUS MESSAGE ARRAY.
  101. #
  102. ARRAY AUCTRL [00:00] S(4);
  103. BEGIN
  104. ITEM AUC$TXT1 C(00,00,20) = ["YOU NOW HAVE AUTO CO"];
  105. ITEM AUC$TXT2 C(02,00,12) = ["NTROL STATUS"];
  106. ITEM AUC$ZBYT U(03,12,48) = [0];
  107. END
  108.  
  109. #
  110. * CTRLNOP - CONTROLLING NOP MESAGE ARRAY.
  111. #
  112.  
  113. ARRAY CTRLNOP [00:00] S(3);
  114. BEGIN
  115. ITEM CTR$TNAM C(00,00,07); # TERMINAL NAME #
  116. ITEM CTR$TXT1 C(00,42,03) = [" IS"];
  117. ITEM CTR$TXT2 C(01,00,16) = [" CONTROLLING NOP"];
  118. ITEM CTR$ZERO U(02,36,24) = [0];
  119. END
  120.  
  121. #
  122. * NOCTRL - NO CONTROLLING NOP MESSAGE.
  123. #
  124.  
  125. ARRAY NOCTRL [00:00] S(4);
  126. BEGIN
  127. ITEM NCT$MSG1 C(00,00,16) = ["YOU ARE NOT THE "];
  128. ITEM NCT$MSG2 C(01,36,15) = ["CONTROLLING NOP"];
  129. ITEM NCT$ZBYT U(03,06,54) = [ 0 ];
  130. END
  131.  
  132. #
  133. * NOACTRL - NO AUTO CONTROL PERMITTED MESSAGE ARRAY.
  134. #
  135. ARRAY NOACTRL [00:00] S(3);
  136. BEGIN
  137. ITEM NAC$TNAM C(00,00,07);
  138. ITEM NAC$TXT1 C(00,42,17) = [" HAS AUTO CONTROL"];
  139. ITEM NAC$ZBYT U(02,24,36) = [0];
  140. END
  141.  
  142.  
  143. CONTROL EJECT;
  144. PROC FORMSTAT(ORDINAL);
  145. # TITLE FORMSTAT - FORMAT NPU STATUS LINE. #
  146.  
  147. BEGIN # FORMSTAT #
  148.  
  149. #
  150. * FORMSTAT - FORMAT NPU STATUS LINE.
  151. *
  152. * D.K. ENDO 83/02/09
  153. *
  154. * THIS IMBEDDED ROUTINE OF CSSACO FORMATS AN NPU STATUS LINE AND
  155. * SENDS IT TO THE OPERATOR VIA THE C-LAYER.
  156. *
  157. * PROC FORMSTAT(ORDINAL)
  158. *
  159. * ENTRY 1. ORDINAL = NPUCB ORDINAL.
  160. * 2. ABHADR[0] = OPERATOR OCB ORDINAL (ACN).
  161. *
  162. * EXIT 1. ENTRY IN THE C-LAYER QUEUE.
  163. #
  164.  
  165. ITEM ORDINAL; # NPUCB ORDINAL #
  166.  
  167. #
  168. * NPLINE - MSG ARRAY FOR NPU INFO LINE.
  169. #
  170.  
  171. ARRAY NPLINE [00:00] S(3);
  172. BEGIN
  173. ITEM NPL$TXT0 C(00,00,04) = ["NPU:"];
  174. ITEM NPL$NPNAME C(00,24,07); # NPU NAME #
  175. ITEM NPL$TXT1 C(01,06,01) = [","];
  176. ITEM NPL$NID C(01,12,03); # NPU NODE ID #
  177. ITEM NPL$TXT2 C(01,30,01) = [","];
  178. ITEM NPL$STATE C(01,36,02); # NPU STATE #
  179. ITEM NPL$TXT3 C(01,48,02) = [", "];
  180. ITEM NPL$NGO C(02,00,06); # NEED GO INDICATOR #
  181. ITEM NPL$ZBYT U(02,36,24) = [0];
  182. END
  183.  
  184. #
  185. * FORMSTAT CODE BEGINS HERE
  186. #
  187.  
  188. NPL$NPNAME[0] = NPU$NAME[ORDINAL];
  189. NPL$NID[0] = NPU$DNID[ORDINAL];
  190.  
  191. IF NPU$GFLAG[ORDINAL]
  192. THEN
  193. BEGIN
  194. NPL$TXT3[0] = ", ";
  195. NPL$NGO[0] = "NEEDGO";
  196. END
  197. ELSE
  198. BEGIN
  199. NPL$TXT3[0] = " ";
  200. NPL$NGO[0] = " ";
  201. END
  202.  
  203. IF NPU$STAT[ORDINAL] EQ SUPSTAT"SUP"
  204. THEN
  205. NPL$STATE[0] = "AC";
  206. ELSE
  207. NPL$STATE[0] = "MI";
  208.  
  209. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],NPLINE[0]);
  210.  
  211. END # FORMSTAT #
  212.  
  213.  
  214. #
  215. * PROC CSSACO EXECUTION STARTS HERE
  216. #
  217. #
  218. * IF A HOP ATTEMPTED CONTROL COMMAND, SUPERFLUOUS. INFORM THE HOP
  219. * WITH A MESSAGE.
  220. #
  221.  
  222. IF HDR$OPORD[0] EQ HOPORD$
  223. THEN
  224. BEGIN
  225. WCB$WORD[1] = 7;
  226. WCB$SMID[1] = SMID"TTEXT";
  227. ABHADR[1] = HDR$OPORD[0];
  228. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],RESCMD[0]);
  229. GOTO ENDEXIT;
  230. END
  231.  
  232. #
  233. * COMMAND ATTEMPTED FROM NOP. CHECK FOR ON OR OFF KEYWORD IN THE
  234. * COMMAND PARMS ARRAY. IF NO KEYWORD PRESENT, DEFAULT TO ON.
  235. #
  236.  
  237. IF PAR$PCODE[MODEIDX] EQ "ON0"
  238. THEN
  239. BEGIN
  240. ONFLAG = TRUE;
  241. END
  242. ELSE
  243. BEGIN
  244. ONFLAG = FALSE;
  245. END
  246.  
  247. #
  248. * IF A SPECIFIC NPU WAS SPECIFIED, THEN GET THE NPUCB ORDINAL
  249. * FROM THE PARAMETER LIST.
  250. #
  251. IF PAR$PCODE[NPIDX] EQ "NP0"
  252. THEN
  253. BEGIN
  254. NPUORD = PAR$ORD[NORIDX];
  255.  
  256. #
  257. * IF CONTROL IS REQUESTED, THEN CHECK IF THIS NPU IS ALREADY
  258. * CONTROLLED. IF NOT, THEN STORE THE OPERATOR ACN IN THE NPUCB
  259. * AND SEND THE EVENT TO THE EVENT QUEUE, OTHERWISE SEND AN ERROR
  260. * MESSAGE INDICATING THE NPU IS ALREADY UNDER CONTROL.
  261. #
  262. IF ONFLAG
  263. THEN
  264. BEGIN
  265. IF NPU$CNOP[NPUORD] EQ 0
  266. THEN
  267. BEGIN
  268. NPU$CNOP[NPUORD] = HDR$OPORD[0];
  269. WCB$WORD[1] = 3;
  270. WCB$SMID[1] = SMID"CTRLON";
  271. ABHSN[1] = NPUORD;
  272. TNAME = OC$TNAM[NPU$CNOP[NPUORD]];
  273. SSTAQE(P<EVQ>,WCBUF[1],ABH[1],TNAME);
  274.  
  275. WCB$WORD[1] = 5;
  276. WCB$SMID[1] = SMID"TTEXT";
  277. ABHADR[1] = HDR$OPORD[0];
  278. FORMSTAT(NPUORD);
  279.  
  280. P<FLG$WORD> = LOC(NPU$RFLGS[NPUORD]);
  281. SSBSBW( FLG$WORD , HDR$OPORD[0] );
  282. END
  283. ELSE
  284. BEGIN
  285. CTR$TNAM[0] = OC$TNAM[NPU$CNOP[NPUORD]];
  286. WCB$WORD[1] = 5;
  287. WCB$SMID[1] = SMID"TTEXT";
  288. ABHADR[1] = HDR$OPORD[0];
  289. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],CTRLNOP);
  290. END
  291. END
  292.  
  293. #
  294. * IF REQUEST IS TO RELEASE CONTROL, THEN CHECK IF THIS NOP
  295. * CONTROLS THE NPU. IF SO, THEN CLEAR THE CONTROLLING NOP IN
  296. * THEN NPUCB AND SEND THE EVENT TO THE EVENT QUEUE, OTHERWISE
  297. * SEND AN ERROR MESSAGE. IF THIS OPERATOR HAS AUTO CONTROL
  298. * STATUS, THEN RELEASE THAT STATUS.
  299. #
  300. ELSE
  301. BEGIN
  302. IF HDR$OPORD[0] EQ NPU$CNOP[NPUORD]
  303. THEN
  304. BEGIN
  305. NPU$CNOP[NPUORD] = 0;
  306. WCB$WORD[1] = 3;
  307. WCB$SMID[1] = SMID"CTRLOFF";
  308. ABHSN[1] = NPUORD;
  309. TNAME = OC$TNAM[HDR$OPORD[0]];
  310. SSTAQE(P<EVQ>,WCBUF[1],ABH[1],TNAME);
  311. IF HDR$OPORD[0] EQ CSACNOP
  312. THEN
  313. BEGIN
  314. CSACNOP = 0;
  315. END
  316.  
  317. P<FLG$WORD> = LOC(NPU$RFLGS[NPUORD]);
  318. SSBCBW( FLG$WORD , HDR$OPORD[0] );
  319.  
  320. IF CSACNOP NQ 0
  321. THEN
  322. BEGIN
  323. NPU$CNOP[NPUORD] = CSACNOP;
  324. SSBSBW(FLG$WORD,CSACNOP);
  325.  
  326. WCB$SMID[1] = SMID"CTRLON";
  327. TNAME = OC$TNAM[CSACNOP];
  328.  
  329. SSTAQE(P<EVQ>, WCBUF[1], ABH[1], TNAME);
  330. END
  331. END
  332. ELSE
  333. BEGIN
  334. WCB$WORD[1] = 6;
  335. WCB$SMID[1] = SMID"TTEXT";
  336. ABHADR[1] = HDR$OPORD[0];
  337. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],NOCTRL);
  338. END
  339. END
  340. END
  341.  
  342. #
  343. * -NPUS- OR -AUTO- WAS SPECIFIED. IF CONTROL IS REQUESTED, THEN
  344. * FOR EACH NPU THAT IS SUPERVISED AND NOT CONTROL, ASSIGN THIS
  345. * OPERATOR TO BE THE CONTROLLING NOP AND SEND EVENT INDICATING
  346. * CONTROL IS ASSIGNED.
  347. #
  348. ELSE
  349. BEGIN
  350. IF ONFLAG
  351. THEN
  352. BEGIN
  353. CTRLCNT = 0;
  354. WCB$WORD[1] = 3;
  355. WCB$SMID[1] = SMID"CTRLON";
  356. FOR I=0 STEP 1 WHILE I LS CSNPCNT
  357. DO
  358. BEGIN
  359. IF NPU$STAT[I] EQ SUPSTAT"SUP" AND
  360. NPU$CNOP[I] EQ 0
  361. THEN
  362. BEGIN
  363. CTRLCNT = CTRLCNT + 1;
  364. NPU$CNOP[I] = HDR$OPORD[0];
  365. ABHSN[1] = I;
  366. TNAME = OC$TNAM[HDR$OPORD[0]];
  367. SSTAQE(P<EVQ>,WCBUF[1],ABH[1],TNAME);
  368.  
  369. P<FLG$WORD> = LOC(NPU$RFLGS[I]);
  370. SSBSBW( FLG$WORD[0] , HDR$OPORD[0] );
  371. END
  372. END
  373.  
  374. #
  375. * IF ALL NPU-S ARE BEING CONTROLLED, THEN SEND MESSAGE INDICATING
  376. * SO, OTHERWISE LIST THE NPU-S UNDER THE OPERATOR-S CONTROL.
  377. #
  378. IF CTRLCNT EQ 0
  379. THEN
  380. BEGIN
  381. WCB$WORD[1] = 6;
  382. WCB$SMID[1] = SMID"TTEXT";
  383. ABHADR[1] = HDR$OPORD[0];
  384. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],ALLCTRL);
  385. END
  386.  
  387. ELSE
  388. BEGIN
  389. WCB$WORD[1] = 5;
  390. WCB$SMID[1] = SMID"TTEXT";
  391. ABHADR[1] = HDR$OPORD[0];
  392.  
  393. FOR I = 0 STEP 1 WHILE I LS CSNPCNT
  394. DO
  395. BEGIN
  396. IF NPU$STAT[I] NQ SUPSTAT"SUPLOST" AND
  397. NPU$CNOP[I] EQ HDR$OPORD[0]
  398. THEN
  399. BEGIN
  400. FORMSTAT(I);
  401. END
  402. END
  403. END
  404.  
  405. #
  406. * IF -AUTO- WAS SPECIFIED, THEN CHECK IF AN OPERATOR ALREADY HAS
  407. * AUTO CONTROL STATUS. IF SO, THEN SEND A MESSAGE INDICATING THAT
  408. * SOMEONE ELSE ALREADY HAS AUTO CONTROL, OTHERWISE SEND A MESSAGE
  409. * INDICATING THAT THE OPERATOR NOW HAS AUTO CONTROL STATUS.
  410. #
  411. IF PAR$PCODE[NPIDX] EQ "AU0"
  412. THEN
  413. BEGIN
  414. WCB$WORD[1] = 0;
  415. WCB$SMID[1] = SMID"TTEXT";
  416. ABHADR[1] = HDR$OPORD[0];
  417.  
  418. IF CSACNOP EQ 0
  419. THEN
  420. BEGIN
  421. CSACNOP = HDR$OPORD[0];
  422. WCB$WC[1] = 6;
  423. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],AUCTRL);
  424. END
  425.  
  426. ELSE
  427. BEGIN
  428. WCB$WC[1] = 5;
  429. NAC$TNAM[0] = OC$TNAM[CSACNOP];
  430. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],NOACTRL);
  431. END
  432. END
  433. END
  434.  
  435. #
  436. * -NPUS- OR -AUTO- WAS SPECIFIED AND CONTROL IS TO BE RELEASED.
  437. * IF -NPUS- WAS SPECIFIED, THEN CLEAR ALL THE CONTROLLING NOP
  438. * FIELDS IN THE NPUCB-S THAT MATCH THIS OPERATOR-S ORDINAL.
  439. #
  440. ELSE
  441. BEGIN
  442. IF PAR$PCODE[NPIDX] EQ "NPS"
  443. THEN
  444. BEGIN
  445. WCB$WORD[1] = 3;
  446. FOR I=0 STEP 1 WHILE I LS CSNPCNT
  447. DO
  448. BEGIN
  449. IF NPU$STAT[I] NQ SUPSTAT"SUPLOST" AND
  450. NPU$CNOP[I] EQ HDR$OPORD[0]
  451. THEN
  452. BEGIN
  453. NPU$CNOP[I] = 0;
  454. WCB$SMID[1] = SMID"CTRLOFF";
  455. ABHSN[1] = I;
  456. TNAME = OC$TNAM[HDR$OPORD[0]];
  457. SSTAQE(P<EVQ>,WCBUF[1],ABH[1],TNAME);
  458.  
  459. P<FLG$WORD> = LOC(NPU$RFLGS[I]);
  460. SSBCBW( FLG$WORD, HDR$OPORD[0] );
  461.  
  462. IF CSACNOP NQ 0
  463. THEN
  464. BEGIN
  465. NPU$CNOP[I] = CSACNOP;
  466. SSBSBW(FLG$WORD,CSACNOP);
  467.  
  468. WCB$SMID[1] = SMID"CTRLON";
  469. TNAME = OC$TNAM[CSACNOP];
  470.  
  471. SSTAQE(P<EVQ>, WCBUF[1], ABH[1], TNAME);
  472. END
  473. END
  474. END
  475. END
  476.  
  477. #
  478. * FOR -NPUS- OR -AUTO-, IF THIS OPERATOR IS A CONTROLLING NOP, THEN
  479. * CLEAR THE AUTO CONTROL STATUS FOR THIS OPERATOR.
  480. #
  481. IF CSACNOP EQ HDR$OPORD[0]
  482. THEN
  483. BEGIN
  484. CSACNOP = 0;
  485. END
  486. END
  487. END
  488.  
  489. ENDEXIT:
  490. #
  491. * SEND EMPTY TEXT WITH INPUT ALLOWED FLAG SET TO TERMINATE THE
  492. * COMMAND.
  493. #
  494. WCB$WORD[1] = 2;
  495. WCB$SMID[1] = SMID"TTEXT";
  496. WCB$IAF[1] = TRUE;
  497. ABHWORD[1] = 0;
  498. ABHADR[1] = HDR$OPORD[0];
  499. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],MSGBUF);
  500.  
  501. END #CSSACO#
  502.  
  503. TERM
cdc/nos2.source/nam5871/cssaco.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator