User Tools

Site Tools


cdc:nos2.source:nam5871:nvfaspc

NVFASPC

Table Of Contents

  • [00008] PROC NVFASPC
  • [00009] NVFASPC - SWITCH A-A PENDING CONNECTION
  • [00012] SWITCH A-A PENDING CONNECTION.
  • [00051] PROC NVFUMQE
  • [00052] PROC NVFAIAM
  • [00053] PROC NVFUFVO
  • [00054] PROC SSTRTS
  • [00055] PROC ABORT
  • [00056] PROC NVFUCRS
  • [00057] PROC SSCATR
  • [00058] PROC SSCCTR
  • [00059] PROC NVFSCAD
  • [00060] PROC NVFACTC
  • [00061] PROC MESSAGE
  • [00062] FUNC XCOD U
  • [00087] TMBBUF - TIMER REQUEST BUFFER.
  • [00120] ASTMSG - MISSING AST ENTRY ERROR MESSAGE.
  • [00396] PROC REFCONN
  • [00397] REFCONN - REFUSE PENDING CONNECTION
  • [00401] REFCONN - REFUSE PENDING CONNECTION.

Source Code

NVFASPC.txt
  1. *DECK NVFASPC
  2. USETEXT TEXTNVF
  3. USETEXT TEXTSS
  4. USETEXT TXTANVF
  5. USETEXT TXTAPSS
  6. USETEXT TXSMNVF
  7. USETEXT TXTSUSS
  8. PROC NVFASPC;
  9. # TITLE - NVFASPC - SWITCH A-A PENDING CONNECTION #
  10. BEGIN # NVFASPC #
  11. #
  12. ** NVFASPC - SWITCH A-A PENDING CONNECTION.
  13. *
  14. * C. BRION 83/04/27.
  15. *
  16. * THIS PROCEDURE IS RESPONSIBLE FOR EITHER SWITCHING OR TERMINATING
  17. * PENDING A-A CONNECTIONS THAT HAVE BEEN AWAITING THE NETON OF THE
  18. * REQUESTED APPLICATION.
  19. *
  20. * PROC NVFASPC
  21. *
  22. * ENTRY
  23. *
  24. * THE NETON NORMAL OR ABNORMAL RESPONSE SM RESIDES IN MSGBUF AND
  25. * ABHBUF.
  26. *
  27. * EXIT
  28. *
  29. * A-A CONNECTIONS PENDING CONNECTION TO THE "STARTED" APPLICATION
  30. * ARE EITHER SWITCHED TO THE APPLICATION OR ENDED VIA THE ISSUE
  31. * OF THE CR/RAP/A SM.
  32. *
  33. * APPLICATION DEPARTURE PROCESSING MAY BE PERFORMED IN THE CASE OF
  34. * OF ABNORMAL NETON RESPONSE.
  35. *
  36. *
  37. * AN ACCOUNT MESSAGE MAY BE ISSUED IN THE ABNORMAL NETON CASE.
  38. *
  39. * THE PAAC ENTRY AND ASSIGNED VCB ORDINAL WILL BE RELEASED IN
  40. * THE ABNORMAL NETON CASE FOR EACH PENDING A-A CONNECTION VIA
  41. * A CALL TO NVFACTC.
  42. *
  43. #
  44. CONTROL EJECT;
  45. #
  46. **** NVFASPC XREF LIST
  47. #
  48.  
  49. XREF
  50. BEGIN
  51. PROC NVFUMQE; # MAKE QUEUE ENTRY #
  52. PROC NVFAIAM; # ISSUE ACCOUNT MESSAGE #
  53. PROC NVFUFVO; # FREE VCB ORDINAL #
  54. PROC SSTRTS; # SS- RELEASE TABLE SPACE #
  55. PROC ABORT; # MACREL ABORT PROGRAM #
  56. PROC NVFUCRS; # CHECK REQUEST START APPL #
  57. PROC SSCATR; # SS- ACCEPT TIMER REQUEST #
  58. PROC SSCCTR; # CANCEL TIMER REQUEST #
  59. PROC NVFSCAD; # COMPLETE APPL DEPARTURE #
  60. PROC NVFACTC; # CLEANUP TERMINATED CONN #
  61. PROC MESSAGE; # SEND DAYFILE MESSAGE #
  62. FUNC XCOD U; # CONVERT OCTAL TO DISPLAY COD#
  63. END
  64. #
  65. ****
  66. #
  67. CONTROL EJECT;
  68. #
  69. * ITEM DEFINITIONS
  70. #
  71.  
  72. ITEM PA I; # PAAC ENTRY ORDINAL #
  73. ITEM SAS I; # SEC AST ENTRY ORDINAL #
  74. ITEM PAS I; # PRI AST ENTRY ORDINAL #
  75. ITEM PAENTRY I; # NUMBER PAAC ENTRIES #
  76. ITEM ASENTRY I; # NUMBER AST ENTRIES #
  77. ITEM MTYP I; # ACCOUNT MESSAGE TYPE #
  78. ITEM WORK I; # SPARE WORK VARIABLE #
  79. ITEM SECAST B; # SEC AST ENTRY INDICATOR #
  80. ITEM MATCH B; # UNDO LOOP INDICATOR #
  81. ITEM RSTAT I; # RETURN STATUS #
  82. ITEM CONNREF B; # CONNECTION REFUSED FLAG #
  83. ITEM SUCCESS B; # SET IF TIMER REQUEST IS O.K.#
  84. ITEM VCBREL B; # RELEASE VCB FLAG #
  85.  
  86. #
  87. ** TMBBUF - TIMER REQUEST BUFFER.
  88. *
  89. * BUFFER FOR GENERATION OF TIMER REQUEST.
  90. #
  91. ARRAY TMBBUF [00:00] S(TMBSIZ$);
  92. BEGIN
  93. ITEM TMB$SMID S:CTQSTAT(00,00,12) = [S"SINA"];
  94. ITEM TMB$WC U(00,48,12) = [TMBSIZ$];
  95. ITEM TMB$ABT U(01,00,06) = [APPCMD];
  96. ITEM TMB$CNUM U(01,18,18);
  97. ITEM TMB$PFCSFC U(02,00,16) = [FCINA];
  98. ITEM TMB$ACN U(02,24,12);
  99. ITEM TMB$DELAY U(03,24,18) = [NETPTIME$];
  100. ITEM TMB$QNUM U(03,42,18);
  101. END
  102.  
  103. #
  104. * THE FOLLOWING ARRAY IS USED FOR DAYFILE-ING WHEN THE REQUEST
  105. * TO CANCEL A TIMER REQUEST FAILS.
  106. #
  107.  
  108. ARRAY EMSG [0:0] S(7);
  109. BEGIN
  110. ITEM MSG$MSG1 C(00,00,30) = ["NVFASPC: CANCEL TIMER REQUEST "];
  111. ITEM MSG$MSG2 C(03,00,20) = ["FAILED (CNUM/PA) -- "];
  112. ITEM MSG$CNUM U(05,00,30);
  113. ITEM MSG$SLSH C(05,30,01) = ["/"];
  114. ITEM MSG$PA U(05,36,24);
  115. ITEM MSG$ZBYT I(06,00,60) = [0];
  116. END
  117.  
  118. $BEGIN
  119. #
  120. ** ASTMSG - MISSING AST ENTRY ERROR MESSAGE.
  121. #
  122. ARRAY ASTMSG [00:00] S(4);
  123. BEGIN
  124. ITEM AMSG$MSG C(00,00,30) =
  125. ["NVFASPC: CANNOT FIND AST ENTRY"];
  126. ITEM AMSG$ZERO U(03,00,60) = [0];
  127. END
  128.  
  129. $END
  130.  
  131. CONTROL EJECT;
  132.  
  133. #
  134. * DETERMINE NUMBER OF AST ENTRIES
  135. #
  136. ASENTRY = (ASTLNGTH/ASTSIZ$);
  137.  
  138. #
  139. * DETERMINE NUMBER OF PAAC ENTRIES
  140. #
  141. PAENTRY = (PACLNGTH/PAACSIZ$);
  142.  
  143. #
  144. * DETERMINE INDEX ORDINAL OF APPLICATION NAMED IN THE NETON
  145. * RESPONSE (EITHER NORMAL OR ABNORMAL)
  146. #
  147. FOR SAS = 0 STEP 1 WHILE
  148. ((SAS LS ASENTRY) AND
  149. (NETAN[0] NQ AST$AN[SAS]) AND
  150. (NETANAM[0] NQ AST$PANAM[SAS]))
  151. DO
  152. BEGIN
  153. END
  154.  
  155. $BEGIN
  156.  
  157. #
  158. * IF AST ENTRY NOT FOUND, SERIOUS PROBLEM SOMEWHERE. ABORT NVF.
  159. #
  160. IF SAS EQ ASENTRY
  161. THEN
  162. BEGIN
  163. MESSAGE(ASTMSG,0);
  164. ABORT;
  165. END
  166.  
  167. $END
  168.  
  169. #
  170. * LOCATE IF NEEDED THE PRIMARY APPLICATION AST ENTRY ORDINAL.
  171. #
  172. SECAST = FALSE;
  173. IF AST$PANAM[SAS] EQ AST$SANAM[SAS]
  174. THEN
  175. BEGIN
  176. PAS = SAS;
  177. END
  178. ELSE
  179. BEGIN
  180. SECAST = TRUE;
  181. MATCH = FALSE;
  182. FOR WORK = 0 STEP 1 WHILE
  183. ((WORK LS ASENTRY) AND
  184. (NOT MATCH))
  185. DO
  186. BEGIN
  187. IF ((AST$PANAM[WORK] EQ AST$SANAM[SAS]) AND
  188. (AST$PANAM[WORK] EQ AST$SANAM[WORK]))
  189. THEN
  190. BEGIN
  191. MATCH = TRUE;
  192. PAS = WORK;
  193. END
  194. END
  195.  
  196. $BEGIN
  197. IF WORK EQ ASENTRY
  198. THEN
  199. BEGIN
  200. MESSAGE(ASTMSG,0);
  201. ABORT;
  202. END
  203. $END
  204. END
  205.  
  206.  
  207. #
  208. * PERFORM OUTER FOR LOOP FOR EACH PAAC ENTRY.
  209. #
  210.  
  211. CONNREF = FALSE;
  212. FOR PA = 0 STEP 1 WHILE
  213. PA LS PAENTRY
  214. DO
  215. BEGIN
  216.  
  217. #
  218. * LOCATE PAAC ENTRIES THAT ARE "PENDING NETON" TO THE APPLICATION
  219. * OF THE NETON RESPONSE.
  220. #
  221.  
  222. IF ((PA$STATE[PA] EQ PAACST"PANETP") AND
  223. (PA$SWAP[PA] EQ AST$SANAM[SAS]))
  224. THEN
  225. BEGIN
  226. #
  227. * CHECK IF NORMAL OR ABNORMAL NETON RESPONSE.
  228. #
  229.  
  230. IF PFCSFC[0] EQ NETONA
  231. THEN
  232. BEGIN
  233.  
  234. #
  235. * NETON ABNORMAL RESPONSE.
  236. * CALL REFCONN TO REFUSE THE CONNECTION.
  237. #
  238. REFCONN;
  239. END
  240.  
  241. ELSE # NETON NORMAL RESPONSE #
  242. BEGIN
  243. #
  244. * NETON NORMAL RESPONSE RECEIVED.
  245. * CALL NVFUCRS TO DETERMINE IF CONNECTION OK, STILL PENDING NETON
  246. * OR UNABLE TO COMPLETE CONNECTION.
  247. #
  248. RSTAT = CONNOK$;
  249. WORK = AACON$;
  250. NVFUCRS(PAS,SAS,RSTAT,WORK);
  251. IF RSTAT EQ CONNOK$
  252. THEN
  253. BEGIN
  254. #
  255. * OK TO MAKE CONNECTION TO APPL AT SAS.
  256. * INCREMENT NUMBER ACTIVE AA CONNECTIONS FOR AST ENTRY.
  257. * ISSUE ACCOUNTING MESSAGE.
  258. * SET PAAC STATE.
  259. * SET UP CR/RAP/N SM AND SEND.
  260. #
  261.  
  262. AST$AACN[SAS] = AST$AACN[SAS] + 1;
  263. IF PA$ICMCN[PA]
  264. THEN
  265. BEGIN
  266. AST$ICCN[SAS] = AST$ICCN[SAS] + 1;
  267. END
  268. IF SAS NQ PAS
  269. THEN
  270. BEGIN
  271. AST$AACN[PAS] = AST$AACN[PAS] + 1;
  272. IF PA$ICMCN[PA]
  273. THEN
  274. BEGIN
  275. AST$ICCN[PAS] = AST$ICCN[PAS] + 1;
  276. END
  277. END
  278. PA$CNTIME[PA] = CTM$PDT[0];
  279. WORK = ABAC$;
  280. NVFAIAM(PA,WORK);
  281. PA$STATE[PA] = PAACST"PARAP";
  282. PA$SWAP[PA] = AST$PANAM[SAS];
  283. PA$SWAPAN[PA] = AST$AN[SAS];
  284. SPMSG0[1] = PA$RAPSM0[PA];
  285. SPMSG1[1] = PA$RAPSM1[PA];
  286. SPMSG2[1] = PA$RAPSM2[PA];
  287. CRICT[1] = CT60TRANS;
  288. RB[1] = TRUE;
  289. CRVCB[1] = PA$VCB[PA];
  290. NVFUMQE(P<CTQ>,APSM[1],APPPR$,0,LCRRAPN);
  291. #
  292. * SET UP AND ISSUE THE CR/SWH/R SM (SWITCH REQUEST).
  293. #
  294. FOR WORK = 0 STEP 1 UNTIL (MSBFNVL - 1)
  295. DO
  296. BEGIN
  297. MSG$WORD[WORK] = 0;
  298. END
  299.  
  300. PFCSFC[0] = CRSWH;
  301. CRNACN[0] = PA$NACN[PA];
  302. CRABL[0] = PA$ABL[PA];
  303. CRDT[0] = PA$DT[PA];
  304. CRSNAME[0] = " ";
  305. CRSWHID[0] = PA$URHID[PA];
  306. CRSWSL[0] = AASECLEV$;
  307. CRSWDBZ[0] = PA$DBZ[PA];
  308. CRSWUBZ[0] = PA$UBZ[PA];
  309. CRSWAN[0] = PA$SWAPAN[PA];
  310. NVFUMQE(P<CTQ>,APSM[0],APPPR$,0,LCRSWH);
  311. PA$STATE[PA] = PAACST"PARAP";
  312. #
  313. * CANCEL TIMER REQUEST.
  314. * CLEAR THE ACN NUMBER AND THE TIMER CANCELLATION NUMBER OF
  315. * THE PAAC ENTRY.
  316. #
  317.  
  318. SSCCTR(PA$CNUM[PA],SUCCESS);
  319.  
  320. $BEGIN
  321. IF NOT SUCCESS
  322. THEN
  323. BEGIN
  324. MSG$CNUM[0] = XCOD(PA$CNUM[PA]);
  325. MSG$PA[0] = XCOD(PA);
  326. MESSAGE(EMSG,0);
  327. END
  328. $END
  329.  
  330. PA$CNUM[PA] = 0;
  331. END
  332. ELSE IF RSTAT EQ NOCONN$ OR
  333. RSTAT EQ MCLIMIT$
  334. THEN
  335. BEGIN
  336. #
  337. * CONNECTION NOT ALLOWED.
  338. * CALL REFCONN TO REFUSE CONNECTION.
  339. #
  340. REFCONN;
  341. END
  342. ELSE
  343. #
  344. * CONNECTION MUST STILL BE PENDING NETON OF NEW SPINOFF COPY.
  345. * SET STATE OF PAAC ENTRY TO PENDING NETON.
  346. * SET UP AND ISSUE TIMER REQUEST FOR CONNECTION.
  347. * SET TIMER CANCELLATION NUMBER OF PAAC ENTRY.
  348. #
  349. BEGIN
  350. PA$STATE[PA] = PAACST"PANETP";
  351. TMB$ACN[0] = PA$NACN[PA];
  352. TMB$QNUM[0] = LOC(P<AAINPQ>);
  353. SSCATR(TMBBUF[0]);
  354. PA$CNUM[PA] = TMB$CNUM[0];
  355. PA$SWAP[PA] = AST$PANAM[PAS];
  356. END
  357. END
  358. END
  359. END
  360. #
  361. * IF A NETON ABNORMAL RESPONSE, MUST CALL NVFSCAD TO PERFORM
  362. * APPLICATION DEPARTURE PROCESSING.
  363. #
  364. IF PFCSFC[0] EQ NETONA
  365. THEN
  366. BEGIN
  367. NVFSCAD(SAS);
  368. IF PAS NQ SAS
  369. THEN
  370. NVFSCAD(PAS);
  371. END
  372.  
  373. #
  374. * CHECK IF ANY CONNECTION WAS REFUSED IN WHICH CASE THE PAAC
  375. * ENTRY SPACE MUST BE RELEASED.
  376. #
  377. IF CONNREF
  378. THEN
  379. BEGIN
  380. PAENTRY = PAENTRY - 1;
  381. VCBREL = TRUE;
  382. FOR PA = PAENTRY STEP -1 WHILE
  383. PA GQ 0
  384. DO
  385. BEGIN
  386. IF ((PA$STATE[PA] EQ PAACST"PAERR") AND
  387. (PA$SWAP[PA] EQ AST$SANAM[SAS]))
  388. THEN
  389. NVFACTC(PA,VCBREL);
  390. END
  391. END
  392.  
  393. RETURN;
  394.  
  395. CONTROL EJECT;
  396. PROC REFCONN;
  397. # TITLE - REFCONN - REFUSE PENDING CONNECTION #
  398. BEGIN # REFCONN #
  399.  
  400. #
  401. ** REFCONN - REFUSE PENDING CONNECTION.
  402. *
  403. * C. BRION 83/04/19.
  404. *
  405. * THE PURPOSE OF THIS INTERNAL PROCEDURE IS TO PERFORM THE
  406. * PROCESSING OF A REFUSED PENDING A-A CONNECTION.
  407. *
  408. * REFCONN
  409. *
  410. * ENTRY:
  411. *
  412. * PA - ENTRY ORDINAL OF PAAC ENTRY.
  413. * SECAST - FLAG INDICATING SECONDARY AST ENTRY.
  414. * SAS - SECONDARY AST ENTRY ORDINAL.
  415. * PAS - PRIMARY AST ENTRY ORDINAL.
  416. * CONNREF - GLOBAL CONNECTION REFUSED FLAG.
  417. #
  418. CONTROL EJECT;
  419.  
  420.  
  421. #
  422. * SET UP AND ISSUE A CR/RAP/A SM FOR THE CONNECTION SINCE A
  423. * NETON ABNORMAL RESPONSE ISSUED.
  424. #
  425. CONNREF = TRUE;
  426. SPMSG0[1] = PA$RAPSM[PA];
  427. EB[1] = TRUE;
  428. CRRRAP[1] = RCRA"ANA";
  429. NVFUMQE(P<CTQ>,APSM[1],APPPR$,0,LCRRAPA);
  430.  
  431. #
  432. * SET UP AND ISSUE ACCOUNTING MESSAGE FOR REFUSED A-A CONNECTION.
  433. #
  434.  
  435. WORK = ABAR$;
  436. NVFAIAM(PA,WORK);
  437.  
  438. #
  439. * SET PAAC STATE TO ERROR.
  440. #
  441.  
  442. PA$STATE[PA] = PAACST"PAERR";
  443.  
  444.  
  445. END # REFCONN #
  446.  
  447. END # NVFASPC #
  448. TERM
cdc/nos2.source/nam5871/nvfaspc.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator