User Tools

Site Tools


cdc:nos2.source:nam5871:nvfatac

NVFATAC

Table Of Contents

  • [00008] PROC NVFATAC
  • [00009] NVFATAC - TERMINATE A-A CONNECTION
  • [00014] TERMINATE A-A CONNECTION.
  • [00053] PROC ABORT
  • [00054] PROC MESSAGE
  • [00055] PROC SSTRTS
  • [00056] PROC SSTATS
  • [00057] PROC NVFAPVD
  • [00058] PROC NVFSCAD
  • [00059] PROC NVFUMQE
  • [00060] PROC NVFUFVO
  • [00061] PROC NVFACTC

Source Code

NVFATAC.txt
  1. *DECK NVFATAC
  2. USETEXT TEXTNVF;
  3. USETEXT TEXTSS;
  4. USETEXT TXSMNVF;
  5. USETEXT TXTANVF;
  6. USETEXT TXTAPSS;
  7. USETEXT TXTSUSS;
  8. PROC NVFATAC;
  9. # TITLE NVFATAC - TERMINATE A-A CONNECTION #
  10.  
  11. BEGIN # NVFATAC #
  12.  
  13. #
  14. ** NVFATAC - TERMINATE A-A CONNECTION.
  15. *
  16. * C. BRION 82/06/03, 83/12/12.
  17. *
  18. * THIS PROCEDURE PROCESSES THE CR/CB/U, CR/RCN/R AND FC/INACT
  19. * (TIMEOUT) SMS.
  20. *
  21. * PROC NVFATAC
  22. * ENTRY:
  23. * THE INPUT SM RESIDES IN MSGBUF.
  24. *
  25. * EXIT:
  26. * THERE ARE THREE POSSIBLE EXIT CONDITIONS:
  27. * 1) WHEN A CR/CB FOR A NON-NVF CONNECTION OR A CR/RCN IS
  28. * RECEIVED, A VCB READ REQUEST IS MADE AND THE PAAC ENTRY
  29. * CREATED.
  30. *
  31. * 2) WHEN A CR/CB FOR A NVF CONNECTION IS RECEIVED, A CR/TRM
  32. * SM IS ISSUED, THE NUMBER OF A-A CONNECTIONS FOR THE AP-
  33. * PLICATION IS DECREMENTED, APPLICATION DEPARTURE PROCESSING
  34. * IS PERFORMED, A CALL TO PROCEDURE NVFACTC IS MADE
  35. * IN ORDER TO RELEASE THE ACTIVE PID TABLE (IF NEEDED),
  36. * RELEASE THE PAAC ENTRY AND RELEASE THE VCB ORDINAL.
  37. *
  38. * 3) WHEN A TIMEOUT IS RECEIVED, A CR/RAP/A SM IS ISSUED FOR THE
  39. * CONNECTION ONLY IF THE CANCELLATION NUMBER AND ACN OF THE
  40. * TIMEOUT SM AND A PAAC ENTRY MATCH.
  41. * THE NUMBER OF PENDING A-A CONNECTIONS OF THE PAAC ENTRY IS
  42. * DECREMENTED AND APPLICATION DEPARTURE PROCESSING IS PERFORMED.
  43. * A CALL IS THEN MADE TO NVFACTC AS STATED ABOVE.
  44. #
  45. CONTROL EJECT;
  46.  
  47. #
  48. **** PROC NVFATAC XREF LIST
  49. #
  50.  
  51. XREF
  52. BEGIN
  53. PROC ABORT; # MACREL - ABORT TASK #
  54. PROC MESSAGE; # ISSUE MESSAGE TO DAYFILE #
  55. PROC SSTRTS; # SS-REMOVE TABLE SPACE #
  56. PROC SSTATS; # SS - ALLOCATE TABLE SPACE #
  57. PROC NVFAPVD; # PREPARE VCB REQUEST #
  58. PROC NVFSCAD; # COMPLETE APPL DEPARTURE #
  59. PROC NVFUMQE; # MAKE QUEUE ENTRY #
  60. PROC NVFUFVO; # FREE UP VCB ORDINAL #
  61. PROC NVFACTC; # CLEANUP TERMINATING CONN #
  62. END
  63.  
  64. #
  65. ****
  66. #
  67.  
  68. #
  69. * ITEM DEFINITIONS.
  70. #
  71.  
  72. ITEM PAC I; # PAAC ENTRY ORDINAL #
  73. ITEM NENTRY I; # NUMBER TABLE ENTRY VAR #
  74. ITEM VCBIN I; # VCB ORDINAL #
  75. ITEM ANIN I; # APPL NUMBER #
  76. ITEM AORD I; # APPL AST ORDINAL #
  77. ITEM ASENTRY I; # NUMBER AST ENTRIES #
  78. ITEM PORD I; # PRIMARY APPL AST ORDINAL #
  79. ITEM VCBREL B; # VCB RELEASE FLAG #
  80.  
  81.  
  82. $BEGIN
  83.  
  84. #
  85. * NOAST - NO AST ENTRY WAS FOUND.
  86. #
  87.  
  88. ARRAY NOAST [00:00] S(4);
  89. BEGIN
  90. ITEM NO$MSG C(00,00,31) =
  91. [" NVFATAC - AST ENTRY NOT FOUND."];
  92. ITEM NO$ZERO U(03,06,54) = [0];
  93. END
  94.  
  95. $END
  96.  
  97. CONTROL EJECT;
  98. #
  99. *
  100. * MAIN NVFATAC PROCEDURE START
  101. *
  102. #
  103. ASENTRY = ASTLNGTH/ASTSIZ$;
  104. VCBREL = TRUE;
  105.  
  106. #
  107. * CHECK IF TIMEOUT. IF SO, PROCEED TO LOCATE PAAC ENTRY.
  108. #
  109. IF WCB$SMID[0] EQ CTQSTAT"SINA"
  110. THEN
  111. BEGIN
  112. NENTRY = PACLNGTH/PAACSIZ$;
  113. FOR PAC = 0 STEP 1 WHILE
  114. NOT (PA$NACN[PAC] EQ FCACN[0] AND PA$CNUM[PAC] EQ ABHABN[0])
  115. AND (PAC LS NENTRY)
  116. DO
  117. BEGIN
  118. END
  119. IF PAC NQ NENTRY
  120. THEN
  121. BEGIN
  122. #
  123. * PAAC ENTRY FOUND, TIMEOUT IS GOOD. ATTEMPT TO FIND AST
  124. * ENTRY OF THE PAAC ENTRY.
  125. #
  126. FOR AORD = 0 STEP 1 WHILE
  127. ((PA$SWAP[PAC] NQ AST$PANAM[AORD]) AND
  128. (AORD NQ ASENTRY))
  129. DO
  130. BEGIN
  131. END
  132. IF AORD NQ ASENTRY
  133. THEN
  134. #
  135. * AST ENTRY FOUND.
  136. * PERFORM DEPARTURE PROCESSING FOR APPLICATION.
  137. #
  138. NVFSCAD(AORD);
  139.  
  140. #
  141. * SEND CR/RAP/A SM.
  142. * RELEASE PAC ENTRY, ACPID TABLE SPACE AND VCB ORDINAL VIA
  143. * CALL TO NVFACTC.
  144. #
  145. SPMSG0[1] = 0;
  146. PFCSFC[1] = CRRAPA;
  147. CRNACN[1] = PA$NACN[PAC];
  148. CRRRAP[1] = RCRA"ANA";
  149. NVFUMQE(P<CTQ>,APSM[1],APPPR$,0,LCRRAPA);
  150. NVFACTC(PAC,VCBREL);
  151. GOTO ENDEXIT;
  152. END
  153. GOTO ENDEXIT;
  154. END
  155.  
  156. #
  157. * NOT A TIMEOUT, CONTINUE FOR CB OR RECONNECT.
  158. * GET VCB ORDINAL AND APPL NUMBER FROM SM.
  159. #
  160.  
  161. VCBIN = CRVCB[0];
  162. ANIN = CRAN[0];
  163.  
  164. #
  165. * IF THE APPLICATION NUMBER IS 1, THAT IS NVF. DO NOT LOOK FOR AN
  166. * AST ENTRY BECAUSE NVF DOESN'T HAVE ONE. SET UP THE AST ORDINAL
  167. * TO BYPASS FURTHER AST CHECKS.
  168. #
  169.  
  170. IF ANIN EQ 1
  171. THEN
  172. BEGIN
  173. AORD = ASENTRY;
  174. PORD = AORD;
  175. END
  176. ELSE
  177.  
  178. #
  179. * DETERMINE THE AST ORDINAL OF THE APPLICATION. CHECK IF A
  180. * SECONDARY TYPE OF APPLICATION AND THEN DETERMINE THE PRIMARY
  181. * AST ORDINAL.
  182. #
  183. BEGIN
  184. FOR AORD = 0 STEP 1 WHILE
  185. ((AORD LS ASENTRY) AND
  186. (AST$AN[AORD] NQ ANIN))
  187. DO
  188. BEGIN
  189. END
  190. IF AORD NQ ASENTRY
  191. THEN
  192. BEGIN
  193. PORD = AORD;
  194. IF AST$PANAM[AORD] NQ AST$SANAM[AORD]
  195. THEN
  196. BEGIN
  197. FOR PORD = 0 STEP 1 WHILE
  198. ((PORD LS ASENTRY) AND
  199. (AST$SANAM[AORD] NQ AST$PANAM[PORD]))
  200. DO
  201. BEGIN
  202. END
  203. IF PORD EQ ASENTRY
  204. THEN
  205. PORD = AORD;
  206. END
  207. END
  208. END
  209.  
  210. #
  211. * CHECK THE SFC OF THE INCOMING SM. IF CB (CONNECTION BROKEN),
  212. * CHECK IF NVFS CONNECTION OR NOT.
  213. #
  214.  
  215. IF SFC[0] EQ CB
  216. THEN
  217. BEGIN
  218. IF (CRNACN[0] EQ 0 AND NOT CRLIMBO[0])
  219. THEN
  220.  
  221. #
  222. * NON-NVF CONNECTION HAS RECEIVED A CR/CB. ISSUE READ VCB REQUEST.
  223. * A PAAC ENTRY CREATED AND SET THE STATE.
  224. #
  225.  
  226. BEGIN
  227. #
  228. * IF NO AST ENTRY WAS FOUND, SOMETHING IS WRONG -- ABORT.
  229. #
  230. $BEGIN
  231. IF (AORD EQ ASENTRY) AND
  232. (ANIN NQ 1)
  233. THEN
  234. BEGIN
  235. MESSAGE(NOAST[0],0);
  236. ABORT;
  237. END
  238. $END
  239.  
  240. NVFAPVD(VCBIN,ANIN,PAC);
  241. PA$STATE[PAC] = PAACST"PACB";
  242. PA$IAPRC[PAC] = CRRCB[0];
  243. PA$VCB[PAC] = VCBIN;
  244. END
  245. ELSE # MEMORY RESIDENT PAAC - NO CR/ACC SEEN #
  246.  
  247. #
  248. * NVF CONNECTION NEVER REACHED THE SWITCHED STATE. A PAAC EXISTS.
  249. * LOCATE PAAC ENTRY, THEN THE APPLICATION TABLE ENTRY BASED ON THE
  250. * SWITCHED APPLICATION NUMBER IN THE PAAC ENTRY.
  251. #
  252.  
  253. BEGIN
  254. NENTRY = PACLNGTH / PAACSIZ$;
  255. FOR PAC = 0 STEP 1 WHILE
  256. ((PAC LS NENTRY) AND (PA$VCB[PAC] NQ CRVCB[0]))
  257. DO
  258. BEGIN
  259. END
  260.  
  261. #
  262. * A PAAC ENTRY MAY NOT BE FOUND SINCE IT MAY HAVE BEEN DELETED BY
  263. * FAIL/APPL PROCESSING. IF THIS IS THE CASE, JUST IGNORE THE CR/CB.
  264. #
  265.  
  266. IF PAC EQ NENTRY
  267. THEN
  268. GOTO ENDEXIT;
  269.  
  270.  
  271. #
  272. * CHECK IF CONNECTION AWAITING VCB DATA ON RECONNECT. IF NOT,
  273. * THEN PROCEED. OTHERWISE, THE RECONNECT VCB PROCESSING WILL
  274. * FINISH CONNECTION PROCESSING AND ISSUE A CR/TRM/R SM.
  275. #
  276.  
  277. IF PA$STATE[PAC] NQ PAACST"PARCN"
  278. THEN
  279. BEGIN
  280. #
  281. * IF THE APPL NUMBER IS 1 (FOR NVF), GET THE SWITCHED APPL NAME
  282. * FROM THE PAAC ENTRY INSTEAD OF THE SM.
  283. #
  284. IF ANIN EQ 1
  285. THEN
  286. BEGIN
  287. FOR AORD = 0 STEP 1 WHILE
  288. (AORD LS ASENTRY) AND
  289. (AST$PANAM[AORD] NQ PA$SWAP[PAC])
  290. DO
  291. BEGIN
  292. END
  293.  
  294. IF AORD NQ ASENTRY
  295. THEN
  296. BEGIN
  297. PORD = AORD;
  298. IF AST$PANAM[AORD] NQ AST$SANAM[AORD]
  299. THEN
  300. BEGIN
  301. FOR PORD = 0 STEP 1 WHILE
  302. ((PORD LS ASENTRY) AND
  303. (AST$SANAM[AORD] NQ AST$PANAM[PORD]))
  304. DO
  305. BEGIN
  306. END
  307. IF PORD EQ ASENTRY
  308. THEN
  309. PORD = AORD;
  310. END
  311. END
  312. END
  313.  
  314. #
  315. * DECREMENT NUMBER OF A-A CONNECTIONS FOR THE SECONDARY
  316. * AST ENTRY AND THE PRIMARY AST ENTRY IF NOT THE SAME ENTRY.
  317. #
  318. IF AORD NQ ASENTRY
  319. THEN
  320. BEGIN
  321. AST$AACN[AORD] = AST$AACN[AORD] - 1;
  322. IF AORD NQ PORD
  323. THEN
  324. AST$AACN[PORD] = AST$AACN[PORD] - 1;
  325. END
  326. #
  327. * ISSUE A CT/TRM/R SM ONLY FOR NVF CONNECTION.
  328. #
  329.  
  330. IF NOT CRLIMBO[0]
  331. THEN
  332. BEGIN
  333. SPMSG0[1] = 0;
  334. PFCSFC[1] = CRTRM;
  335. RC[1] = CRRCB[0];
  336. CRNACN[1] = CRNACN[0];
  337. NVFUMQE(P<CTQ>,APSM[1],APPPR$,0,LCRTRM);
  338. END
  339.  
  340. #
  341. * CALL NVFACTC TO RELEASE ACPID TABLE SPACE, THE PAAC ENTRY AND
  342. * THE ASSIGNED VCB ORDINAL. PROCEED TO COMPLETE APPLICATION DE-
  343. * PARTURE FOR SECONDARY AST ENTRY AND THE PRIMARY AST ENTRY IF
  344. * NOT THE SAME ENTRY.
  345. #
  346.  
  347. NVFACTC(PAC,VCBREL);
  348. IF AORD NQ ASENTRY
  349. THEN
  350. BEGIN
  351. NVFSCAD(AORD);
  352. IF AORD NQ PORD
  353. THEN
  354. NVFSCAD(PORD);
  355. END
  356. END
  357. END
  358. END
  359. ELSE # CR/RCN/R SM RECEIVED #
  360. BEGIN
  361.  
  362. #
  363. * CR/RCN RECEIVED. CHECK IF LIMBO STATE MEANING THAT
  364. * THE SWITCH NEVER ACTUALLY TOOK PLACE.
  365. #
  366.  
  367. IF NOT CRLIMBO[0]
  368. THEN
  369. BEGIN
  370.  
  371. #
  372. * IF NO AST ENTRY WAS FOUND, SOMETHING IS WRONG -- ABORT.
  373. #
  374. $BEGIN
  375. IF (AORD EQ ASENTRY) AND
  376. (ANIN NQ 1)
  377. THEN
  378. BEGIN
  379. MESSAGE(NOAST[0],0);
  380. ABORT;
  381. END
  382. $END
  383. #
  384. * RECONNECT FOR NON-NVF CONNECTION. MUST GET PAAC ENTRY BUILT,
  385. * THEN ISSUE A VCB READ REQUEST FOR THE VCB DATA.
  386. #
  387.  
  388. NVFAPVD(VCBIN,ANIN,PAC);
  389. PA$STATE[PAC] = PAACST"PARCN";
  390. PA$VCB[PAC] = VCBIN;
  391. PA$IAPRC[PAC] = CRRRCN[0];
  392. PA$NACN[PAC] = CRNACN[0];
  393. END
  394.  
  395. #
  396. * CHECK IF LIMBO STATE. IF SO, THEN THE CONNECTION NEVER WAS
  397. * SUCCESSFULLY SWITCHED. A CR/ACC SM NEVER RECEIVED THEREFORE
  398. * THE PAAC ENTRY IS STILL RESIDENT RATHER THAN ON VCB DISK FILE.
  399. * LOCATE THE PAAC ENTRY, DECREMENT THE NUMBER OF AA CONNECTIONS
  400. * FOR THE SWITCHED APPLICATION, ISSUE A CR/TRM SM, CALL NVFACTC
  401. * IN ORDER TO RELEASE ACPID TABLE ENTRY FOR PAAC ENTRY, THE PAAC
  402. * ENTRY ITSELF AND THE ASSIGNED VCB ORDINAL. COMPLETE APPLICATION
  403. * DEPARTURE VIA CALL TO NVFSCAD.
  404. #
  405.  
  406. IF CRLIMBO[0]
  407. THEN
  408. BEGIN
  409. NENTRY = PACLNGTH / PAACSIZ$;
  410. FOR PAC = 0 STEP 1 WHILE
  411. ((PAC LS NENTRY) AND (PA$VCB[PAC] NQ CRVCB[0]))
  412. DO
  413. BEGIN
  414. END
  415.  
  416. IF PAC EQ NENTRY
  417. THEN
  418. GOTO ENDEXIT;
  419.  
  420. #
  421. * DECREMENT NUMBER A-A CONNECTIONS FOR SECONDARY AST ENTRY AND
  422. * THE PRIMARY AST ENTRY IF NOT THE SAME ENTRY.
  423. #
  424. IF AORD NQ ASENTRY
  425. THEN
  426. BEGIN
  427. AST$AACN[AORD] = AST$AACN[AORD] - 1;
  428. IF AORD NQ PORD
  429. THEN
  430. AST$AACN[PORD] = AST$AACN[PORD] - 1;
  431. END
  432. #
  433. * ISSUE THE CT/TRM/R SM.
  434. #
  435.  
  436. SPMSG0[1] = 0;
  437. PFCSFC[1] = CRTRM;
  438. RC[1] = CRRRCN[0];
  439. CRNACN[1] = CRNACN[0];
  440. CRTRAN[1] = 1;
  441. NVFUMQE(P<CTQ>,APSM[1],APPPR$,0,LCRTRM);
  442.  
  443. #
  444. * CALL NVFACTC AND NVFSCAD TO CLEAN THINGS UP.
  445. #
  446.  
  447. NVFACTC(PAC,VCBREL);
  448. IF AORD NQ ASENTRY
  449. THEN
  450. BEGIN
  451. NVFSCAD(AORD);
  452. IF AORD NQ PORD
  453. THEN
  454. NVFSCAD(PORD);
  455. END
  456. END
  457. END
  458.  
  459.  
  460. ENDEXIT:
  461. END # NVFATAC #
  462.  
  463. TERM
cdc/nos2.source/nam5871/nvfatac.txt · Last modified: 2023/08/05 17:22 by Site Administrator