User Tools

Site Tools


cdc:nos2.source:nam5871:nvfctrm

NVFCTRM

Table Of Contents

  • [00007] PROC NVFCTRM(NORMTRM, SENT)
  • [00010] PROCESS CR/TRM SUPERVISORY MESSAGE (FROM NVF TO NIP)
  • [00068] PROC NVFCFCE
  • [00069] PROC SSCATR
  • [00070] PROC SSTAQE
  • [00071] PROC SSTRTS
  • [00087] TRBBUF - TIMER REQUEST BUFFER.

Source Code

NVFCTRM.txt
  1. *DECK NVFCTRM
  2. USETEXT TEXTNVF
  3. USETEXT TEXTSS
  4. USETEXT TXSMNVF
  5. USETEXT TXTANVF
  6. USETEXT TXTAPSS
  7. PROC NVFCTRM(NORMTRM, SENT);
  8. BEGIN # NVFCTRM #
  9. #
  10. ** NVFCTRM - PROCESS CR/TRM SUPERVISORY MESSAGE (FROM NVF TO NIP)
  11. *
  12. * P. A. MURRAY 84/09/24
  13. *
  14. * THIS PROCEDURE PERFORMS ALL THE CONNECTION (C) LAYER PROCESSING
  15. * REQUIRED FOR THE CR/TRM SUPERVISORY MESSAGE.
  16. *
  17. * PROC NVFCTRM (NORMTRM, SENT)
  18. *
  19. * ENTRY
  20. * NORMTRM = TRUE IF THIS IS A NORMAL CR/TRM (FROM THE C-LAYER),
  21. * = FALSE IF THIS IS A SPECIAL CR/TRM (FROM INNER LAYER).
  22. * THE CR/TRM SM IS IN MSGBUF[0] AND THE WORD COUNT AND BLOCK
  23. * HEADER WORDS ARE IN WCBUF[0] AND ABHBUF[0] RESPECTIVELY.
  24. *
  25. * EXIT
  26. * SENT = TRUE IF THE CR/TRM WAS SENT TO THE <OTQ> OR <WBQ>,
  27. * SENT = FALSE IF THE CR/TRM COULD NOT BE SENT BECAUSE THE ACN
  28. * ENTRY DOES NOT EXIST OR BECAUSE THE CR/SWH HAS ALREADY
  29. * BEEN SENT. (THIS PARAMETER IS OF INTEREST ONLY TO THE
  30. * INNER LAYER -- SEE THE "NOTES" SECTION BELOW.)
  31. *
  32. * ALSO, ANY OF THE FOLLOWING IN VARIOUS COMBINATIONS ACCORDING
  33. * TO THE STATE OF THE ACN ENTRY FOR THE USER IN QUESTION:
  34. * - THE STATE OF THE ACN ENTRY HAS BEEN UPDATED.
  35. * - AN ENTRY FOR THE CR/TRM SM HAS BEEN PLACED IN THE OUTGOING
  36. * TRAFFIC QUEUE (*OTQ*).
  37. * - IF THE CONNECTION HAS NOT YET BEEN INITIALIZED (NO FC/INIT
  38. * RECEIVED) OR UNACKNOWLEDGED SYNCHRONOUS BLOCKS ARE OUTSTANDING
  39. * FOR THE CONNECTION, AN ENTRY FOR THE SM HAS BEEN MADE IN THE
  40. * WAITING BLOCK QUEUE (*WBQ*). (THE SM WILL BE ISSUED WHEN THE
  41. * CONNECTION HAS BEEN INITIALIZED AND ALL BLOCKS ARE
  42. * ACKNOWLEDGED.)
  43. *
  44. * NOTES
  45. * 1. THIS ROUTINE MAY BE CALLED BY THE C-LAYER OR BY THE INNER
  46. * LAYER. IT IS CALLED BY THE C-LAYER IF THE CR/TRM IS A
  47. * RESULT OF A CR/RCN OR CR/CB (NORMAL CR/TRM). IT IS CALLED
  48. * BY THE INNER LAYER IF THE CR/TRM IS THE RESULT OF A
  49. * NET/OFF OR FAI/APP (SPECIAL CR/TRM). THE REASON FOR THIS IS
  50. * TO PREVENT A (SPECIAL) CR/TRM FROM BEING ISSUED FROM THE
  51. * INNER LAYER AFTER A CR/SWH HAS BEEN SENT TO NIP BY THE
  52. * C-LAYER (SINCE AFTER THE CR/SWH HAS BEEN SENT, NVF DOES NOT
  53. * REALLY HAVE THE CONNECTION ANY MORE).
  54. * NOW, WHEN THE INNER LAYER NEEDS TO ISSUE A "SPECIAL" CR/TRM,
  55. * IT CAN SEND IT TO NIP AND DELETE THE PAAC ENTRY AT THE SAME
  56. * TIME, INSTEAD OF DELETING THE PAAC ENTRY AND HOPING THE
  57. * CR/TRM GETS SENT TO NIP BEFORE A CR/SWH GETS SENT.
  58. * 2. THE PROCESSING FOR THE CR/TRM IS DEFINED BY THE NVF
  59. * C-LAYER STATE DIAGRAMS.
  60. #
  61.  
  62.  
  63. #
  64. **** PROC NVFCTRM - XREF LIST.
  65. #
  66. XREF
  67. BEGIN
  68. PROC NVFCFCE; # FIND CONNECTION ENTRY #
  69. PROC SSCATR; # ACCEPT TIMER REQUEST #
  70. PROC SSTAQE; # ACCEPT QUEUE ENTRY #
  71. PROC SSTRTS; # REMOVE TABLE SPACE #
  72. END
  73.  
  74. #
  75. ****
  76. #
  77. ITEM ACNN I; # ACN FROM ENTRY WE ARE LOOKING FOR #
  78. ITEM AE I; # ORD OF NEW ACN ENTRY #
  79. ITEM I I; # LOOP INDUCTION VARIABLE #
  80. ITEM NEWACN B; # TRUE IF ACN NOT FOUND IN ACN LIST #
  81. ITEM NORMTRM B; # TRUE IF SM FROM C-LAYER, NOT INNER LAYER#
  82. ITEM RORD I; # ORDINAL OF WBQ ENTRY #
  83. ITEM SENT B; # TRUE IF CR/TRM CAN BE SENT TO NIP #
  84. ITEM SIZ I; # WBQ ENTRY SIZE #
  85.  
  86. #
  87. ** TRBBUF - TIMER REQUEST BUFFER.
  88. *
  89. * BUFFER CONTAINING TIMER INFORMATION. BUFFER IS SET UP TO CONTAIN
  90. * FC/INACT SM WHICH IS TO BE RETURNED TO THE *CTQ* QUEUE SHOULD THE
  91. * TIMER EXPIRE.
  92. #
  93. DEF TRBSIZ$ # 4 #; # WORD SIZE OF TIMER REQUEST BUFFER #
  94. ARRAY TRBBUF [00:00] S(TRBSIZ$);
  95. BEGIN
  96. ITEM TRB$SMID S:CTQSTAT(00,00,12) = [S"SINA"]; # INTERNAL ID#
  97. ITEM TRB$WC U(00,48,12) = [TRBSIZ$]; # ENTRY SIZE #
  98. ITEM TRB$ABT U(01,00,06) = [APPCMD]; # APPL BLOCK TYPE #
  99. ITEM TRB$CNUM U(01,18,18); # CANCELLATION NUMBER #
  100. ITEM TRB$PFCSFC U(02,00,16) = [FCINA]; # FC/INACT PFCSFC #
  101. ITEM TRB$ACN U(02,24,12); # APPLICATION CONNECTION NUMBER #
  102. ITEM TRB$DELAY U(03,24,18) = [90]; # DELAY TIME IN SEC #
  103. ITEM TRB$QNUM U(03,42,18); # Q NUM FOR TIMER EXPIRED MSG #
  104. END
  105.  
  106. CONTROL EJECT;
  107. #
  108. * **** PROC NVFCTRM ENTRY START ***
  109. #
  110.  
  111. #
  112. * INITIALIZE "SENT" TO TRUE. GET THE ACN FROM THE CR/TRM SM.
  113. #
  114. SENT = TRUE;
  115. ACNN = CRACN[0];
  116. #
  117. * LOCATE THE ACN LIST ENTRY FOR THE ACN SPECIFIED IN THE CR/TRM.
  118. * IF NO ACN ENTRY WAS FOUND, SET THE "SENT" FLAG TO FALSE, AS THE
  119. * CR/TRM CANNOT BE SENT, AND RETURN.
  120. #
  121. IF ACNN NQ 0
  122. THEN
  123. BEGIN
  124. NVFCFCE (ACNN, AE, NEWACN);
  125. IF NEWACN
  126. THEN
  127. BEGIN
  128. SENT = FALSE;
  129. GOTO ENDTAS;
  130. END
  131. END
  132. #
  133. * IF THIS IS A SPECIAL CR/TRM (FROM THE INNER LAYER), AND IF THE
  134. * CR/SWH FOR THIS CONNECTION HAS ALREADY BEEN SENT OUT, NIP MAY HAVE
  135. * ALREADY CLEANED UP ITS CONNECTION AND SENT A CR/SWH/N. SET THE
  136. * "SENT" FLAG TO FALSE, AS THE CR/TRM CANNOT BE SENT, AND RETURN.
  137. #
  138. IF NOT NORMTRM
  139. AND ACN$STATE[AE] EQ ACNST"SWSTART"
  140. THEN
  141. BEGIN
  142. SENT = FALSE;
  143. GOTO ENDTAS;
  144. END
  145. #
  146. * WE HAVE A VALID ACN, SO THE CR/TRM CAN BE SENT TO NIP. DETERMINE
  147. * WHETHER IT GOES DIRECTLY TO THE *OTQ* OR GETS QUEUED IN THE *WBQ*.
  148. #
  149. IF ACN$STATE[AE] EQ ACNST"ACTIVE"
  150. OR ACN$STATE[AE] EQ ACNST"CLEARI"
  151. OR ACN$STATE[AE] EQ ACNST"BRKCMD"
  152. THEN
  153. BEGIN
  154. IF ACN$INIT[AE]
  155. AND ACN$BLCNT[AE] EQ 0
  156. THEN
  157. BEGIN
  158. SSTAQE( P<OTQ>, WCBUF, ABHBUF, MSGBUF );
  159. ACN$STATE[AE] = ACNST"ENDED";
  160. END
  161. ELSE
  162. BEGIN
  163. #
  164. * THE CR/TRM MUST BE QUEUED. START TIMER FOR THE CONNECTION.
  165. * SET STATE TO TERMINATION PENDING.
  166. #
  167. SSTAQE(P<WBQ>, WCBUF, ABHBUF, MSGBUF);
  168. TRB$ACN = ACNN;
  169. TRB$QNUM = LOC(P<CTQ>);
  170. SSCATR(TRBBUF);
  171. ACN$CNUM[AE] = TRB$CNUM;
  172. ACN$STATE[AE] = ACNST"TRMPEND";
  173. END
  174. END
  175. ELSE
  176. BEGIN
  177. #
  178. * SEND CR/TRM IF ONE IS NOT PENDING OR HAS NOT ALREADY BEEN SENT.
  179. #
  180. IF ACN$STATE[AE] NQ ACNST"TRMPEND"
  181. AND ACN$STATE[AE] NQ ACNST"ENDED"
  182. THEN
  183. BEGIN
  184. SSTAQE(P<OTQ>, WCBUF, ABHBUF, MSGBUF);
  185. IF ACN$STATE[AE] EQ ACNST"SWTPEND"
  186. THEN
  187. BEGIN
  188. #
  189. * FIND AND DELETE CR/SWH SM.
  190. #
  191. FOR RORD = 0 STEP WBQ$ESIZE[RORD] WHILE
  192. (WBQ$ABHACN[RORD] NQ 0 OR WBQ$CRSACN[RORD] NQ ACNN)
  193. AND (RORD LS WBQLNGTH)
  194. DO
  195. BEGIN
  196. END
  197. IF RORD LS WBQLNGTH # CR/SWH FOUND IN WBQ #
  198. THEN
  199. BEGIN
  200. SIZ = WBQ$ESIZE[RORD];
  201. SSTRTS(P<WBQ>, RORD, SIZ);
  202. ACN$WBCNT[AE] = 0;
  203. END
  204. END
  205. ACN$STATE[AE] = ACNST"ENDED";
  206. END
  207. END
  208. #
  209. * IF A BLK BLOCK IS WAITING IN THE <IWBQ>, DELETE IT.
  210. #
  211. IF ACN$BLKF[AE]
  212. THEN
  213. BEGIN
  214. ACN$BLKF[AE] = FALSE;
  215. FOR RORD = 0 STEP IWQ$WC[RORD] WHILE
  216. IWQ$ACN[RORD+1] NQ ACNN
  217. DO
  218. BEGIN
  219. END
  220.  
  221. SSTRTS(P<IWBQ>, RORD, IWQ$WC[RORD]);
  222. END
  223.  
  224. ENDTAS:
  225.  
  226. END # NVFCTRM #
  227. TERM
cdc/nos2.source/nam5871/nvfctrm.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator