User Tools

Site Tools


cdc:nos2.source:nam5871:cssaen

CSSAEN

Table Of Contents

  • [00008] PROC CSSAEN
  • [00009] CSSAEN - ACTION ENABLE COMMAND
  • [00014] ACTION ENABLE COMMAND.
  • [00047] PROC SSBEBF
  • [00048] PROC SSBSBF
  • [00049] FUNC SSDCDA
  • [00050] PROC MOVE
  • [00051] PROC SSTAQE

Source Code

CSSAEN.txt
  1. *DECK CSSAEN
  2. USETEXT TEXTCS;
  3. USETEXT TEXTSS;
  4. USETEXT TXTSMCS;
  5. USETEXT TXTAPSS;
  6. USETEXT TXTSUSS;
  7. USETEXT TXCMDCS;
  8. PROC CSSAEN;
  9. # TITLE CSSAEN - ACTION ENABLE COMMAND #
  10.  
  11. BEGIN # CSSAEN #
  12.  
  13. #
  14. ** CSSAEN - ACTION ENABLE COMMAND.
  15. *
  16. * C. BRION 82/05/18.
  17. *
  18. * THIS PROCEDURE PROCESSES THE RESOLVED ENABLE COMMAND AND SENDS
  19. * THE APPROPRIATE SUPERVISORY MESSAGE TO AN NPU OR NPUS AND THE
  20. * COMMAND TEXT IS LOGGED VIA A SUPERVISION EVENT.
  21. *
  22. * PROC CSSAEN
  23. *
  24. * ENTRY:
  25. * HDRCMD = ONE WORD ARRAY THAT COMPRISES THE COMMAND HEADER WORD.
  26. *
  27. * PARMS = ARRAY THAT CONTAINS THE COMMAND TEXT STRING, THE SYNTAX
  28. * PARAMETER LIST AND THE ADDRESS PARAMETER LIST.
  29. *
  30. * EXIT:
  31. * AN ENABLE SUPERVISORY MESSAGE WILL HAVE BEEN SENT TO THE APPRO-
  32. * PRIATE NPU(S).
  33. *
  34. * A SUPERVISION EVENT IS SENT IN ORDER TO LOG THE COMMAND.
  35. *
  36. * A NULL TERMINAL TEXT IS SENT TO THE ORIGIN OPERATOR IN ORDER TO
  37. * CAUSE THE READY.. MESSAGE.
  38. *
  39. #
  40.  
  41. #
  42. **** PROC CSSAEN XREF LIST.
  43. #
  44.  
  45. XREF
  46. BEGIN
  47. PROC SSBEBF; # SS-EXTRACT BIT FLD #
  48. PROC SSBSBF; # SS-STORE BIT FLD #
  49. FUNC SSDCDA; # CONVERT DCD TO ASCII #
  50. PROC MOVE; # MACREL MOVE CHARACTERS #
  51. PROC SSTAQE; # SS-ACCEPT QUEUE ENTRY #
  52. END
  53. #
  54. ****
  55. #
  56.  
  57. #
  58.  
  59.  
  60. #
  61. DEF NPINDX # HDR$TXWCNT[0] + 3 # ; # INDEX FOR NPU #
  62.  
  63. #
  64. * ENABLST - LIST OF ENABLE ELEMENTS.
  65. #
  66.  
  67. STATUS ENABLST
  68. TERM,
  69. TERMS,
  70. LINE,
  71. LINES,
  72. TRUNK,
  73. TRUNKS,
  74. LLINK,
  75. LLINKS,
  76. SVC;
  77.  
  78. #
  79. * ITEMS
  80. #
  81.  
  82. ITEM ELINDX U; # ELEMENT INDEX #
  83. ITEM MOVECNT U; # WORD COUNT FOR MOVE #
  84. ITEM ELMID S:ENABLST; # ELEMENT ID #
  85. ITEM FINAPIX U;
  86. ITEM BEGAPIX U;
  87. ITEM I,Y U;
  88. ITEM NPUORD U;
  89. ITEM DORD,DBIT U;
  90. ITEM AORD,ABIT U;
  91. ITEM SINGCHAR U;
  92.  
  93.  
  94. #
  95. * BLDENSM - BUILD ENABLE SM SWITCH.
  96. #
  97.  
  98. SWITCH BLDENSM:ENABLST
  99. BLDTERM:TERM,
  100. BLDTERMS:TERMS,
  101. BLDLINE:LINE,
  102. BLDLINES:LINES,
  103. BLDTRUNK:TRUNK,
  104. BLDTRUNKS:TRUNKS,
  105. BLDLLINK:LLINK,
  106. BLDLLINKS:LLINKS,
  107. BLDSVC:SVC;
  108.  
  109. ARRAY IGNOREMSG S(7) ;
  110. BEGIN
  111. ITEM IGMSGW U(00,00,60) ;
  112. ITEM IGMSG1 C(00,00,26) =[" COMMAND IGNORED- VERSION "] ;
  113. ITEM IGMSG2 U(02,36,24) ;
  114. ITEM IGMSG3 C(03,00,30) =
  115. [" CCP UNABLE TO ACTION COMMAND "] ;
  116. ITEM IGMSG4 U(06,00,60) =[0] ;
  117. END
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. #
  125. * INITIALIZE LOCAL VARIABLES AND THE OUTGOING SM HEADER AND BODY
  126. * STORAGE AREAS.
  127. #
  128.  
  129. ABHWORD[1] = 0;
  130. WCB$WORD[1] = 0;
  131. SPMSG0[1] = 0;
  132.  
  133. PFC[1] = ENB; # SET ENABLE SM PFC #
  134. ELINDX = HDR$TXWCNT[0] + 1; # SET PARAMETER INDEX FOR #
  135. # ELEMENT TO NOP KEYWORD #
  136.  
  137. #
  138. * IF THE NOP KEYWORD IS PRESENT IN THE SYNTAX PARAMETER LIST, THEN
  139. * THE ELEMENT INDEX MUST BE MOVED.
  140. #
  141.  
  142. IF PAR$PCODE[ELINDX] EQ "NOP"
  143. THEN
  144. ELINDX = ELINDX + 1;
  145.  
  146. #
  147. * ELINDX IS SET TO POINT TO THE COMMAND ELEMENT THAT IS TO BE
  148. * ENABLED. EITHER ONE OF A TERMINAL, TERMINALS ON A LINE, TERMINALS
  149. * ON A NPU, LINE, LINE ON A NPUS, TRUNK, TRUNKS ON A NPU, A
  150. * LOGICAL LINK, OR A ARCHETYPE SVC MAY BE THE ELEMENT TYPE TO
  151. * BE ENABLED.
  152. *
  153. * SET THE LOCAL ELEMENT IDENTIFIER BASED ON THE VALUE OF THE ELE-
  154. * MENT KEYWORD.
  155. *
  156. * NOTE THAT ONLY THE SECOND CHARACTER OF THE KEYWORD IS UNIQUE AND
  157. * IS CHECKED FOR THE "SINGLE" TYPE OF ELEMENT.
  158. *
  159. #
  160.  
  161. IF PAR$PCHR2[ELINDX] EQ "E" # TERMINAL (S) #
  162. THEN
  163. ELMID = ENABLST"TERM";
  164.  
  165. ELSE IF PAR$PCHR2[ELINDX] EQ "I" # LINE (S) #
  166. THEN
  167. ELMID = ENABLST"LINE";
  168.  
  169. ELSE IF PAR$PCHR2[ELINDX] EQ "R" # TRUNK (S) #
  170. THEN
  171. ELMID = ENABLST"TRUNK";
  172.  
  173. ELSE IF PAR$PCHR2[ELINDX] EQ "C" # ARCHETYPE SVC #
  174. THEN
  175. ELMID = ENABLST"SVC";
  176.  
  177.  
  178. ELSE # MUST BE LOGICAL LINK (S) #
  179. ELMID = ENABLST"LLINK";
  180.  
  181. #
  182. * NOW, CHECK TO SEE IF THE ENABLE COMMAND IS FOR A GROUP OF ELEMENT
  183. * TYPE TERMINALS, LINES, OR TRUNKS BY CHECKING THE THIRD CHARACTER
  184. * OF THE KEYWORD.
  185. *
  186. * IF MULTIPLE IS INDICATED, SIMPLY BUMP THE ELMID VALUE TO SET THE
  187. * APPROPRIATE INTERNAL IDENTIFIER.
  188. #
  189.  
  190. IF PAR$PCHR3[ELINDX] EQ "S"
  191. THEN
  192. ELMID = ELMID + 1;
  193.  
  194. #
  195. * SET THE BEGINNING AND ENDING ADDRESS PARAMETER LIST INDEX VALUES
  196. * SO AS TO INDICATE THE LOCATION OF THE ADDRESS PARAMETERS IN THE
  197. * PARMS ARRAY.
  198. #
  199.  
  200. BEGAPIX = HDR$TXWCNT[0] + HDR$SPCNT[0];
  201. IF HDR$APCNT[0] EQ 0
  202. THEN
  203. BEGIN
  204. FINAPIX = BEGAPIX;
  205. END
  206. ELSE
  207. BEGIN
  208. FINAPIX = HDR$TXWCNT[0] + HDR$SPCNT[0] + HDR$APCNT[0] - 1;
  209. END
  210.  
  211. #
  212. * SEARCH THE ADDRESS PARAMETER LIST FOR EACH OCCURRENCE OF THE NPU
  213. * ORDINAL KEYWORD "NOR". AFTER EACH NPU ORDINAL KEYWORD, THE
  214. * APPROPRIATE ELEMENT ADDRESS PARAMETER VALUE WILL BE FOUND.
  215. *
  216. * SET UP THE COMMON OUTGOING SM FIELDS AND BRANCH TO THE PROPER
  217. * CASE TO BUILD THE ENABLE SM BASED ON THE PREVIOUSLY DETERMINED
  218. * INTERNAL ELEMENT IDENTIFIER.
  219. #
  220.  
  221. FOR I = BEGAPIX STEP 1 UNTIL FINAPIX
  222. DO
  223.  
  224. BEGIN
  225. IF PAR$PCODE[I] EQ "NOR" OR
  226. PAR$PCODE[NPINDX] EQ "NPS"
  227. THEN
  228.  
  229. BEGIN
  230. GOTO BLDENSM[ELMID];
  231.  
  232. BLDTERM: # BUILD ENABLE TERMINAL SM #
  233.  
  234. #
  235. * CONVERT THE TERMINAL NAME (DISPLAY CODE) PARAMETER VALUE TO THE
  236. * ASCII FORMAT FOR INSERTION INTO THE SM TO THE NPU.
  237. #
  238.  
  239. DORD = ELINDX;
  240. DBIT = 0;
  241. AORD = 1;
  242. ABIT = 4;
  243.  
  244. FOR Y = 1 STEP 1 UNTIL 7
  245. DO
  246.  
  247. BEGIN
  248. SSBEBF(PARMS[0],DORD,DBIT,6,SINGCHAR); # EXTRACT 6 BITS #
  249. SINGCHAR = SSDCDA(SINGCHAR);
  250. SSBSBF(CSSM[1],AORD,ABIT,8,SINGCHAR); # STORE 8 BITS #
  251. END
  252.  
  253. ENBP[1] = PAR$ELADDR[I+1]; # SET LINE NUMBER IN SM #
  254. SFC[1] = TE;
  255. ABHTLC[1] = NENBTE;
  256. WCB$SMID[1] = SMID"ENBTE";
  257. WCB$WC[1] = LENBTE + 2;
  258. GOTO SENDSM;
  259.  
  260.  
  261.  
  262.  
  263.  
  264. BLDTERMS: # ENABLE TERMINALS SM #
  265.  
  266. #
  267. * TERMINALS ON A LINE OR ON A NPU MAY BE REQUESTED. IF ON A LINE,
  268. * THEN THE PORT NUMBER OF THE LINE MUST BE SET IN THE SM. OTHER-
  269. * WISE, THE PORT NUMBER MUST BE ZERO.
  270. #
  271.  
  272. IF PAR$PCODE[ELINDX+1] EQ "LI0"
  273. THEN
  274. ENBP[1] = PAR$ELADDR[I+1];
  275.  
  276. SFC[1] = TE;
  277. ABHTLC[1] = NENBTE;
  278. WCB$SMID[1] = SMID"ENBTE";
  279. WCB$WC[1] = LENBTE + 2;
  280. GOTO SENDSM;
  281.  
  282.  
  283.  
  284.  
  285. BLDLINE: # ENABLE LINE OR LINES #
  286. BLDLINES:
  287.  
  288. #
  289. * IF SINGLE LINE TO BE ENABLED THEN THE PORT NUMBER OF THE LINE
  290. * MUST BE SET IN THE SM. OTHERWISE, THE PORT NUMBER IS ZERO WHICH
  291. * MEANS THAT ALL LINES ON THE NPU ARE TO BE ENABLED.
  292. #
  293.  
  294. SFC[1] = LI;
  295.  
  296. IF PAR$PCHR3[ELINDX] NQ "S"
  297. THEN
  298. ENBP[1] = PAR$ELADDR[I+1];
  299.  
  300. ABHTLC[1] = NENBLI;
  301. WCB$SMID[1] = SMID"ENBLI";
  302. WCB$WC[1] = LENBLI + 2;
  303. GOTO SENDSM;
  304.  
  305.  
  306.  
  307.  
  308. BLDTRUNK: # ENABLE TRUNK OR TRUNKS #
  309. BLDTRUNKS:
  310.  
  311. #
  312. * IF ONLY A SINGLE TRUNK IS TO BE ENABLED, THEN THE PORT OF THE
  313. * TRUNK ON THE NPU MUST BE SET IN THE SM.
  314. #
  315.  
  316. SFC[1] = TR;
  317.  
  318. IF PAR$PCHR3[ELINDX] NQ "S"
  319. THEN
  320. ENBP[1] = PAR$ELADDR[I+1];
  321. IF PAR$PCODE[ELINDX+1] EQ "LD0"
  322. THEN
  323. BEGIN # LD PARAM SPECIFIED #
  324. IF V24FLAG
  325. THEN
  326. # RUNNING WITH 2.4 CCP #
  327. ENBLDF[1] = TRUE ; # SET LAOD FLAG #
  328. ELSE
  329. BEGIN # NOT RUNNING WITH 2.4 CCP #
  330. ABHWORD[1] = 0 ;
  331. ABHADR[1] = AUDGR4$ ;
  332. ABHTLC[1] = 6 ;
  333.  
  334. IGMSG2[0] = CCPVERS ; # STORE VERSION TO MSG #
  335. WCB$WC[1] = 8 ;
  336.  
  337. SSTAQE(P<ORQ>,WCBUF[1],ABH[1],IGMSGW[0]) ;
  338. RETURN ;
  339. END
  340. END # LD PARAM IS SPECIFIED #
  341.  
  342. ABHTLC[1] = NENBTR;
  343. WCB$SMID[1] = SMID"ENBTR";
  344. WCB$WC[1] = LENBTR + 2;
  345. GOTO SENDSM;
  346.  
  347.  
  348.  
  349.  
  350.  
  351. BLDLLINK: # ENABLE LLINK OR LLINKS #
  352. BLDLLINKS:
  353.  
  354. #
  355. * IF A SINGLE LOGICAL LINK IS TO BE ENABLED, THEN THE NODE NUMBERS
  356. * OF THE LOGICAL LINK MUST BE SET IN THE SM FOR THE NPU.
  357. #
  358.  
  359. SFC[1] = LL;
  360.  
  361. IF PAR$PCHR3[ELINDX] NQ "S"
  362. THEN
  363. BEGIN
  364. ENBN1[1] = PAR$LLNID1[I+1];
  365. ENBN2[1] = PAR$LLNID2[I+1];
  366. END
  367.  
  368. ABHTLC[1] = NENBLL;
  369. WCB$SMID[1] = SMID"ENBLL";
  370. WCB$WC[1] = LENBLL + 2;
  371. GOTO SENDSM;
  372.  
  373.  
  374.  
  375.  
  376. BLDSVC: # ENABLE ARCHETYPE SVC #
  377.  
  378. #
  379.   CONVERT THE DISPLAY CODE ARCHETYPE NAME TO ASCII
  380. #
  381. DORD = ELINDX; # BITFIELD START POSITION #
  382. DBIT = 0;
  383. AORD = 1;
  384. ABIT = 4;
  385. FOR Y = 1 STEP 1 UNTIL 5
  386. DO
  387.  
  388. BEGIN
  389. SSBEBF(PARMS[0],DORD,DBIT,6,SINGCHAR); # EXTRACT BITFIELD #
  390. SINGCHAR = SSDCDA(SINGCHAR);
  391. SSBSBF(CSSM[1],AORD,ABIT,8,SINGCHAR); # STORE BITFIELD #
  392. END
  393.  
  394. ENBP[1] = PAR$ELADDR[I+1]; # SET PORT NUMBER IN SM #
  395. FOR Y = ELINDX STEP 1 UNTIL BEGAPIX
  396. DO
  397. BEGIN
  398. IF PAR$PCODE[Y] EQ "NC0" # FOUND NCIR PARAMETER CODE #
  399. THEN
  400. ENBNC[1] = PAR$NCIR[Y]; # SET NO. OF SVCS TO ENABLE #
  401. END
  402. ENBBL[1] = X"2020"; # INSERT TWO BLANKS #
  403. SFC[1] = VC;
  404. ABHTLC[1] = NENBVC; # LENGTH IN CHAR #
  405. WCB$SMID[1] = SMID"ENBVC";
  406. WCB$WC[1] = LENBVC + 2;
  407. GOTO SENDSM;
  408.  
  409.  
  410.  
  411.  
  412.  
  413. SENDSM:
  414.  
  415. #
  416. * SET UP THE ABH WORD. IF -NPUS- WAS SPECIFIED, THEN FOR EACH
  417. * NPU THAT IS SUPERVISED, SEND THE ENABLE REQUEST. IF -NPUS-
  418. * WAS NOT SPECIFIED, THEN SEND THE MESSAGE TO THE NPU.
  419. #
  420. ABHABT[1] = APPSUP;
  421. ABHBT[1] = APPSUP;
  422. ABHACT[1] = ACTCSNP$;
  423.  
  424. IF PAR$PCODE[NPINDX] EQ "NPS"
  425. THEN
  426. BEGIN
  427. FOR Y=0 STEP 1 WHILE Y LS CSNPCNT
  428. DO
  429. BEGIN
  430. IF NPU$STAT[Y] EQ SUPSTAT"SUP"
  431. THEN
  432. BEGIN
  433.  
  434. IF HDR$OPORD[0] EQ HOPORD$ OR
  435. HDR$OPORD[0] EQ NPU$CNOP[I]
  436. THEN
  437. BEGIN
  438. ABHDN[1] = NPU$NID[Y];
  439. ABHSN[1] = NPU$HID[Y];
  440.  
  441. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],CSSM[1]);
  442. END
  443. END
  444. END
  445. END
  446.  
  447. ELSE
  448. BEGIN
  449. NPUORD = PAR$ORD[I];
  450. ABHDN[1] = NPU$NID[NPUORD];
  451. ABHSN[1] = NPU$HID[NPUORD];
  452.  
  453. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],CSSM[1]);
  454. END
  455.  
  456. END # IF PAR$PCODE EQ NOR #
  457.  
  458. END # FOR I LOOP #
  459.  
  460. #
  461. * THE COMMAND MUST BE LOGGED BY MOVING THE COMMAND TEXT AND OPER-
  462. * ATOR TERMINAL NAME INTO THE CMDTEXT MESSAGE ARRAY AND QUEUING
  463. * IT TO THE EVENT QUEUE AS A CMDTXT ENTRY.
  464. #
  465.  
  466. WCB$WORD[1] = 0;
  467. WCB$SMID[1] = SMID"CMDTXT";
  468. ABHWORD[1] = 0;
  469.  
  470. CMD$TNAM[0] = OC$TNAM[HDR$OPORD[0]];
  471. #
  472. * MOVE THE COMMAND TEXT.
  473. #
  474.  
  475. P<MSCMD> = LOC(CMD$TEXT[0]); # SET UP FOR TEXT MOVE #
  476. MOVECNT = HDR$TXWCNT[0];
  477. MOVE(MOVECNT,PARMS[0],MSCMD[0]);
  478.  
  479. WCB$WC[1] = HDR$TXWCNT[0] + 4;
  480. ABHTLC[1] = (HDR$TXWCNT[0] + 2) * 10;
  481. SSTAQE(P<EVQ>,WCBUF[1],ABH[1],CMDLINE[0]);
  482.  
  483. #
  484. * THE NULL TERMINAL TEXT TO ALLOW THE READY.. MESSAGE TO BE SENT
  485. * NEEDS TO BE GENERATED.
  486. #
  487.  
  488. ABHWORD[1] = 0;
  489. WCB$WORD[0] = 0;
  490. WCB$WC[1] = 2;
  491. WCB$SMID[1] = SMID"TTEXT";
  492. ABHADR[1] = HDR$OPORD[0];
  493. ABHTLC[1] = 0;
  494. WCB$IAF[1] = TRUE;
  495. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],CSSM[1]);
  496.  
  497. END # CSSAEN #
  498.  
  499. TERM
cdc/nos2.source/nam5871/cssaen.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator