User Tools

Site Tools


cdc:nos2.source:nam5871:cscbpa

CSCBPA

Table Of Contents

  • [00005] PROC CSCBPA
  • [00006] CSCBPA - BEGIN PROTOCOL ACTION.
  • [00010] BEGIN PROTOCOL ACTION.
  • [00049] PROC CSCPNQ
  • [00050] PROC SSTAQE
  • [00066] FUNC CSIDLE B

Source Code

CSCBPA.txt
  1. *DECK CSCBPA
  2. USETEXT TEXTCS
  3. USETEXT TEXTSS
  4. USETEXT TXTAPSS
  5. PROC CSCBPA;
  6. # TITLE CSCBPA - BEGIN PROTOCOL ACTION. #
  7.  
  8. BEGIN # CSCBPA #
  9. #
  10. ** CSCBPA - BEGIN PROTOCOL ACTION.
  11. *
  12. * D. G. DEPEW. 82/06/01.
  13. *
  14. * THIS PROCEDURE PERFORMS ALL THE CONNECTION(C) LAYER PROCESSING
  15. * REQUIRED FOR ALL INBOUND, CONNECTION/NOP RELATED SUPERVISORY
  16. * MESSAGES.
  17. *
  18. * PROC CSCBPA
  19. *
  20. * ENTRY WCBUF[0] = WORD COUNT WORD FROM ORIGINAL CONNECTION
  21. * TRAFFIC QUEUE (*CNQ*) ENTRY
  22. * ABHBUF[0] = APPLICATION BLOCK HEADER FOR THE SM (BASED
  23. * ARRAY *ABH* IN *TXTAPSS* POINTS HERE).
  24. * MSGBUF[0] = BODY OF THE SM (BASED ARRAY *APSM* IN
  25. * *TXTAPSS* POINTS HERE). THE POSSIBLE PFC/SFC
  26. * VALUES ARE: CON/REQ/R, CON/CB, CON/END/N,
  27. * TCH/TCHAR, AND SHUT/INSD.
  28. *
  29. * EXIT ANY OF THE FOLLOWING IN VARIOUS COMBINATIONS ACCORDING TO
  30. * THE SM RECEIVED AND THE STATE OF THE ACN LIST ENTRY FOR
  31. * THE NOP IN QUESTION.
  32. * - THE STATE OF THE ACN LIST ENTRY HAS BEEN UPDATED.
  33. * - AN ENTRY HAS BEEN PLACED IN THE OUTGOING TRAFFIC QUEUE
  34. * (*OTQ*).
  35. * - AN ENTRY HAS BEEN PLACED IN THE PROTOCOL EVENT QUEUE
  36. * (*PEQ*).
  37. * - ALL OUTPUT ENQUEUED (IN THE *WBQ*) FOR THE NOP IN
  38. * QUESTION HAS BEEN DISCARDED.
  39. *
  40. * NOTE THE PROCESSING IS DEFINED BY THE CS/NOP C-LAYER STATE
  41. * DIAGRAM.
  42. #
  43.  
  44. #
  45. **** PROC CSCBPA - XREF LIST.
  46. #
  47. XREF
  48. BEGIN
  49. PROC CSCPNQ; # PURGE NOP QUEUE #
  50. PROC SSTAQE; # ACCEPT QUEUE ENTRY #
  51. END
  52. #
  53. ****
  54. #
  55.  
  56.  
  57. ITEM NACN; # NOP ACN = ORDINAL OF ACN LIST ENTRY #
  58. ITEM DUM;
  59.  
  60.  
  61.  
  62.  
  63.  
  64. CONTROL EJECT;
  65.  
  66. FUNC CSIDLE B;
  67.  
  68. BEGIN # CSIDLE #
  69. #
  70. * CSIDLE - DETERMINE IF CS IS IDLE.
  71. *
  72. * THIS EMBEDDED FUNCTION DETERMINES WHETHER CS CURRENTLY HAS ANY
  73. * CONNECTED NPU OPERATORS. THE PROGRAM IS CONSIDERED TO BE IDLE
  74. * (FOR SHUTDOWN PURPOSES ONLY) IF THERE ARE NONE.
  75. *
  76. * FUNC CSIDLE B
  77. *
  78. * ENTRY NONE.
  79. *
  80. * EXIT CSIDLE = TRUE, IF CS HAS NO NOP (TERMINAL) CONNECTIONS.
  81. * CSIDLE = FALSE, IF CS HAS NOP (TERMINAL) CONNECTIONS.
  82. #
  83.  
  84. ITEM I; # LOOP INDUCTION VARIABLE #
  85.  
  86.  
  87.  
  88. #
  89. * SEARCH ACN LIST FOR AN ACTIVE NOP (STATE OF ACN NOT EQUAL ZERO).
  90. * IF THERE IS AT LEAST ONE NOP PRESENT, CS IS STILL BUSY.
  91. #
  92. FOR I=MINACN$ STEP 1
  93. WHILE ACN$NOPST[I] EQ S"INACT"
  94. AND I LQ MAXACN$
  95. DO # FIND FIRST ACTIVE NOP #
  96. BEGIN END
  97.  
  98. IF I GR MAXACN$
  99. THEN # NO NOP"S #
  100. CSIDLE = TRUE;
  101. ELSE # AT LEAST ONE NOP #
  102. CSIDLE = FALSE;
  103.  
  104. END # CSIDLE #
  105.  
  106.  
  107.  
  108.  
  109.  
  110. CONTROL EJECT;
  111.  
  112. #
  113. * MAIN ROUTINE BEGINS HERE.
  114. *
  115. * SAVE ACN NUMBER AND REFORMAT THE ABH FOR THE I-LAYER. EXECUTE A
  116. * CASE CONSTRUCT TO PROCESS THE FIVE TYPES OF INCOMING SM"S.
  117. #
  118. ABHWORD[1] = 0;
  119. ABHADR[1] = CONACN[0];
  120. NACN = CONACN[0];
  121.  
  122.  
  123.  
  124. IF WCB$SMID[0] EQ SMID"CONREQ"
  125. THEN # TERM USER WANTS TO BE A NOP #
  126. BEGIN
  127.  
  128.  
  129. #
  130. * REJECT THE CON/REQ/R IF IT IS NOT FOR A CONSOLE DEVICE.
  131. * OTHERWISE SEND THE CON/REQ/R TO THE I-LAYER (AS PROTOCOL EVENT),
  132. * UPDATE THE STATE AND INITIALIZE THE ACN LIST ENTRY.
  133. #
  134. IF COND[0] NQ 0
  135. THEN # UNACCEPTABLE DEVICE FOR CS #
  136. BEGIN # ISSUE CON/REQ/A #
  137. WCB$WORD[0] = LCORQR + 2; # ENTRY SIZE #
  138. ABHTLC[0] = LCORQR; # TEXT LENGTH, ABH DONE #
  139. SPMSG0[0] = 0;
  140. PFCSFC[0] = CONREQA; # PFC/SFC #
  141. CONACN[0] = NACN; # SM BODY COMPLETE #
  142. SSTAQE (P<OTQ>, WCBUF[0], ABHBUF[0], MSGBUF[0]);
  143. END
  144.  
  145. ELSE # CONSOLE #
  146. BEGIN
  147. ACN$NOPST[NACN] = S"CREATE"; # STATE #
  148. ACN$ABN[NACN] = 1; # FIRST BLOCK NUMBER #
  149. ACN$DBZ[NACN] = CONDBZ[0]; # RECOMMENDED BLOCK SIZE #
  150. ACN$ABL[NACN] = CONABL[0]; # BLOCK LIMIT - *ACN* DONE #
  151. SSTAQE (P<PEQ>, WCBUF[0], ABHBUF[1], MSGBUF[0]); # TO I-LAY #
  152. END
  153.  
  154. END # CON/REQ/R #
  155.  
  156.  
  157.  
  158. ELSE IF WCB$SMID[0] EQ SMID"CONCB"
  159. THEN # NOP'S CONNECTION IS BROKEN #
  160. BEGIN
  161.  
  162.  
  163. #
  164. * RELEASE ALL OUTPUT QUEUED (IN THE *WBQ*) FOR THIS NOP (IF ANY).
  165. * IF THE NOP'S ACN IS IN THE *ACTIVE* STATE, SEND A CON/CB
  166. * PROTOCOL EVENT TO THE I-LAYER. IF THERE IS A COMMAND IN
  167. * PROGRESS, SEND A CON/CB-WARNING PROTOCOL EVENT TO THE I-LAYER
  168. * (CON/CB WILL BE SENT WHEN THE COMMAND IS CLEANED UP). IGNORE
  169. * THE CON/CB IF CONNECTION TERMINATION HAS ALREADY BEGUN. UPDATE
  170. * THE ACN STATE.
  171. #
  172. CSCPNQ (NACN, DUM); # DELETE NOP'S OUTPUT (IF ANY) #
  173.  
  174. IF ACN$NOPST[NACN] EQ S"ACTIVE"
  175. OR ACN$NOPST[NACN] EQ S"COMMAND"
  176. OR ACN$NOPST[NACN] EQ S"CLEARI"
  177. THEN # MUST SEND P.E. TO I-LAYER #
  178. BEGIN
  179. IF ACN$NOPST[NACN] EQ S"COMMAND"
  180. THEN
  181. WCB$SMID[0] = SMID"CONCBW";
  182. SSTAQE (P<PEQ>, WCBUF[0], ABHBUF[1], MSGBUF[0]); # TO I-LAY #
  183. END
  184.  
  185. IF ACN$NOPST[NACN] NQ S"ENDED"
  186. THEN
  187. ACN$NOPST[NACN] = S"BROKEN";
  188.  
  189. END # CON/CB #
  190.  
  191.  
  192.  
  193. ELSE IF WCB$SMID[0] EQ SMID"CONENDN"
  194. THEN # CONNECTION TERMINATION DONE #
  195. BEGIN
  196.  
  197.  
  198. #
  199. * CLEAR THE ACN LIST ENTRY. IF SHUTDOWN IS IN PROGRESS AND THERE
  200. * ARE NO LONGER ANY CONNECTED NOPS, SEND A FORCED SHUTDOWN
  201. * PROTOCOL EVENT TO THE I-LAYER.
  202. #
  203. ACN$WORD0[NACN] = 0;
  204. ACN$WORD1[NACN] = 0;
  205. ACN$ACN[NACN] = NACN; # LV AS AFTER CS INITIALIZATION #
  206.  
  207. IF CSSTATE AND CSIDLE
  208. THEN # IDLE DOWN AND NO NOPS #
  209. BEGIN # FORMAT SHUT/INSD #
  210. WCB$WORD[0] = LSHUT + 2; # ENTRY SIZE #
  211. WCB$SMID[0] = SMID"SHUINS";
  212. ABHWORD[1] = 0; # NO REAL ABH NEEDED #
  213. SPMSG0[0] = 1; # IMI SHUT FLG, P.E. DONE #
  214. SSTAQE (P<PEQ>, WCBUF[0], ABHBUF[1], MSGBUF[0]); # TO I-LAY #
  215. END
  216.  
  217. END # CON/END/N #
  218.  
  219.  
  220.  
  221. ELSE IF WCB$SMID[0] EQ SMID"TCHTCH"
  222. THEN # NOP CHANGED TERM'S TC,PW,PL #
  223. BEGIN
  224.  
  225.  
  226. #
  227. * SEND TERMINAL CHARACTERISTICS TO I-LAYER ONLY IF WE HAVE NOT
  228. * INITIATED CONNECTION TERMINATION.
  229. #
  230. IF ACN$NOPST[NACN] NQ S"ENDED"
  231. THEN
  232. SSTAQE (P<PEQ>, WCBUF[0], ABHBUF[1], MSGBUF[0]);
  233.  
  234. END # TCH/TCHAR #
  235.  
  236.  
  237.  
  238. ELSE IF WCB$SMID[0] EQ SMID"SHUINS"
  239. THEN # CS SHOULD SHUT DOWN #
  240. BEGIN
  241.  
  242.  
  243. #
  244. * SET THE STATE OF CS TO SHUTDOWN IN PROGRESS. IF THERE ARE
  245. * CURRENTLY NO NOPS CONNECTED, CS WILL ACT AS IF THIS IS AN
  246. * IMMEDIATE SHUTDOWN REQUEST REGARDLESS OF WHICH TYPE OF SHUTDOWN
  247. * WAS ACTUALLY ENTERED.
  248. #
  249. CSSTATE = TRUE; # EQUALS SHUTDOWN IN PROGRESS #
  250. IF CSIDLE
  251. THEN
  252. SPMSG0[0] = 1; # SET IMMEDIATE SHUTDOWN #
  253. SSTAQE (P<PEQ>, WCBUF[0], ABHBUF[1], MSGBUF[0]); # TO I-LAYR #
  254.  
  255. END # SHUT/INSD #
  256.  
  257. END # CSCBPA #
  258.  
  259. TERM
cdc/nos2.source/nam5871/cscbpa.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator