User Tools

Site Tools


cdc:nos2.source:nam5871:cseses

CSESES

Table Of Contents

  • [00007] PROC CSESES
  • [00008] SEND ELEMENT STATISTICS.
  • [00011] SEND ELEMENT STATISTICS.
  • [00057] PROC MESSAGE
  • [00058] PROC SSBEBF
  • [00059] PROC SSBSBF
  • [00060] PROC SSTAQE
  • [00061] FUNC SSDCDA U
  • [00062] FUNC XCDD U
  • [00063] FUNC XCHD U
  • [00361] PROC CONVERT
  • [00362] CONVERT - CONVERTS DISPLAY CODE TEXT TO ASCII.
  • [00366] CONVERT - CONVERTS DISPLAY CODE TEXT TO ASCII.

Source Code

CSESES.txt
  1. *DECK CSESES
  2. USETEXT TEXTOV
  3. USETEXT TEXTCS
  4. USETEXT TEXTSS
  5. USETEXT TXTAPSS
  6. USETEXT TXTSMCS
  7. PROC CSESES;
  8. # TITLE - SEND ELEMENT STATISTICS. #
  9. BEGIN
  10. #
  11. ** CSESES - SEND ELEMENT STATISTICS.
  12. *
  13. * D.K. ENDO 82/03/30
  14. *
  15. * THIS PROCEDURE FORMATS STATISTICS INFORMATION FROM THE INCOMING
  16. * SM. IT THEN SENDS IT OUT TO THE SYSTEM ACCOUNT FILES.
  17. * FOR STI/NP/U, CHECK FOR CPU AND BUFFER THRESHOLD.
  18. * IF EXCEEDED, SEND ALM/OP SM.
  19. *
  20. * PROC CSESES
  21. *
  22. * ENTRY 1. STI/NP/U, STI/TR/U, OR STI/LI/U SM FROM THE EVENT
  23. * QUEUE.
  24. *
  25. * EXIT 1. STATISTICS INFO SENT TO THE SYSTEM ACCOUNT FILES.
  26. * 2. ALM/OP SM SENT TO * EVQ* .
  27. *
  28. *
  29. * ACCOUNT DAYFILE MESSAGE FORMATS:
  30. *
  31. * *SCLI, NODE, C1, PORT, TTTTTTLLLLLL.
  32. * *SCLI, NODE, C2, SSSSSSCCCCCC.
  33. * *SCLI, NODE, C3, BBBBBBPPPPPPAAAAAA.
  34. * NUMBER OF BLOCKS AND CHARACTERS TRANSMITTED AND
  35. * RECEIVED ON NODE NUMBER *NODE* AND LINE NUMBER
  36. * *PORT*. ALSO NUMBER OF PAD AND A-A REJECTS.
  37. *
  38. * *SCNQ, NODE, C1, CCCCCCDDDDDDLLLLLL.
  39. * *SCNQ, NODE, C2, GGGGGGRRRRRRSSSSSS.
  40. * *SCNQ, NODE, C3, PPPPPPIIIIIINNNNNN.
  41. * *SCNQ, NODE, C4, WWWWWW.
  42. * VARIOUS STATISTICS FOR NODE NUMBER *NODE*.
  43. *
  44. * *SCTU, NODE, C1, PORT, TTTTTTLLLLLL.
  45. * *SCTU, NODE, C2, SSSSSSCCCCCC.
  46. * *SCTU, NODE, C3, BBBBBB.
  47. * NUMBER OF BLOCKS AND CHARACTERS TRANSMITTED AND
  48. * RECEIVED ON NODE NUMBER *NODE* AND PORT NUMBER
  49. * *PORT*.
  50. *
  51. #
  52. #
  53. **** PROC CSESES - XREF LIST BEGINS.
  54. #
  55. XREF
  56. BEGIN
  57. PROC MESSAGE; # SEND TEXT TO SYSTEM ACCOUNT FILE #
  58. PROC SSBEBF; # EXTRACT BIT FIELD #
  59. PROC SSBSBF; # STORE BIT FIELD #
  60. PROC SSTAQE; # ACCEPT A QUEUE ENTRY #
  61. FUNC SSDCDA U; # CONVERT DISPLAY CODE TO ASCII #
  62. FUNC XCDD U; # CONVERT DECIMAL INTEGER TO DISPLAY CODE #
  63. FUNC XCHD U; # CONVERT HEX INTEGER TO DISPLAY CODE #
  64. END
  65. #
  66. ****
  67. #
  68. DEF ACCT # 5 #; # IDENTIFIER FOR ACCOUNT FILE #
  69. DEF ERRLOG # 4 #; # IDENTIFIER FOR ERROR LOG FILE #
  70. ITEM CNST1; # CONSTANT ---> 1 #
  71. ITEM CNST2; # CONSTANT ---> 2 #
  72. ITEM CNST3; # CONSTANT ---> 3 #
  73. ITEM I; # LOOP INDUCTION VARIABLE #
  74. ITEM ITEMP U; # UNSIGNED INTEGER TEMPORARY #
  75. ITEM LEN U; # LENGTH OF TEXT #
  76. ITEM NP U; # NPUCB INDEX #
  77. #
  78.   THIS ARRAY DEFINES THE STATISTICS TEXT FORMAT THAT IS SENT WHEN
  79.   THIS PROC IS INVOKED.
  80. #
  81. ARRAY ELS$TXT [00:00] S(4);
  82. BEGIN
  83. ITEM ELS$SC C(00,00,02) = ["SC"];
  84. ITEM ELS$TYP C(00,12,02);
  85. ITEM ELS$C1 C(00,24,02) = [", "];
  86. ITEM ELS$SN U(00,36,24);
  87. ITEM ELS$C2 C(01,00,03) = [", C"];
  88. ITEM ELS$CNUM C(01,18,01);
  89. ITEM ELS$C3 C(01,24,02) = [", "];
  90. ITEM ELS$PRM1 C(01,36,06);
  91. ITEM ELS$P U(01,36,24);
  92. ITEM ELS$C4 C(02,00,02);
  93. ITEM ELS$PRM2 U(02,12,36);
  94. ITEM ELS$P1 C(02,48,01);
  95. ITEM ELS$ZBYT11 U(02,54,06);
  96. ITEM ELS$ZBYT12 U(03,00,12);
  97. ITEM ELS$PRM3 C(02,48,06);
  98. ITEM ELS$PER C(03,24,01) = ["."];
  99. ITEM ELS$ZBYT U(03,30,30) = [ 0 ];
  100. END
  101. #
  102.   THIS ARRAY DEFINES THE SECOND BUFFER WHICH ONLY CONTAINS ONE
  103.   PARAMETER.
  104. #
  105. ARRAY ES1$TXT [00:00] S(3);
  106. BEGIN
  107. ITEM ES1$SC C(00,00,02) = ["SC"];
  108. ITEM ES1$TYP C(00,12,02);
  109. ITEM ES1$C1 C(00,24,02) = [", "];
  110. ITEM ES1$SN U(00,36,24);
  111. ITEM ES1$C2 C(01,00,03) = [", C"];
  112. ITEM ES1$CNUM C(01,18,01);
  113. ITEM ES1$C3 C(01,24,02) = [", "];
  114. ITEM ES1$PRM1 C(01,36,06);
  115. ITEM ES1$PER C(02,12,01) = ["."];
  116. ITEM ES1$ZBYT U(02,18,42) = [0];
  117. END
  118.  
  119. #
  120. * THE FOLLOWING ARRAY DEFINES THE TEXT PORTION OF CPU UTILIZATION
  121. * ALARM MESSAGE.
  122. #
  123.  
  124. ARRAY CPUMSG [00:00] S(3);
  125. BEGIN
  126. ITEM CPU$MSG C(00,00,22) =
  127. ["CPU THRESHOLD EXCEEDED"];
  128. END
  129.  
  130. #
  131. * THE FOLLOWING ARRAY DEFINES THE BUFFER AVAILABILITY ALARM MESSAGE.
  132. #
  133.  
  134. ARRAY BUFMSG [00:00] S(3);
  135. BEGIN
  136. ITEM BUF$MSG C(00,00,25) =
  137. ["BUFFER THRESHOLD EXCEEDED"];
  138. END
  139.  
  140. #
  141. * THE FOLLOWING BASED ARRAY IS FOR GENERAL PURPOSE USAGE.
  142. #
  143.  
  144. BASED ARRAY GENPBUF[00:00] S(1);;
  145.  
  146.  
  147.  
  148.  
  149.  
  150. CONTROL EJECT;
  151. # #
  152. # CSESES CODE BEGINS HERE #
  153. # #
  154. #
  155. * CONVERT THE SOURCE NODE I.D. AND APPEND IT TO THE TEXT.
  156. #
  157. ELS$SN[0] = XCDD(ABHSN[0] );
  158. #
  159. * IF THIS SM IS STI/NP/U, THEN CONVERT THE MG, MP, AND MB VALUES TO
  160. * DISPLAY CODE AND APPEND THEM TO THE MESSAGE TEXT. SEND THE TEXT
  161. * TO THE ACCOUNT FILE. CONVERT THE BD, BF, AND L3 VALUES AND APPEND
  162. * THEM TO THE TEXT. SEND THE MESSAGE OUT TO THE ACCOUNT FILE.
  163. * CONVERT THE L2, L1, AND L0 VALUES AND APPEND THEM TO THE TEXT.
  164. * SEND THE MESSAGE OFF TO THE ACCOUNT FILE.
  165. #
  166. IF WCB$SMID[0] EQ SMID"STINP"
  167. THEN
  168. BEGIN
  169. ELS$TYP[0] = "NQ";
  170. ELS$CNUM[0] = "1";
  171. ITEMP = XCDD(STIMG[0]);
  172. CNST1 = 1;
  173. CNST2 = 36;
  174. CNST3 = 36;
  175. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP);
  176. ELS$PRM2[0] = XCDD(STIMP[0]);
  177. ITEMP = 0;
  178. B<44,12>ITEMP = STIMB1[0];
  179. B<56,4>ITEMP = STIMB2[0];
  180. ITEMP = XCDD(ITEMP);
  181. CNST1 = 2;
  182. CNST2 = 48;
  183. CNST3 = 36;
  184. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP);
  185. MESSAGE(ELS$TXT,ACCT);
  186. MESSAGE(ELS$TXT,ERRLOG);
  187. ELS$CNUM[0] = "2";
  188. ITEMP = XCDD(STIBD[0]);
  189. CNST1 = 1;
  190. CNST2 = 36;
  191. CNST3 = 36;
  192. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP);
  193. ELS$PRM2[0] = XCDD(STIBF[0]);
  194. ITEMP = XCDD(STIL3[0]);
  195. CNST1 = 2;
  196. CNST2 = 48;
  197. CNST3 = 36;
  198. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP);
  199. MESSAGE(ELS$TXT,ACCT);
  200. MESSAGE(ELS$TXT,ERRLOG);
  201. ELS$CNUM[0] = "3";
  202. ITEMP = 0;
  203. B<44,8>ITEMP = STIL21[0];
  204. B<52,8>ITEMP = STIL22[0];
  205. ITEMP = XCDD(ITEMP);
  206. CNST1 = 1;
  207. CNST2 = 36;
  208. CNST3 = 36;
  209. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP);
  210. ELS$PRM2[0] = XCDD(STIL1[0]);
  211. ITEMP = XCDD(STIL0[0]);
  212. CNST1 = 2;
  213. CNST2 = 48;
  214. CNST3 = 36;
  215. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP);
  216. MESSAGE(ELS$TXT,ACCT);
  217. MESSAGE(ELS$TXT,ERRLOG);
  218. ES1$TYP[0] = ELS$TYP[0];
  219. ES1$SN[0] = ELS$SN[0];
  220. ES1$CNUM[0] = "4";
  221. ITEMP = XCDD(STIAW[0]);
  222. CNST1 = 1;
  223. CNST2 = 36;
  224. CNST3 = 36;
  225. SSBSBF(ES1$TXT,CNST1,CNST2,CNST3,ITEMP);
  226. MESSAGE(ES1$TXT,ACCT);
  227. MESSAGE(ES1$TXT,ERRLOG);
  228. #
  229. * SEARCH THE *NPUCBS* FOR THE NPU. IF NOT FOUND, IGNORE THE SM.
  230. * IF FOUND, CHECK FOR CPU AND BUFFER THRESHOLD, AND
  231. * SEND THE APPROPRIATE ALARM MESSAGE(S) TO THE *EVQ* IF NECESSARY.
  232. #
  233.  
  234. FOR I = 0 STEP 1 WHILE (ABHSN[0] NQ NPU$NID[I])
  235. AND (I LS CSNPCNT)
  236. DO
  237. BEGIN
  238. END
  239.  
  240. NP = I;
  241. IF NP GQ CSNPCNT
  242. THEN
  243. BEGIN
  244. GOTO EXIT;
  245. END
  246.  
  247. IF NPU$CP[NP] NQ DEFCP$
  248. THEN
  249. BEGIN # CP NOT DEFAULT VALUE #
  250. IF STIMG[0] GR (NPU$CP[NP] * 10)
  251. THEN
  252. BEGIN # CP IN STI/NP GR CP VALUE #
  253. P<GENPBUF> = LOC(CPUMSG[0]); # SEND ALM/OP SM #
  254. LEN = 22;
  255. CONVERT;
  256. END
  257. END
  258. IF NPU$BU[NP] NQ DEFBU$
  259. THEN
  260. BEGIN # BU IN STI/NP GR BU VALUE #
  261. IF STIMP[0] LS NPU$BU[NP]
  262. THEN
  263. BEGIN # BU IN STI/NP GR BU VALUE #
  264. P<GENPBUF> = LOC(BUFMSG[0]); # SEND ALM/OP SM #
  265. LEN = 25;
  266. CONVERT;
  267. END
  268. END
  269. END
  270. #
  271. * IF THIS SM IS STI/TR/U OR STI/LI/U, THEN CONVERT THE PORT AND
  272. * APPEND IT TO THE TEXT. IF THIS SM IS STI/LI/U, SET THE SUB-PORT
  273. * VALUE TO ZERO, ELSE SEARCH THE PHYSICAL LINK XREF TABLE FOR THE
  274. * NODE AT THE OTHER END OF TRUNK, IF FOUND, SAVE THE NODE I.D., ELSE
  275. * SET IT TO ZERO. CONVERT THE SUB-PORT OR NODE I.D. AND APPEND IT
  276. * TO THE TEXT. CONVERT THE BT VALUE AND APPEND IT TO THE TEXT. SEND
  277. * THE MESSAGE TO THE ACCOUNT FILE. CONVERT THE BR, CT, AND CR VALUE
  278. * AND APPEND THEM TO THE TEXT. SEND THE MESSAGE TO THE ACCOUNT
  279. * FILE. CONVERT THE BB VALUE AND APPEND IT TO THE TEXT. SEND THE
  280. * TEXT TO THE ACCOUNT FILE.
  281. #
  282. ELSE
  283. BEGIN
  284. IF WCB$SMID[0] EQ SMID"STILI"
  285. THEN
  286. BEGIN
  287. ELS$TYP[0] = "LI";
  288. ITEMP = 0;
  289. END
  290. ELSE
  291. BEGIN
  292. ELS$TYP[0] = "TU";
  293. END
  294. ELS$CNUM[0] = "1";
  295. ELS$P[0] = XCHD(STIP[0]);
  296. ELS$C4[0] = ", ";
  297. ELS$PRM2[0] = XCDD(STIBT[0]);
  298. ITEMP = 0;
  299. B<44,12>ITEMP = STIBR1[0];
  300. B<56,4>ITEMP = STIBR2[0];
  301. ITEMP = XCDD(ITEMP);
  302. CNST1 = 2;
  303. CNST2 = 48;
  304. CNST3 = 36;
  305. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP);
  306. MESSAGE(ELS$TXT,ACCT);
  307. MESSAGE(ELS$TXT,ERRLOG);
  308. ELS$CNUM[0] = "2";
  309. ITEMP = XCDD(STICT[0]);
  310. CNST1 = 1;
  311. CNST2 = 36;
  312. CNST3 = 36;
  313. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP);
  314. ELS$PRM2[0] = XCDD(STICR[0]);
  315. ELS$P1[0] = ".";
  316. ELS$ZBYT11[0] = 0;
  317. ELS$ZBYT12[0] = 0;
  318. MESSAGE(ELS$TXT,ACCT);
  319. MESSAGE(ELS$TXT,ERRLOG);
  320. IF WCB$SMID[0] EQ SMID"STILI"
  321. THEN
  322. BEGIN # PROCESS SCLI C3 TEXT #
  323. ELS$CNUM[0] = "3";
  324. ITEMP = XCDD(STIBB[0]); # CONVERT NO. BAD BLKS TRANSMITTED#
  325. CNST1 = 1; # WORD ORDINAL OF BITFIELD #
  326. CNST2 = 36; # STARTING BIT POSITION #
  327. CNST3 = 36; # NO. OF BITS TO STORE #
  328. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP); # STORE BITFIELD #
  329. ITEMP = 0;
  330. B<44,8>ITEMP = STIRP1[0];
  331. B<52,8>ITEMP = STIRP2[0];
  332. ELS$PRM2[0] = XCDD(ITEMP); # CONVERT NO. PAD REJECTS #
  333. ITEMP = XCDD(STIRA[0]); # CONVERT NO. A-A REJECTS #
  334. CNST1 = 2; # WORD ORDINAL OF BITFIELD #
  335. CNST2 = 48; # STARTING BIT POSITION #
  336. CNST3 = 36; # NO. OF BITS TO STORE #
  337. SSBSBF(ELS$TXT,CNST1,CNST2,CNST3,ITEMP); # STORE BITFIELD #
  338. MESSAGE(ELS$TXT,ACCT); # SEND TEXT TO ACCOUNT FILE #
  339. MESSAGE(ELS$TXT,ERRLOG); # SEND TEXT TO ERRLOG FILE #
  340. END # PROCESS SCLI C3 TEXT #
  341. ELSE
  342. BEGIN # PROCESS SCTU C3 TEXT #
  343. ES1$TYP[0] = ELS$TYP[0]; # MOVE *TU* TO TEXT ARRAY #
  344. ES1$SN[0] = ELS$SN[0]; # MOVE SOURCE NODE TO TEXT ARRAY #
  345. ES1$CNUM[0] = "3";
  346. ITEMP = XCDD(STIBB[0]); # CONVERT NO. BAD BLKS TRANS #
  347. CNST1 = 1; # WORD ORDINAL OF BITFIELD #
  348. CNST2 = 36; # STARTING BITPOSITION #
  349. CNST3 = 36; # NO. OF BITS TO STORE #
  350. SSBSBF(ES1$TXT,CNST1,CNST2,CNST3,ITEMP); # STORE BITFIELD #
  351. MESSAGE(ES1$TXT,ACCT); # SEND TEXT TO ACCOUNT FILE #
  352. MESSAGE(ES1$TXT,ERRLOG); # SEND TEXT TO ERRLOG FILE #
  353. END # PROCESS SCTU C3 TEXT #
  354. END
  355. EXIT:
  356. RETURN; # **** RETURN **** #
  357.  
  358.  
  359. CONTROL EJECT;
  360.  
  361. PROC CONVERT;
  362. # TITLE CONVERT - CONVERTS DISPLAY CODE TEXT TO ASCII. #
  363.  
  364. BEGIN # CONVERT #
  365. #
  366. ** CONVERT - CONVERTS DISPLAY CODE TEXT TO ASCII.
  367. *
  368. * A. LIM 83/02/24
  369. *
  370. * THIS PROCEDURE IS INTERNAL TO *CSESES* AND IS ONLY CALLED BY
  371. * *CSESES*. ITS MAIN FUNCTION IS TO CONVERT DISPLAY CODE TEXT
  372. * TO ASCII AND STORE IT INTO TEXT PORTION OF AN ALM/OP SM ( WITH
  373. * PFC/SFS, PORT AND SUBPORT PRESET TO ZERO). THEN THE SM IS
  374. * SENT TO THE *EVQ*.
  375. *
  376. * PROC CONVERT
  377. *
  378. * ENTRY: TEXT IN AREA POINTED TO BY *GENPBUF*
  379. * LEN = LENGTH IN CHARACTERS OF TEXT
  380. *
  381. * EXIT: TEXT CONVERTED TO ASCII, AND AN ALM/OP SENT TO *EVQ*
  382. *
  383. #
  384.  
  385.  
  386.  
  387.  
  388.  
  389. ITEM CHAR U; # CHARACTER #
  390. ITEM I U; # LOOP INDUCTION VAR #
  391. ITEM EBIT U; # STARTING BIT OF EXTRACTION #
  392. ITEM EORD U; # STARTING WORD OF EXTRACTION #
  393. ITEM SBIT U; # STARTING BIT OF STORING #
  394. ITEM SORD U; # STARTING WORD OF STORING #
  395.  
  396.  
  397.  
  398.  
  399. #
  400. * CLEAR BUFFER AREAS.
  401. #
  402.  
  403. WCB$WORD[1] = 0;
  404. ABHWORD[1] = 0;
  405. FOR I = (NMSGBUF$ + 1)/2 STEP 1 UNTIL NMSGBUF$
  406. DO
  407. BEGIN
  408. MSG$WORD[I] = 0; # CLEAR 2ND HALF OF *MSGBUF* #
  409. END
  410.  
  411. #
  412. * INITIALIZE INDICES.
  413. #
  414.  
  415. EBIT = 0;
  416. EORD = 0;
  417. SBIT = 32;
  418. SORD = 0;
  419.  
  420. #
  421. * CONVERT MESSAGE INTO ASCII AND STORE IT INTO THE TEXT PORTION OF
  422. * AN ALM/OP SM.
  423. #
  424.  
  425. FOR I = 0 STEP 1 UNTIL LEN-1
  426. DO
  427. BEGIN
  428. SSBEBF(GENPBUF[0],EORD,EBIT,6,CHAR); # EXTRACT A CHAR #
  429. CHAR = SSDCDA(CHAR); # CONVERT IT TO ASCII #
  430. SSBSBF(CSSM[1],SORD,SBIT,8,CHAR); # STORE IT IN ALM/OP #
  431. END
  432.  
  433. #
  434. * BUILD ABH, WC AND SEND SM TO *EVQ*.
  435. #
  436.  
  437. ABHSN[1] = ABHSN[0];
  438. ABHTLC[1] = 4 + LEN; # PFC + SFC + P + SP + TEXT #
  439. WCB$SMID[1] = SMID"ALMOP";
  440. WCB$WC[1] = (((ABHTLC[1]*8)+59)/60) + 2;
  441. SSTAQE(P<EVQ>, WCBUF[1], ABH[1], CSSM[1]);
  442.  
  443. END # CONVERT #
  444.  
  445. END # CSESES #
  446. TERM
cdc/nos2.source/nam5871/cseses.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator