User Tools

Site Tools


cdc:nos2.source:nam5871:cscufs

CSCUFS

Table Of Contents

  • [00005] PROC CSCUFS
  • [00006] CSCUFS - UPDATE FLOW STATUS.
  • [00010] UPDATE FLOW STATUS.
  • [00055] PROC CSCPNQ
  • [00056] PROC MOVE
  • [00057] PROC SSSAWR
  • [00058] PROC SSTAQE
  • [00059] PROC SSTATS
  • [00060] PROC SSTRTS
  • [00086] PROC XMITNQ

Source Code

CSCUFS.txt
  1. *DECK CSCUFS
  2. USETEXT TEXTCS
  3. USETEXT TEXTSS
  4. USETEXT TXTAPSS
  5. PROC CSCUFS;
  6. # TITLE CSCUFS - UPDATE FLOW STATUS. #
  7.  
  8. BEGIN # CSCUFS #
  9. #
  10. ** CSCUFS - UPDATE FLOW STATUS.
  11. *
  12. * D. G. DEPEW. 82/06/04.
  13. *
  14. * THIS PROCEDURE PERFORMS ALL THE CONNECTION(C) LAYER PROCESSING
  15. * REQUIRED FOR ALL INBOUND, FLOW CONTROL SUPERVISORY MESSAGES.
  16. *
  17. * PROC CSCUFS
  18. *
  19. * ENTRY WCBUF[0] = WORD COUNT WORD FROM ORIGINAL CONNECTION
  20. * TRAFFIC QUEUE (*CNQ*) ENTRY.
  21. * ABHBUF[0] = APPLICATION BLOCK HEADER FOR THE SM (BASED
  22. * ARRAY *ABH* IN *TXTAPSS* POINTS HERE).
  23. * MSGBUF[0] = BODY OF THE SM (BASED ARRAY *APSM* IN
  24. * *TXTAPSS* POINTS HERE). THE POSSIBLE PFC/SFC
  25. * VALUES ARE: FC/INIT/R, FC/ACK, FC/NAK,
  26. * FC/BRK, AND FC/INACT.
  27. *
  28. * EXIT ANY OF THE FOLLOWING IN VARIOUS COMBINATIONS ACCORDING TO
  29. * THE SM RECEIVED AND THE STATE OF THE ACN LIST ENTRY FOR
  30. * THE NOP IN QUESTION.
  31. * - THE STATE OF THE ACN LIST ENTRY HAS BEEN UPDATED.
  32. * - AN FC/INIT/N OR AN FC/RST SM HAS BEEN PLACED IN THE
  33. * OUTGOING TRAFFIC QUEUE (*OTQ*).
  34. * - AN FC/INACT ENTRY HAS BEEN PLACED IN THE PROTOCOL EVENT
  35. * QUEUE (*PEQ*).
  36. * - ONE OR MORE ENTRIES IN THE WAITING BLOCK QUEUE (*WBQ*)
  37. * FOR THE NOP IN QUESTION HAVE BEEN TRANSFERRED TO THE
  38. * OUTGOING TRAFFIC QUEUE (*OTQ*)
  39. * - ALL OUTPUT ENQUEUED (IN THE *WBQ*) FOR THE NOP IN
  40. * QUESTION HAS BEEN DISCARDED.
  41. * - A TERMINAL TEXT ENTRY HAS BEEN PLACED IN THE CONNECTION
  42. * TRAFFIC QUEUE (*CNQ*).
  43. * - AN FC/BRK ENTRY HAS BEEN PLACED IN THE OPERATOR TYPEIN
  44. * QUEUE (*OPTQ*).
  45. *
  46. * NOTE THE PROCESSING IS DEFINED BY THE CS/NOP C-LAYER STATE
  47. * DIAGRAM.
  48. #
  49.  
  50. #
  51. **** PROC CSCUFS - XREF LIST.
  52. #
  53. XREF
  54. BEGIN
  55. PROC CSCPNQ; # PURGE NOP QUEUE #
  56. PROC MOVE; # MOVE STORAGE DIRECT ADDRESSING #
  57. PROC SSSAWR; # ACCEPT WORKLIST REQUEST #
  58. PROC SSTAQE; # ACCEPT QUEUE ENTRY #
  59. PROC SSTATS; # ALLOCATE TABLE SPACE #
  60. PROC SSTRTS; # REMOVE TABLE SPACE #
  61. END
  62. #
  63. ****
  64. #
  65.  
  66.  
  67. DEF ODTLW$ #2#; # *OUTPUT DISCARDED..* TEXT LEN IN WORDS #
  68.  
  69.  
  70. ITEM NACN; # NOP ACN = ORDINAL OF ACN LIST ENTRY #
  71. ITEM MSGBLOC B; # TRUE IF *MSG* BLOCK IN *WBQ* #
  72.  
  73.  
  74. ARRAY DISCARD [00:00] S(ODTLW$);
  75. BEGIN
  76. ITEM D$TEXT C(00,00,18) = ["OUTPUT DISCARDED.."];
  77. ITEM D$ZERO U(01,48,12) = [0];
  78. END
  79.  
  80.  
  81.  
  82.  
  83.  
  84. CONTROL EJECT;
  85.  
  86. PROC XMITNQ;
  87.  
  88. BEGIN # XMITNQ #
  89. #
  90. * XMITNQ - TRANSMIT NOP QUEUE.
  91. *
  92. * THIS EMBEDDED PROC FINDS BLOCKS QUEUED FOR THE NOP IN QUESTION IN
  93. * THE WAITING BLOCK QUEUE (*WBQ*) AND MOVES THEM TO THE OUTGOING
  94. * TRAFFIC QUEUE (*OTQ*) UNTIL THE NUMBER OF UNACKNOWLEDGED BLOCKS
  95. * IS EQUAL TO THE APPLICATION BLOCK LIMIT, OR THE *WBQ* ENTRIES ARE
  96. * EXHAUSTED FOR THIS NOP.
  97. *
  98. * PROC XMITNQ
  99. *
  100. * ENTRY 1. THE *WBQ* CONTAINS ZERO OR MORE ENTRIES FOR THE NOP
  101. * IN QUESTION.
  102. * 2. THE ACN LIST ENTRY FOR THE NOP CONTAINS ALL REQUIRED
  103. * INFORMATION - NAMELY, THE COUNT OF *WBQ* ENTRIES, THE
  104. * COUNT OF OUTSTANDING BLOCKS AND THE APPLICATION BLOCK
  105. * LIMIT FOR THE CONNECTION.
  106. *
  107. * EXIT 1. ZERO OR MORE ENTRIES, FOR THE NOP IN QUESTION, HAVE
  108. * BEEN REMOVED FROM THE *WBQ* AND PLACED IN THE *OTQ*.
  109. * 2. THE COUNTS OF WAITING BLOCKS AND UNACKNOWLEDGED BLOCKS
  110. * HAVE BEEN UPDATED APPROPRIATELY.
  111. *
  112. * NOTE NOP ENTRIES IN THE *WBQ* ARE ALREADY IN CORRECT NETWORK
  113. * BLOCK FORMAT, AND MAY BE MOVED TO THE *OTQ* UNCHANGED.
  114. #
  115.  
  116.  
  117. ITEM I; # LOOP INDUCTION VARIABLE #
  118. ITEM SIZ; # ENTRY SIZE #
  119. ITEM OORD; # OUTGOING TRAFFIC QUEUE ORDINAL #
  120. ITEM WORD; # WAITING BLOCK QUEUE ORDINAL #
  121.  
  122.  
  123. WORD = 0;
  124. FOR I=0 WHILE ACN$WBCNT[NACN] NQ 0
  125. AND ACN$BLCNT[NACN] LS ACN$ABL[NACN]
  126. DO # MOVE BLOCKS #
  127. BEGIN
  128. FOR WORD = WORD STEP WBQ$ESIZE[WORD]
  129. WHILE WBQ$ABHACN[WORD] NQ NACN
  130. DO # FIND NOP'S ENTRY #
  131. BEGIN END
  132.  
  133. OORD = OTQL; # WHERE *OTQ* ENTRY WILL BE #
  134. SIZ = WBQ$ESIZE[WORD]; # SIZE OF ENTRY TO BE MOVED #
  135. SSTATS (P<OTQ>, SIZ); # MAKE ROOM #
  136. MOVE (SIZ, WBQ[WORD], OTQ[OORD]);
  137. SSTRTS (P<WBQ>, WORD, SIZ); # DELETE WAITING BLOCK #
  138.  
  139. IF OORD EQ 0
  140. THEN # FIRST ENTRY IN *OTQ* #
  141. SSSAWR(CSWDF"SACNI");
  142.  
  143. ACN$BLCNT[NACN] = ACN$BLCNT[NACN] + 1; # OUTSTANDING BLOCKS #
  144. ACN$WBCNT[NACN] = ACN$WBCNT[NACN] - 1; # WAITING BLOCKS #
  145. END
  146.  
  147.  
  148. END # XMITNQ #
  149.  
  150.  
  151.  
  152.  
  153.  
  154. CONTROL EJECT;
  155.  
  156. #
  157. * MAIN ROUTINE BEGINS HERE.
  158. *
  159. * SAVE THE ACN NUMBER AND EXECUTE A CASE CONSTRUCT TO PROCESS THE
  160. * FIVE TYPES OF INCOMING SM'S. REFORMAT THE ABH FOR THE I-LAYER.
  161. #
  162. ABHWORD[1] = 0;
  163.  
  164. IF WCB$SMID[0] EQ SMID"BIMARK"
  165. THEN
  166. BEGIN
  167. NACN = ABHADR[0];
  168. ABHADR[1] = NACN;
  169. END
  170. ELSE
  171. BEGIN
  172. ABHADR[1] = FCACN[0];
  173. NACN = FCACN[0];
  174. END
  175.  
  176.  
  177.  
  178. IF WCB$SMID[0] EQ SMID"FCINIT"
  179. THEN # CONNECTION INITIALIZED #
  180. BEGIN
  181.  
  182.  
  183. #
  184. * MARK THE CONNECTION AS INITIALIZED, ISSUE THE FC/INIT/N SM, AND
  185. * OUTPUT ANY BLOCKS QUEUED (IN THE *WBQ*) FOR THIS NOP.
  186. #
  187. ACN$INIT[NACN] = TRUE;
  188. PFCSFC[0] = FCINITN;
  189. SSTAQE (P<OTQ>, WCBUF[0], ABHBUF[0], MSGBUF[0]);
  190. XMITNQ;
  191.  
  192. END # FC/INIT #
  193.  
  194.  
  195.  
  196. ELSE IF WCB$SMID[0] EQ SMID"FCACK"
  197. OR WCB$SMID[0] EQ SMID"FCNAK"
  198. THEN # A BLOCK HAS BEEN ACKNOWLEDGED #
  199. BEGIN
  200.  
  201.  
  202. #
  203. * NOTE THAT WE TREAT A BLOCK NOT DELIVERED MESSAGE THE SAME AS A
  204. * BLOCK DELIVERED. THAT IS, CS DOES NOT ATTEMPT ANY RECOVERY OF
  205. * LOST BLOCKS. THIS IS BECAUSE LOST BLOCKS ARE, IN PRACTICE,
  206. * EXTREMELY RARE. IF THE CONNECTION IS ACTIVE OR A COMMAND IS IN
  207. * PROGRESS, DECREMENT THE OUTSTANDING BLOCK COUNT AND OUTPUT THE
  208. * NEXT QUEUED (IN THE *WBQ*) BLOCK (IF THERE IS ONE). OTHERWISE,
  209. * IGNORE THE SM.
  210. #
  211. IF ACN$NOPST[NACN] EQ S"ACTIVE"
  212. OR ACN$NOPST[NACN] EQ S"COMMAND"
  213. OR ACN$NOPST[NACN] EQ S"BREAK"
  214. OR ACN$NOPST[NACN] EQ S"CLEARI"
  215. THEN # CONNECTION IS OK FOR OUTPUT #
  216. BEGIN
  217. ACN$BLCNT[NACN] = ACN$BLCNT[NACN] - 1;
  218. XMITNQ;
  219. END
  220.  
  221. END # FC/ACK, FC/NAK #
  222.  
  223.  
  224.  
  225. ELSE IF WCB$SMID[0] EQ SMID"INTRUSR"
  226. THEN # NOP ENTERED A USER BREAK #
  227. BEGIN
  228.  
  229. #
  230. * IF THIS IS JUST A USER INTERUPT AND NOT A USER BREAK, THEN SEND
  231. * A INTR/RSP SM IN RESPONSE.
  232. #
  233. IF INTRCHR[0] GR RIR"UB2"
  234. THEN
  235. BEGIN
  236. WCB$WORD[1] = LINTR + 2;
  237. ABHWORD[1] = LINTR;
  238. ABHABT[1] = APPCMD;
  239. ABHACT[1] = CT60TRANS;
  240.  
  241. SPMSG0[1] = 0;
  242. PFCSFC[1] = INTRRSP;
  243. INTRACN[1] = INTRACN[0];
  244.  
  245. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],APSM[1]);
  246. END
  247.  
  248. #
  249. * RELEASE ALL OUTPUT QUEUED (IN THE *WBQ*) FOR THIS NOP (IF ANY).
  250. * CLEAR THE OUTSTANDING BLOCK COUNT.
  251. * SEND A RO/MARK SM ON THE CONNECTION TO ALLOW OUT TO RESUME.
  252. * IF THE CONNECTION IS ACTIVE AND THERE WAS NO *MSG* BLOCK QUEUED
  253. * ENQUEUE A TERMINAL TEXT ENTRY (*CNQ*) CONTAINING THE MESSAGE
  254. * *OUTPUT DISCARDED..* WITHOUT INPUT ALLOWED. IF THERE WAS AN
  255. * *MSG* BLOCK QUEUED, THE *OUTPUT DISCARDED* MESSAGE MUST BE OF
  256. * TYPE *MSG* TO TURN AROUND THE HALF-DUPLEX MODE AND TO STAY IN
  257. * SYNCH WITH NIP. TO ACCOMPLISH THIS WE ENQUEUE (IN THE *CNQ*)
  258. * A TERMINAL TEXT ENTRY WITH INPUT ALLOWED AND CHANGE THE STATE
  259. * TO BREAK IN PROGRESS. THIS WILL CAUSE THE OUTBOUND TEXT
  260. * PROCESSOR (*CSCPNT*) TO GENERATE THE FC/RST FOLLOWED BY THE
  261. * CORRECT MESSAGES. IF A COMMAND IS IN PROGRESS, SEND THE BREAK
  262. * TO THE I-LAYER AS AN OPERATOR TYPEIN (*OPTQ*).
  263. #
  264. ELSE
  265. BEGIN
  266. CSCPNQ (NACN, MSGBLOC); # DELETE NOP'S OUTPUT (IF ANY) #
  267.  
  268. IF ACN$NOPST[NACN] EQ S"ACTIVE" OR
  269. ACN$NOPST[NACN] EQ S"COMMAND"
  270. THEN
  271. BEGIN # SEND RO/MARK SM #
  272. WCB$WORD[1] = 3;
  273. ABHWORD[1] = LROMARK;
  274. ABHABT[1] = APPCMD;
  275. ABHADR[1] = INTRACN[0];
  276. ABHACT[1] = CT8ASCII;
  277.  
  278. SPMSG0[1] = 0;
  279. PFCSFC[1] = ROMARK;
  280.  
  281. IF ACN$BLCNT[NACN] LS ACN$ABL[NACN]
  282. THEN
  283. BEGIN
  284. ABHABN[1] = ACN$ABN[NACN];
  285. ACN$ABN[NACN] = ACN$ABN[NACN] + 1;
  286. ACN$BLCNT[NACN] = ACN$BLCNT[NACN] + 1;
  287. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],APSM[1]);
  288. END
  289.  
  290. ELSE
  291. BEGIN
  292. ABHABN[1] = ACN$ABN[NACN];
  293. ACN$ABN[NACN] = ACN$ABN[NACN] + 1;
  294. ACN$WBCNT[NACN] = ACN$WBCNT[NACN] + 1;
  295. SSTAQE(P<WBQ>,WCBUF[1],ABH[1],APSM[1]);
  296. END
  297. END
  298.  
  299. IF ACN$NOPST[NACN] EQ S"ACTIVE"
  300. THEN # BREAK UNSOLICITED STATUS RPTS #
  301. BEGIN
  302. WCB$WORD[1] = ODTLW$ + 2; # TERM TEXT NTRY SIZ, IAF=FALSE #
  303. WCB$SMID[1] = SMID"TTEXT";
  304.  
  305. IF MSGBLOC
  306. THEN # MUST TURN AROUND HALF DUPLEX #
  307. BEGIN
  308. WCB$IAF[1] = TRUE;
  309. ACN$NOPST[NACN] = S"BREAK";
  310. END
  311. ELSE # SET BREAK FLAG TO INDICATE A #
  312. BEGIN # BREAK OCCURRED WHILE IN THE #
  313. ABHBRK[1] = 1; # ACTIVE STATE. #
  314. ACN$NOPST[NACN] = S"CLEARI";
  315. END
  316.  
  317. SSTAQE (P<CNQ>, WCBUF[1], ABHBUF[1], DISCARD);
  318. END
  319.  
  320. ELSE # BREAK COMMAND IN PROGRESS #
  321. BEGIN
  322. WCB$WORD[1] = 2; # MINIMUN QUEUE ENTRY SIZE #
  323. ABHBRK[1] = 1;
  324. SSTAQE(P<OPTQ>, WCBUF[1], ABHBUF[1], MSGBUF[0]);
  325. ACN$NOPST[NACN] = S"BREAK";
  326. END
  327.  
  328. END
  329. END # FC/BRK #
  330.  
  331. #
  332. * IF THIS MESSAGE IS A BREAK MARKER, THEN SEND A INTR/RSP FOR THE
  333. * CONNECTION TO ALLOW ANOTHER BREAK AND SET THE STATE OF THE CONNEC-
  334. * TION TO ACTIVE.
  335. #
  336. ELSE IF WCB$SMID[0] EQ SMID"BIMARK"
  337. THEN
  338. BEGIN
  339. IF ACN$NOPST[NACN] EQ S"BREAK" OR
  340. ACN$NOPST[NACN] EQ S"CLEARI"
  341. THEN
  342. BEGIN
  343. WCB$WORD[1] = LINTR + 2;
  344. ABHWORD[1] = LINTR;
  345. ABHABT[1] = APPCMD;
  346. ABHACT[1] = CT60TRANS;
  347.  
  348. SPMSG0[1] = 0;
  349. PFCSFC[1] = INTRRSP;
  350. INTRACN[1] = NACN;
  351.  
  352. SSTAQE(P<OTQ>,WCBUF[1],ABH[1],APSM[1]);
  353.  
  354. ACN$NOPST[NACN] = S"ACTIVE";
  355. END
  356. END
  357.  
  358.  
  359. ELSE # MUST BE CONNECTION INACTIVE #
  360. BEGIN
  361.  
  362.  
  363. #
  364. * RELEASE ALL OUTPUT QUEUED FOR THIS NOP AND FORWARD THE FC/INACT
  365. * TO THE I-LAYER (AS PROTOCOL EVENT).
  366. #
  367. CSCPNQ (NACN, MSGBLOC); # DELETE NOP'S OUTPUT (IF ANY) #
  368.  
  369. IF ACN$NOPST[NACN] EQ S"ACTIVE"
  370. OR ACN$NOPST[NACN] EQ S"COMMAND"
  371. THEN
  372. SSTAQE (P<PEQ>, WCBUF[0], ABHBUF[1], MSGBUF[0]);
  373.  
  374. END # FC/INACT #
  375.  
  376. END # CSCUFS #
  377.  
  378. TERM
cdc/nos2.source/nam5871/cscufs.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator