User Tools

Site Tools


cdc:nos2.source:nam5871:nvfcufs

NVFCUFS

Table Of Contents

  • [00008] PROC NVFCUFS
  • [00009] NVFCUFS - UPDATE FLOW STATUS.
  • [00013] UPDATE FLOW STATUS.
  • [00064] PROC ABORT
  • [00065] PROC NVFCFCE
  • [00066] PROC MOVE
  • [00067] PROC SSCCTR
  • [00068] PROC SSSAWR
  • [00069] PROC SSTAQE
  • [00070] PROC SSTATS
  • [00071] PROC SSTRTS
  • [00102] PROC DELDAT
  • [00132] PROC XMITDAT
  • [00178] PROC XMITSM

Source Code

NVFCUFS.txt
  1. *DECK NVFCUFS
  2. USETEXT TEXTSS
  3. USETEXT TXTSUSS
  4. USETEXT TXTAPSS
  5. USETEXT TXTANVF
  6. USETEXT TEXTNVF
  7. USETEXT TXINNVF
  8. PROC NVFCUFS;
  9. # TITLE NVFCUFS - UPDATE FLOW STATUS. #
  10.  
  11. BEGIN # NVFCUFS #
  12. #
  13. ** NVFCUFS - UPDATE FLOW STATUS.
  14. *
  15. * S. H. FISCHER. 81/11/06.
  16. * D. G. DEPEW. 81/12/22.
  17. *
  18. * THIS PROCEDURE PERFORMS ALL THE CONNECTION(C) LAYER PROCESSING
  19. * REQUIRED FOR ALL INBOUND, FLOW CONTROL SUPERVISORY MESSAGES.
  20. *
  21. * PROC NVFCUFS
  22. *
  23. * ENTRY WCBUF[0] = WORD COUNT WORD FROM ORIGINAL CONNECTION
  24. * TRAFFIC QUEUE (*CTQ*) ENTRY.
  25. * ABHBUF[0] = APPLICATION BLOCK HEADER FOR THE SM (BASED
  26. * ARRAY *ABH* IN *TXTAPSS* POINTS HERE).
  27. * MSGBUF[0] = BODY OF THE SM (BASED ARRAY *APSM* IN
  28. * *TXTAPSS* POINTS HERE). THE POSSIBLE PFC/SFC
  29. * VALUES ARE: FC/INIT/R, FC/ACK, FC/NAK,
  30. * FC/BRK, INTR/USR, AND FC/INACT.
  31. *
  32. * EXIT ANY OF THE FOLLOWING IN VARIOUS COMBINATIONS ACCORDING TO
  33. * THE SM RECEIVED AND THE STATE OF THE ACN LIST ENTRY FOR
  34. * THE USER IN QUESTION.
  35. * - THE STATE OF THE ACN LIST ENTRY HAS BEEN UPDATED.
  36. * - AN FC/INIT/N SM HAS BEEN PLACED IN THE OUTGOING TRAFFIC
  37. * QUEUE (*OTQ*).
  38. * - AN FS/RST SM HAS BEEN PLACED IN THE OUTGOING TRAFFIC
  39. * QUEUE (*OTQ*).
  40. * - ONE OR MORE ENTRIES IN THE WAITING BLOCK QUEUE (*WBQ*)
  41. * FOR THE USER IN QUESTION HAVE BEEN TRANSFERRED TO THE
  42. * OUTGOING TRAFFIC QUEUE (*OTQ*)
  43. * - A CR/SWH/R OR CR/TRM/R SM ENQUEUED (IN THE *WBQ*) FOR
  44. * THE USER IN QUESTION HAS BEEN TRANSFERRED TO THE
  45. * OUTGOING TRAFFIC QUEUE (*OTQ*).
  46. * - ALL OUTPUT ENQUEUED (IN THE *WBQ*) FOR THE USER IN
  47. * QUESTION HAS BEEN DISCARDED.
  48. * - AN INTR/USR ENTRY HAS BEEN PLACED IN THE TERMINAL-TO-
  49. * APPLICATION CONNECTION INPUT QUEUE (*TAINPQ*).
  50. * - THE SM HAS BEEN DISCARDED.
  51. *
  52. * NOTE THE PROCESSING IS DEFINED BY THE NVF/USER C-LAYER STATE
  53. * DIAGRAM.
  54. #
  55.  
  56.  
  57.  
  58.  
  59. #
  60. **** PROC NVFCUFS - XREF LIST.
  61. #
  62. XREF
  63. BEGIN
  64. PROC ABORT; # ABORT PROGRAM #
  65. PROC NVFCFCE; # FIND CONNECTION ENTRY #
  66. PROC MOVE; # MOVE BLOCK OF MEMORY #
  67. PROC SSCCTR; # CANCEL TIMER REQUEST #
  68. PROC SSSAWR; # ACCEPT WORKLIST REQUEST #
  69. PROC SSTAQE; # ACCEPT QUEUE ENTRY #
  70. PROC SSTATS; # ALLOCATE TABLE SPACE #
  71. PROC SSTRTS; # REMOVE TABLE SPACE #
  72. END
  73. #
  74. ****
  75. #
  76.  
  77.  
  78.  
  79.  
  80. ITEM I I; # LOOP VARIABLE AND SCRATCH #
  81. ITEM NEWACN B; # TRUE IF ACN NOT FOUND IN ACN LIST #
  82. ITEM AE I; # ORD OF MATCHED (OR NEW) ACN LIST ENTRY #
  83. ITEM ACNN I; # ACN FROM ENTRY WE ARE LOOKING FOR #
  84. ITEM RORD I; # ORDINAL OF ENTRY LOCATED IN *WBQ*/*IWBQ*#
  85. ITEM OORD I; # ORDINAL OF ENTRY POSITION IN *OTQ* #
  86. ITEM SIZ I; # SIZE OF ENTRY BEING MOVED TO *OTQ* #
  87. ITEM SMID I; # INTERNAL SM IDENTIFIER #
  88.  
  89.  
  90.  
  91.  
  92. SWITCH FSSWT:CTQSTAT
  93. LLFCACK: SACK, # FC/ACK #
  94. LLFCBRK: SBRK, # FC/BRK #
  95. LLIUSR: SIUSR, # INTR/USR #
  96. LLFCINA: SINA, # FC/INACT #
  97. LLFCINI: SINIT, # FC/INIT #
  98. LLFCNAK: SNAK, # FC/NAK #
  99. LLBIMRK: SBMRK; # BI/MARK #
  100.  
  101.  
  102. PROC DELDAT;
  103.  
  104. BEGIN # DELDAT #
  105. #
  106. * DELDAT - DELETE SYNCHRONOUS BLOCKS.
  107. *
  108. * THIS EMBEDDED PROC FINDS BLOCKS QUEUED FOR THE ACN IN QUESTION IN
  109. * THE WAITING BLOCK QUEUE AND DELETES THEM FROM THE QUEUE.
  110. *
  111. * PROC DELDAT
  112. #
  113.  
  114. FOR I = 0 WHILE ACN$WBCNT[AE] NQ 0
  115. DO
  116. BEGIN
  117. FOR RORD = RORD STEP WBQ$ESIZE[RORD]
  118. WHILE WBQ$ABHACN[RORD] NQ ACNN
  119. DO
  120. BEGIN
  121. END
  122. SIZ = WBQ$ESIZE[RORD]; # SIZE OF ENTRY TO DELETE #
  123. SSTRTS( P<WBQ>, RORD, SIZ ); # DELETE ENTRY #
  124. ACN$WBCNT[AE] = ACN$WBCNT[AE] - 1;
  125. END
  126.  
  127. END # DELDAT #
  128.  
  129.  
  130.  
  131.  
  132. PROC XMITDAT;
  133.  
  134. BEGIN # XMITDAT #
  135. #
  136. * XMITDAT - TRANSMIT SYNCHRONOUS BLOCKS.
  137. *
  138. * THIS EMBEDDED PROC FINDS BLOCKS QUEUED FOR THE ACN IN QUESTION IN
  139. * THE WAITING BLOCK QUEUE AND MOVES THEM TO THE OUTGOING TRAFFIC
  140. * QUEUE UNTIL THE NUMBER OF UNACKNOWLEDGED SYNCHRONOUS BLOCKS IS
  141. * EQUAL TO THE APPLICATION BLOCK LIMIT.
  142. *
  143. * PROC XMITDAT
  144. #
  145.  
  146.  
  147. FOR I=0 WHILE ACN$WBCNT[AE] NQ 0
  148. AND ACN$BLCNT[AE] LS ACN$ABL[AE]
  149. DO
  150. BEGIN
  151. FOR RORD = RORD STEP WBQ$ESIZE[RORD]
  152. WHILE WBQ$ABHACN[RORD] NQ ACNN
  153. DO
  154. BEGIN END
  155.  
  156. OORD = OTQLNGTH;
  157. SIZ = WBQ$ESIZE[RORD]; # SIZE OF ENTRY TO BE MOVED #
  158. WBQ$ABN[RORD] = ACN$ABN[AE]; # TRANSFER NEXT ABN #
  159. SSTATS( P<OTQ>, SIZ );
  160. MOVE( SIZ, WBQ[RORD], OTQ[OORD] );
  161. SSTRTS( P<WBQ>, RORD, SIZ );
  162.  
  163. IF OORD EQ 0
  164. THEN
  165. SSSAWR( WWDF"SACNI");
  166.  
  167. ACN$ABN[AE] = ACN$ABN[AE] + 1;
  168. ACN$BLCNT[AE] = ACN$BLCNT[AE] + 1;
  169. ACN$WBCNT[AE] = ACN$WBCNT[AE] - 1;
  170. END
  171.  
  172.  
  173. END # XMITDAT #
  174.  
  175.  
  176.  
  177.  
  178. PROC XMITSM;
  179.  
  180. BEGIN # XMITSM #
  181. #
  182. * XMITSM - TRANSMIT ASYNCHRONOUS SUPERVISORY MESSAGE.
  183. *
  184. * THIS EMBEDDED PROC FINDS AN ASYNCHRONOUS SM (EITHER CR/SWH/R OR
  185. * CR/TRM/R) QUEUED FOR THE ACN IN QUESTION IN THE WAITING BLOCK
  186. * QUEUE AND MOVES IT TO THE OUTGOING TRAFFIC QUEUE.
  187. *
  188. * PROC XMITSM
  189. #
  190.  
  191.  
  192. IF (ACN$STATE[AE] EQ ACNST"SWTPEND"
  193. OR ACN$STATE[AE] EQ ACNST"TRMPEND")
  194. AND ACN$BLCNT[AE] EQ 0
  195. THEN
  196. BEGIN
  197. FOR RORD = RORD STEP WBQ$ESIZE[RORD]
  198. WHILE WBQ$ABHACN[RORD] NQ 0
  199. OR WBQ$CRSACN[RORD] NQ ACNN
  200. DO
  201. BEGIN END
  202.  
  203. OORD = OTQLNGTH;
  204. SIZ = WBQ$ESIZE[RORD]; # SIZE OF ENTRY TO BE MOVED #
  205. SSTATS( P<OTQ>, SIZ );
  206. MOVE( SIZ, WBQ[RORD], OTQ[OORD] );
  207. SSTRTS( P<WBQ>, RORD, SIZ );
  208. IF OORD EQ 0
  209. THEN
  210. SSSAWR( WWDF"SACNI" );
  211.  
  212. IF ACN$STATE[AE] EQ ACNST"SWTPEND"
  213. THEN
  214. ACN$STATE[AE] = ACNST"SWSTART";
  215. ELSE
  216. ACN$STATE[AE] = ACNST"ENDED";
  217. END
  218.  
  219.  
  220. END # XMITSM #
  221.  
  222.  
  223.  
  224.  
  225.  
  226. # MAIN PROCEDURE CODE BEGINS HERE #
  227.  
  228. IF WCB$SMID[0] EQ CTQSTAT"SBMRK"
  229. THEN
  230. BEGIN
  231. ACNN = ABHADR[0];
  232. END
  233. ELSE
  234. BEGIN
  235. ACNN = FCACN[0];
  236. END
  237. NVFCFCE( ACNN, AE, NEWACN );
  238.  
  239. SMID = WCB$SMID[0]; # GET INTERNAL SM IDENTIFIER #
  240. IF NEWACN
  241. THEN
  242. BEGIN
  243. IF SMID NQ CTQSTAT"SINA"
  244. THEN
  245. ABORT;
  246. ELSE
  247. GOTO ENDTAS;
  248. END
  249.  
  250.  
  251. RORD = 0;
  252. GOTO FSSWT[SMID];
  253.  
  254.  
  255.  
  256.  
  257.  
  258. LLFCINI:
  259. IF ACN$STATE[AE] NQ ACNST"ENDED"
  260. THEN
  261. BEGIN
  262. ACN$INIT[AE] = TRUE;
  263. PFCSFC[0] = FCINITN;
  264. SSTAQE( P<OTQ>, WCBUF, ABHBUF, MSGBUF );
  265. XMITDAT; # SEND DATA IF ANY #
  266. XMITSM; # SEND SM IF ALL BLOCKS ACKED #
  267. END
  268. GOTO ENDTAS;
  269.  
  270.  
  271.  
  272.  
  273. LLFCINA:
  274.  
  275. #
  276. * IF THE CURRENT STATE OF THE CONNECTION IS TERMINATE PENDING, THEN
  277. * THE CONNECTION IS HUNG. GO AHEAD AND TERMINATE IT.
  278. #
  279.  
  280. IF ACN$STATE[AE] EQ ACNST"TRMPEND" AND
  281. ACN$CNUM[AE] EQ ABHABN[0]
  282. THEN
  283. BEGIN
  284. ACN$BLCNT[AE] = 0; # CLEAR OUTSTANDING BLOCK COUNT #
  285. DELDAT; # DELETE SYNCHRONOUS DATA #
  286. XMITSM; # SEND CR/TRM/R #
  287. END
  288.  
  289. GOTO ENDTAS;
  290.  
  291.  
  292.  
  293.  
  294. LLIUSR:
  295. IF INTRCHR[0] GR RIR"UB2"
  296. THEN # IF THIS IS A USER INTERRUPT #
  297. BEGIN
  298. IF ACN$STATE[AE] NQ ACNST"SWSTART" AND
  299. ACN$STATE[AE] NQ ACNST"ENDED"
  300. THEN # IF A SWITCH OR TERM IS NOT IN PROGRESS, #
  301. BEGIN # SEND AN INTR/RSP SM #
  302. WCB$WORD[1] = LINTR + 2;
  303. ABHWORD[1] = LINTR;
  304. ABHABT[1] = APPCMD;
  305. ABHACT[1] = ACINTR;
  306.  
  307. SPMSG0[1] = 0;
  308. PFCSFC[1] = INTRRSP;
  309. INTRACN[1] = ACNN;
  310.  
  311. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],APSM[1]);
  312. END
  313. END
  314.  
  315. ELSE # MUST BE A USER BREAK #
  316. BEGIN
  317. ACN$BKCNT[AE] = 1;
  318. DELDAT; # DELETE SYNCHRONOUS DATA #
  319.  
  320. IF ACN$STATE[AE] EQ ACNST"ACTIVE" OR
  321. ACN$STATE[AE] EQ ACNST"BRKCMD"
  322. THEN
  323. BEGIN
  324. ACN$STATE[AE] = ACNST"BRKOUT";
  325. SSTAQE( P<TAINPQ>, WCBUF, ABHBUF, MSGBUF );
  326.  
  327. IF ACN$BLKF[AE]
  328. THEN
  329. BEGIN
  330. ACN$BLKF[AE] = FALSE;
  331.  
  332. FOR RORD=0 STEP IWQ$WC[RORD] WHILE ACNN NQ IWQ$ACN[RORD+1]
  333. DO
  334. BEGIN
  335. END
  336.  
  337. SSTRTS(P<IWBQ>,RORD,IWQ$WC[RORD]);
  338. END
  339. END
  340. ELSE
  341. XMITSM; # SEND SM IF ONE #
  342. END
  343. GOTO ENDTAS;
  344.  
  345.  
  346.  
  347.  
  348. LLBIMRK:
  349. IF ACN$STATE[AE] EQ ACNST"CLEARI"
  350. THEN # IF THE CURRENT ACN STATE IS CLEAR INPUT #
  351. BEGIN
  352. WCB$WORD[1] = LINTR + 2;
  353. ABHWORD[1] = LINTR;
  354. ABHABT[1] = APPCMD;
  355. ABHACT[1] = ACINTR;
  356.  
  357. SPMSG0[1] = 0;
  358. PFCSFC[1] = INTRRSP;
  359. INTRACN[1] = ACNN;
  360.  
  361. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],APSM[1]);
  362.  
  363. # SET CURRENT ACN STATE BACK TO ACTIVE #
  364. ACN$STATE[AE] = ACNST"ACTIVE";
  365. ACN$BKCNT[AE] = 0;
  366. END
  367.  
  368. ELSE IF ACN$STATE[AE] EQ ACNST"BRKOUT"
  369. THEN
  370. BEGIN
  371. ACN$BKCNT[AE] = 0;
  372. END
  373.  
  374. GOTO ENDTAS;
  375.  
  376.  
  377.  
  378.  
  379. LLFCACK:
  380. LLFCNAK:
  381. IF ACN$STATE[AE] EQ ACNST"ENDED" OR
  382. ACN$STATE[AE] EQ ACNST"SWSTART"
  383. THEN
  384. GOTO ENDTAS;
  385.  
  386. ACN$BLCNT[AE] = ACN$BLCNT[AE] - 1;
  387. XMITDAT; # SEND DATA IF ANY #
  388.  
  389. #
  390. * IF TERMINATION IS PENDING AND THE CR/TRM/R WILL NOW BE SENT OUT
  391. * THEN CANCEL THE TIMER REQUEST THAT WAS STARTED UP BECAUSE OF BEING
  392. * IN THE PENDING STATE.
  393. #
  394.  
  395. IF ACN$STATE[AE] EQ ACNST"TRMPEND" AND
  396. ACN$BLCNT[AE] EQ 0
  397. THEN
  398. SSCCTR(ACN$CNUM[AE],I);
  399.  
  400. XMITSM; # SEND SM IF ALL BLOCKS ACKED #
  401. GOTO ENDTAS;
  402.  
  403.  
  404.  
  405. LLFCBRK:
  406. IF ACN$STATE[AE] NQ ACNST"SWSTART" AND
  407. ACN$STATE[AE] NQ ACNST"ENDED"
  408. THEN # IF A SWITCH OR TERM IS NOT IN PROGRESS #
  409. BEGIN # SEND AN FC/RST SM #
  410. WCB$WORD[1] = LFCRST + 2;
  411. ABHWORD[1] = LFCRST;
  412. ABHABT[1] = APPCMD;
  413. ABHACT[1] = ACFC;
  414.  
  415. SPMSG0[1] = 0;
  416. PFCSFC[1] = FCRST;
  417. FCACN[1] = ACNN;
  418.  
  419. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],APSM[1]);
  420. END
  421. GOTO ENDTAS;
  422.  
  423.  
  424.  
  425. ENDTAS:
  426. END # NVFCUFS #
  427. TERM
cdc/nos2.source/nam5871/nvfcufs.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator