User Tools

Site Tools


cdc:nos2.source:nam5871:nvftcb

NVFTCB

Table Of Contents

  • [00006] PROC NVFTCB
  • [00007] NVFTCB - CONNECTION BROKEN REQUEST (CR/CB SM)
  • [00011] CONNECTION BROKEN REQUEST (CR/CB SM).
  • [00070] PROC NVFSCAD
  • [00071] PROC NVFTETC
  • [00072] PROC NVFTPVD
  • [00073] PROC NVFTURT

Source Code

NVFTCB.txt
  1. *DECK NVFTCB
  2. USETEXT TEXTNVF
  3. USETEXT TXSMNVF
  4. USETEXT TXTANVF
  5.  
  6. PROC NVFTCB;
  7. # TITLE NVFTCB - CONNECTION BROKEN REQUEST (CR/CB SM) #
  8.  
  9. BEGIN # NVFTCB #
  10. #
  11. ** NVFTCB - CONNECTION BROKEN REQUEST (CR/CB SM).
  12. *
  13. * E. THAVIKULWAT 81/11/10
  14. * C. BRION 83/04/11. 83/05/10.
  15. *
  16. * THIS PROCEDURE'S MAIN FUNCTION IS TO RETRIEVE THE BROKEN
  17. * CONNECTION'S TABLES AND PREPARE FOR TERMINATION. IT IS CALLED
  18. * INTO EXECUTION BY PROCEDURE *NVFTDQE*.
  19. *
  20. * PROC NVFTCB
  21. *
  22. * ENTRY:
  23. * CR/CB SM IN *MSGBUF*
  24. *
  25. * EXIT:
  26. * CONNECTION TERMINATED.
  27. *
  28. * NOTES:
  29. * 1) A CR/CB REQUEST FOR A NON-NVF CONNECTION COULD OCCUR BEFORE
  30. * OR AFTER A CR/ACC WAS RECEIVED IN RESPONSE TO THE CR/SWH
  31. * REQUEST. IF IT OCCURRED BEFORE A CR/ACC WAS RECEIVED, THEN
  32. * A *PTAC* ENTRY FOR THE CONNECTION STILL EXIST. IF IT
  33. * OCCURRED AFTER A CR/ACC WAS RECEIVED, A *PTAC* ENTRY FOR THE
  34. * CONNECTION NO LONGER EXIST, BUT A VCB ENTRY FOR THE
  35. * CONNECTION EXIST OUT ON THE VCB FILE.
  36. * 2) A CR/CB REQUEST FOR AN NVF CONNECTION COULD OCCUR BEFORE OR
  37. * AFTER A CR/SWH REQUEST WAS SENT BY *NVF*. NORMAL SITUATION
  38. * WOULD BE BEFORE A CR/SWH REQUEST WAS SENT. CR/CB REQUEST
  39. * FOR AN NVF CONNECTION AFTER A CR/SWH REQUEST WAS SENT
  40. * IMPLIES THAT NVF SENT OUT THE CR/SWH REQUEST BEFORE
  41. * REALIZING THAT THE CONNECTION WAS ALREADY BROKEN. IN BOTH
  42. * CASES A *PTAC* ENTRY STILL EXIST FOR THE CONNECTION.
  43. *
  44. * METHOD:
  45. * IF AN NVF CONNECTION IS BROKEN, GET ITS *PTAC* ENTRY. IF
  46. * STATE OF THE *PTAC* IS AWAITING VALIDATION OR VCB DATA, THEN
  47. * CONNECTION CANNOT BE TERMINATED AT THIS TIME. CHANGE STATE TO
  48. * CONNECTION BROKEN SO THE PROCESSES THAT RECEIVES THE VALIDATION
  49. * OR VCB DATA COULD PROCEED TO TERMINATE THE CONNECTION AS SOON
  50. * AS THE CIO FUNCTION COMPLETES. OTHERWISE, PROCEED TO TERMINATE
  51. * THE CONNECTION.
  52. *
  53. * IF A NON-NVF CONNECTION IS BROKEN BEFORE A CR/ACC WAS RECEIVED,
  54. * GET ITS *PTAC* ENTRY, UPDATE WITH NEW ACN, DECREMENT T-A
  55. * CONNECTION COUNT, AND TERMINATE THE CONNECTION.
  56. *
  57. * IF A NON-NVF CONNECTION IS BROKEN AFTER A CR/ACC WAS RECEIVED,
  58. * ALLOCATE SPACE FOR A NEW *PTAC* ENTRY, MAKE VCB READ REQUEST,
  59. * DECREMENT T-A CONNECTION COUNT, UPDATE *PTAC* WITH INFORMATION
  60. * RECEIVED IN THE CR/CB SM, SET STATE OF THE *PTAC* TO
  61. * AWAIT-VCB-CB, AND EXIT.
  62. #
  63.  
  64. #
  65. **** PROC NVFTCB - XREF LIST.
  66. #
  67.  
  68. XREF
  69. BEGIN
  70. PROC NVFSCAD; # COMPLETE APPLICATION DEPARTURE #
  71. PROC NVFTETC; # END TERMINAL CONNECTION #
  72. PROC NVFTPVD; # PREPARE TO RECEIVE VALIDATION DATA #
  73. PROC NVFTURT; # UPDATE *RAU* TABLE #
  74. END
  75.  
  76. #
  77. ****
  78. #
  79. ITEM AS I; # SUBSCRIPT FOR ARRAY AST #
  80. ITEM ASENTRY I; # NUMBER AST ENTRIES #
  81. ITEM MATCH B; # EXIT LOOP VARIABLE #
  82. ITEM NENTRY I; # NUMBER OF ENTRIES IN TABLE #
  83. ITEM PRIAPP B; # PRIMARY APPLICATION INDICATOR #
  84. ITEM PT I; # SUBSCRIPT FOR ARRAY PTAC #
  85. ITEM PORD I; # PRIMARY AST ENTRY ORDIANL #
  86.  
  87. CONTROL EJECT;
  88. #
  89. * DETERMINE NUMBER OF AST ENTRIES.
  90. #
  91. ASENTRY = ASTLNGTH/ASTSIZ$;
  92.  
  93. #
  94. * DETERMINE WHETHER OR NOT BROKEN CONNECTION BELONGS TO NVF.
  95. #
  96. IF CRNACN[0] NQ 0
  97. THEN # NVF CONNECTION BROKEN #
  98. BEGIN
  99. #
  100. * NVF'S CONNECTION HAS BEEN BROKEN. SEARCH *PTAC* TABLE FOR
  101. * ENTRY THAT MATCHES ON ACN. NO MATCH IMPLIES NVF SENT OUT THE
  102. * CR/SWH REQUEST BEFORE REALIZING THAT THE CONNECTION WAS BROKEN.
  103. #
  104. MATCH = FALSE;
  105. NENTRY = PTALNGTH / PTACSIZ$; # CALCULATE NUMBER OF ENTRIES #
  106. FOR PT = 0 STEP 1 WHILE (NOT MATCH AND PT LS NENTRY)
  107. DO
  108. BEGIN
  109. IF PTA$ACN[PT] EQ CRNACN[0]
  110. THEN # PTAC ENTRY FOUND #
  111. BEGIN
  112. #
  113. * IF *PTAC* STATE IS AWAITING VALIDATION (CPM56B) OR VCB
  114. * DATA, THEN CONNECTION CANNOT BE TERMINATED AT THIS TIME.
  115. * OTHERWISE, PROCEED TO END TERMINAL CONNECTION.
  116. #
  117. PTA$RC[PT] = CRRRCN[0]; # SAVE REASON CODE #
  118. IF (PTA$STATE[PT] EQ PTACST"AWTVAL")
  119. OR (PTA$STATE[PT] EQ PTACST"AWTVCBR")
  120. OR (PTA$STATE[PT] EQ PTACST"AWTVCBL")
  121. THEN # AWAITING DATA, CAN'T TERMNATE #
  122. BEGIN
  123. IF PTA$STATE[PT] EQ PTACST"AWTVAL"
  124. THEN
  125. BEGIN
  126. PTA$STATE[PT] = PTACST"CONBROK"; # CONN BROKEN STATE #
  127. END
  128. ELSE
  129. BEGIN
  130. PTA$STATE[PT] = PTACST"AWTVCBC"; # AWAIT-VCB-CB STATE #
  131. END
  132. #
  133. * IF THE CONNECTION WAS IN THE PROCESS OF BEING LOANED FROM
  134. * THE PRIMARY TO THE SECONDARY APPLICATION, CLEAR THE LOAN
  135. * STATUS FROM THE PTAC AND TREAT THIS AS A NORMAL CONNECTION
  136. * SWITCH. THIS IS TO PREVENT THE CONNECTION COUNT OF THE
  137. * PRIMARY APPLICATION FROM BEING DECREMENTED TWICE (IN
  138. * *NVFTRVD*).
  139. #
  140. IF (PTA$LRC[PT] EQ RCRC"LSA") AND
  141. (PTA$STATE[PT] EQ PTACST"AWTVCBC")
  142. THEN
  143. BEGIN
  144. PTA$LRC[PT] = 0;
  145. PTA$LCF[PT] = FALSE;
  146. END
  147. END
  148. ELSE # PROCEED TO TERMINATE CONN #
  149. BEGIN
  150. #
  151. * IF THIS IS AN INITIAL LOAN CONNECTION, DELETE THE T-A
  152. * CONNECTION COUNT FOR THE PRIMARY APPLICATION. UPDATE THE
  153. * *RAU* TABLE, IF NECESSARY.
  154. #
  155. IF PTA$LRC[PT] EQ RCRC"LSA"
  156. THEN
  157. BEGIN
  158. PRIAPP = TRUE;
  159. NVFTURT(VCB$VCB[0],PT,PRIAPP);
  160.  
  161. FOR AS = 0 STEP 1 WHILE
  162. ((AS LS ASENTRY) AND
  163. (AST$AN[AS] NQ PTA$PRIAN[PT]))
  164. DO
  165. BEGIN
  166. END
  167. IF AS LS ASENTRY
  168. THEN
  169. BEGIN
  170. AST$RACN[AS] = AST$RACN[AS] - 1;
  171. NVFSCAD(AS);
  172. END
  173. END
  174. #
  175. * IF THIS IS A RETURN OF A LOANED CONNECTION FROM THE
  176. * SECONDARY TO THE PRIMARY APPL, UPDATE THE *RAU* TABLE OF
  177. * THE PRIMARY (SWITCHED) APPL, IF NECESSARY. THERE IS NO
  178. * NEED TO DECREMENT THE NUMBER OF RESERVED CONNECTIONS, AS
  179. * THIS SHOULD ALREADY HAVE BEEN DONE IN NVFTDSP.
  180. #
  181. IF PTA$LRC[PT] GR RCRC"LSA"
  182. THEN
  183. BEGIN
  184. PRIAPP = FALSE;
  185. NVFTURT(VCB$VCB[0],PT,PRIAPP);
  186. END
  187.  
  188. NVFTETC(PT); # END TERMINAL CONNECTION #
  189. END
  190.  
  191. MATCH = TRUE; # EXIT LOOP #
  192. END
  193. END
  194.  
  195. IF NOT MATCH
  196. THEN # CR/SWH REQUEST ALREADY SENT #
  197. BEGIN
  198. #
  199. * CR/SWH ALREADY SENT. CALL *NVFTURT* TO GET *PTAC* ENTRY THAT
  200. * MATCHES ON VCB, UPDATE *RAU* TABLE IT NEEDED, SAVE ACN,
  201. * DECREMENT T-A CONNECTION COUNT, AND TERMINATE CONNECTION.
  202. * BEFORE ALL THIS CAN BE DONE, WE MUST FIRST SEARCH THE *PTAC*
  203. * TABLE FOR THE VCB ORDINAL IN THE CR/CB. IF NO MATCHING
  204. * *PTAC* ENTRY CAN BE FOUND, IT MEANS NVF HAS ALREADY INITIATED
  205. * CONNECTION TERMINATION AND THIS HAS COLLIDED WITH THE CR/CB.
  206. * IN THIS CASE THE CR/CB SHOULD BE IGNORED. THIS SEARCH IS
  207. * REDUNDANT WITH THAT PERFORMED BY *NVFTURT*, BUT IS NECESSARY
  208. * TO KEEP *NVFTURT* FROM ABORTING INAPPROPRIATELY.
  209. #
  210. FOR PT=0 STEP 1
  211. WHILE PTA$VCB[PT] NQ CRVCB[0]
  212. AND PT LS NENTRY
  213. DO # FIND *PTAC* ENTRY #
  214. BEGIN END
  215. IF PT EQ NENTRY
  216. THEN # MUST IGNORE CR/CB/SM #
  217. RETURN;
  218.  
  219. PTA$ACN[PT] = CRACN[0]; # SAVE ACN #
  220. PTA$RC[PT] = CRRRCN[0]; # SAVE REASON CODE #
  221. #
  222. * LOCATE THE AST ENTRY FOR THE PTAC ENTRY.
  223. #
  224. FOR AS = 0 STEP 1 WHILE
  225. (AS LS ASENTRY AND
  226. AST$PANAM[AS] NQ PTA$SWTAPP[PT])
  227. DO
  228. BEGIN
  229. END
  230. #
  231. * UPDATE THE RAU TABLE, IF NEEDED. DECREMENT THE NUMBER OF T-A
  232. * CONNECTIONS FOR THE SELECTED APPLICATION.
  233. #
  234. PRIAPP = FALSE;
  235. NVFTURT(CRVCB[0],PT,PRIAPP); # UPDATE *RAU* TABLE #
  236.  
  237. AST$TACN[AS] = AST$TACN[AS] - 1; # DECREMENT NUMBER OF CONN #
  238. AST$ICCN[AS] = AST$ICCN[AS] - 1; #DECREMENT NO OF INCMG CONN#
  239. NVFSCAD(AS); # COMPLETE APPLICATION DEPARTURE #
  240. #
  241. * IF THIS IS AN INITIAL LOAN, LOCATE THE AST ENTRY FOR THE PRIMARY
  242. * APPLICATION. UPDATE THE *RAU* TABLE AND DECREMENT THE NUMBER OF
  243. * RESERVED CONNECTIONS.
  244. #
  245. IF PTA$LRC[PT] EQ RCRC"LSA"
  246. THEN
  247. BEGIN
  248. PRIAPP = TRUE;
  249. NVFTURT(CRVCB[0],PT,PRIAPP);
  250.  
  251. FOR AS = 0 STEP 1 WHILE
  252. (AS LS ASENTRY AND
  253. AST$AN[AS] NQ PTA$PRIAN[PT])
  254. DO
  255. BEGIN
  256. END
  257. IF AS LS ASENTRY
  258. THEN
  259. BEGIN
  260. AST$RACN[AS] = AST$RACN[AS] - 1;
  261. NVFSCAD(AS);
  262. END
  263. END
  264. NVFTETC(PT); # END TERMINAL CONNECTION #
  265. END
  266.  
  267. END
  268. ELSE # NON-NVF CONNECTION BROKEN #
  269. BEGIN
  270. #
  271. * A NON-NVF CONNECTION HAS BEEN BROKEN. NO CR/TRM SM WILL BE
  272. * SENT. DETERMINE IF CR/CB OCCURRED BEFORE ACKNOWLEDGEMENT OF
  273. * THE CR/SWH REQUEST (I.E., CR/ACC HAS NOT YET BEEN RECEIVED).
  274. #
  275. IF CRLIMBO[0]
  276. THEN # CR/CB OCCURRED BEFORE CR/ACC RECEIVED #
  277. BEGIN
  278. #
  279. * CR/CB OCCURRED BEFORE CR/ACC WAS RECEIVED SO A *PTAC* ENTRY
  280. * STILL EXIST. CALL *NVFTURT* TO FIND THE *PTAC* ENTRY AND
  281. * UPDATE *RAU* TABLE IF NEEDED. DECREMENT T-A CONNECTION
  282. * COUNT AND END TERMINAL CONNECTION.
  283. #
  284. PRIAPP = FALSE;
  285. NVFTURT(CRVCB[0],PT,PRIAPP); # UPDATE *RAU* TABLE IF NEEDED #
  286. #
  287. * LOCATE AST ENTRY FOR PTAC ENTRY THEN DECREMENT NUMBER TA
  288. * CONNECTIONS.
  289. #
  290. FOR AS = 0 STEP 1 WHILE
  291. (AS LS ASENTRY AND
  292. AST$PANAM[AS] NQ PTA$SWTAPP[PT])
  293. DO
  294. BEGIN
  295. END
  296. AST$TACN[AS] = AST$TACN[AS] - 1; # DECREMENT NUMBER OF CONN #
  297. AST$ICCN[AS] = AST$ICCN[AS] - 1; #DECREMENT NO OF INCMG CONN#
  298. NVFSCAD(AS); # COMPLETE APPLICATION DEPARTURE #
  299. #
  300. * IF THIS WAS AN INITIAL LOAN OF A CONNECTION FROM PRIMARY TO
  301. * SECONDARY APPLICATION, LOCATE THE AST ENTRY FOR THE PRIMARY APPL
  302. * AND DECREMENT THE NUMBER OF T-A CONNECTIONS FOR THE PRIMARY APPL.
  303. * CALL *NVFTURT* TO UPDATE THE *RAU* TABLE FOR THE PRIMARY APPL, IF
  304. * NEEDED.
  305. #
  306. IF PTA$LRC[PT] EQ RCRC"LSA"
  307. THEN
  308. BEGIN
  309. PRIAPP = TRUE;
  310. NVFTURT(CRVCB[0],PT,PRIAPP); # UPDATE *RAU* TABLE #
  311.  
  312. FOR AS = 0 STEP 1 WHILE
  313. (AS LS ASENTRY AND
  314. AST$AN[AS] NQ PTA$PRIAN[PT])
  315. DO
  316. BEGIN
  317. END
  318. AST$RACN[AS] = AST$RACN[AS] - 1; # DECREMENT NO. OF CONN. #
  319. NVFSCAD(AS);
  320. END
  321.  
  322. NVFTETC(PT); # END TERMINAL CONNECTION #
  323. END
  324. ELSE # CR/CB OCCURRED AFTER CR/ACC RECEIVED #
  325. BEGIN
  326. #
  327. * CR/CB OCCURRED AFTER A SUCCESSFUL SWITCH SO A *PTAC* ENTRY NO
  328. * LONGER EXIST FOR THIS CONNECTION. CALL *NVFTPVD* TO ALLOCATE
  329. * SPACE FOR A NEW *PTAC* ENTRY AND MAKE VCB READ REQUEST ENTRY
  330. * IN *VRQ* QUEUE. UPDATE *PTAC* WITH INFORMATION RECEIVED IN
  331. * THE CR/CB SM.
  332. #
  333. NVFTPVD(CRVCB[0],CRAN[0],PT);
  334.  
  335. PTA$VCB[PT] = CRVCB[0];
  336. PTA$DT[PT] = CRDT[0];
  337. PTA$TC[PT] = CRCBTC[0]; # SAVE TERMINAL CLASS #
  338. #
  339. * SET *PTAC* STATE TO AWAIT-VCB-CB TO DIFFERENTIATE FROM
  340. * AWAITING VCB READ BECAUSE OF A RECONNECT REQUEST.
  341. #
  342. PTA$STATE[PT] = PTACST"AWTVCBC";
  343. END
  344. END
  345.  
  346. END # END NVFTCB #
  347.  
  348. TERM
cdc/nos2.source/nam5871/nvftcb.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator