User Tools

Site Tools


cdc:nos2.source:nam5871:relacnb

RELACNB

Table Of Contents

  • [00011] PROC RELACNB(ACNBADR,SWFLAG,LNFLAG)
  • [00075] PROC DELCDR
  • [00076] PROC HUPDDAW
  • [00077] PROC MREDUCE
  • [00078] PROC KPUT
  • [00079] PROC OMSG
  • [00080] PROC MRELS
  • [00081] PROC XTRACE
  • [00082] PROC ABORT

Source Code

RELACNB.txt
  1. *DECK RELACNB
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT ACNB
  5. USETEXT ACNT
  6. USETEXT AT
  7. USETEXT DRHDR
  8. USETEXT KDIS
  9. USETEXT KHDRX
  10. USETEXT NCNB
  11. PROC RELACNB(ACNBADR,SWFLAG,LNFLAG); # RELEASE ACNB #
  12. STARTIMS;
  13. #
  14. *1DC RELACNB
  15. *
  16. * 1. PROC NAME AUTHOR DATE
  17. * RELACNB C. BITTNER 81/04/07
  18. *
  19. * 2. FUNCTIONAL DESCRIPTION
  20. * RELEASE THE APPLICATION CONNECTION BLOCK (ACNB)
  21. *
  22. * 3. METHOD USED
  23. * CHECK IF ACNT CAN BE SHRUNK. IF NOT, UPDATE ACNT
  24. * HEADER INFORMATION. RELEASE DATA RING AND ACNB.
  25. * DECREMENT TOTAL NUMBER OF CONNECTIONS IN THE ACB.
  26. *
  27. * 4. ENTRY PARAMETERS
  28. * ACNBADR ADDRESS OF ACNB TO RELEASE
  29. * SWFLAG FLAG TO INDICATE IF SWITCHING CONNECTION
  30. * LNFLAG FLAG TO INDICATE IF LOANING CONNECTION
  31. *
  32. * 5. EXIT PARAMETERS
  33. * NONE
  34. *
  35. * 6. COMDECKS CALLED AND SYMPL TEXTS USED
  36. * NIPDEF ACNT
  37. * ACB DRHDR
  38. * ACNB
  39. * NCNB AT
  40. * KDIS
  41. *
  42. * 7. ROUTINES AND OVERLAYS CALLED
  43. * REDUCE - REDUCE MEMORY BUFFER
  44. * HUPDDAW - UPDATE DATA AVAILABLE WORD
  45. * OMSG - ISSUE DAYFILE MESSAGE
  46. * XTRACE - RECORD PROCEDURE CALLS
  47. * DELCDR - DELETE ACNB FROM CONNECTION DATA RING
  48. * KPUT - UPDATE STATUS DISPLAY
  49. * MRELS - RELEASE BUFFER
  50. *
  51. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  52. * "NIP/RELACNB - BAD CN"
  53. *
  54. * THIS PROCEDURE IS LOADED AND CALLED BY PRIMARY OVERLAY
  55. * STRTSW AND SECONDARY OVERLAY HSWACNB VIA HCSTTP.
  56. *
  57. * W A R N I N G - THE SIZE OF THIS PROCEDURE ALONG WITH
  58. * SECONDARY OVERLAY HSWACNB PLUS PROCEDURE
  59. * HALLOCN CANNOT EXCEED THE SIZE OF THE
  60. * SECONDARY OVERLAY BUFFER SIZE MINUS 5
  61. * (473B WORDS). THE SIZE OF THIS PROCEDURE
  62. * ALONG WITH PRIMARY OVERLAY STRTSW PLUS
  63. * PROCEDURES HCONREQ, HCRSWHN, AND MREDUCE
  64. * CANNOT EXCEED THE SIZE OF THE PRIMARY
  65. * OVERLAY BUFFER SIZE MINUS 5 (673B WORDS).
  66. *
  67.  #
  68. STOPIMS;
  69.  
  70. #
  71.   EXTERNAL VARIABLES
  72. #
  73. XREF
  74. BEGIN
  75. PROC DELCDR; # DELINK ACNB FROM CONNECTION DATA RING #
  76. PROC HUPDDAW; # UPDATE DATA AVAILABLE WORD #
  77. PROC MREDUCE; # REDUCE MEMORY BUFFER #
  78. PROC KPUT ;
  79. PROC OMSG; # ISSUE DAYFILE MESSAGE #
  80. PROC MRELS; # RELEASE BUFFER SPACE #
  81. PROC XTRACE; # RECORD PROCEDURE CALLS #
  82. PROC ABORT ; # #
  83. END
  84. #
  85.   INPUT PARAMETERS
  86. #
  87. ITEM ACNBADR; # ADDRESS OF ACNB TO RELEASE #
  88. ITEM SWFLAG B; # TRUE = SWITCHING CONNECTION #
  89. ITEM LNFLAG B; # TRUE = LOANING CONNECTION #
  90. #
  91.   INTERNAL VARIABLES
  92. #
  93. ITEM ACNTINDX; # INDEX INTO ACNT #
  94. ITEM AN; # APPLICATION NUMBER #
  95. ITEM NEWSIZE; # SIZE TO REDUCE BUFFER TO #
  96. ITEM CURR; # INDUCTION LOOP VARIABLE #
  97. ITEM FOUND B; # HIGHEST CN IN USE FOUND-FLAG #
  98. ITEM INDX; # INDUCTION LOOP VARIABLE #
  99. ITEM NEXT; # NEXT ENTRY IN DATA RING #
  100. ITEM TMPINDX I; # ACB KDISPLAY ABSOLUTE INDEX #
  101. # SET TO -1 IF NOT IN VIEW #
  102.  
  103. # DAYFILE MESSAGE TO ISSUE IF BAD CONNECTION NUMBER #
  104. CONTROL IFEQ DEBUG,1;
  105. ARRAY ERRMSG P(3);
  106. BEGIN
  107. ITEM BADMSG C(00,00,20) = ["NIP/RELACNB - BAD CN"];
  108. ITEM ENDMSG U(02,00,60) = [0];
  109. END
  110. CONTROL FI;
  111. #**********************************************************************#
  112.  
  113.  
  114.  
  115.  
  116.  
  117. BEGIN
  118.  
  119. CONTROL IFEQ DEBUG,1;
  120. XTRACE("RACNB") ;
  121. CONTROL FI;
  122.  
  123. FOUND = FALSE; # INITIALIZE HIGHEST CN FOUND FLAG #
  124. P<ACNB> = ACNBADR; # ADDRESS OF ACNB TO RELEASE #
  125.  
  126. CONTROL IFEQ DEBUG,1;
  127. IF P<ACNB> EQ 0
  128. THEN
  129. BEGIN
  130. OMSG(ERRMSG,0); # ISSUE ERROR DAYFILE MESSAGE #
  131. ABORT(0,0) ;
  132. END
  133. CONTROL FI;
  134.  
  135. AN = ACNBAN[0]; # APPLICATION NUMBER #
  136. P<ACB> = ATACBA[AN]; # BASE APPL CONTROL BLOCK #
  137. P<ACNT> = ACBACNT[0]; # BASE APPL CONNECTION TABLE #
  138. ACNTINDX = ACNBACN[0] + ACNTHSIZE - ACNTMINACN[0];
  139.  
  140.  
  141. ACNTWD[ACNTINDX] = 0; # DELETE ACNT ENTRY #
  142. IF NOT LNFLAG # NOT LOANING CONNECTION #
  143. THEN
  144. BEGIN # FREE THIS ENTRY, NOT FOR LOAN-CON #
  145. ACNTNFE[0] = ACNTNFE[0] + 1 ; # UPDATE NUMBER OF FREE ENTRY #
  146. IF ACNBACN[0] LS ACNTFFCN[0]
  147. THEN
  148. ACNTFFCN[0] = ACNBACN[0] ; # UPDATE FIRST FREE ACN #
  149.  
  150. IF ACNBACN[0] EQ ACNTHCN[0]
  151. THEN # UPDATE HIGHEST CN IN USE #
  152. BEGIN # SEARCH FOR HIGHEST CN IN USE #
  153. FOR INDX = ACNTINDX - 1 STEP -1 WHILE INDX GQ ACNTHSIZE
  154. AND NOT FOUND
  155. DO
  156. BEGIN
  157. IF ACNTWD[INDX] NQ 0
  158. THEN # HIGHEST CN FOUND #
  159. BEGIN
  160. ACNTHCN[0] = INDX + ACNTMINACN[0] - ACNTHSIZE;
  161. FOUND = TRUE; # SET HIGHEST CN IN USE FOUND FLAG #
  162. END
  163. END
  164. IF NOT FOUND
  165. THEN # THERE ARE NO ENTRIES IN ACNT #
  166. ACNTHCN[0] = 0;
  167. END
  168. END # FREE THIS ENTRY, NOT FOR LOAN-CON #
  169.  
  170. # CHECK IF ACNT CAN BE SHRUNK#
  171. IF (ACNTNFE[0] GQ MINACNTFE) AND
  172. (ACNTBS[0] - (ACNTHCN[0] - ACNTMINACN[0]) - ACNTHSIZE - 1)
  173. GQ ACNTESIZE
  174. THEN # SHRINK ACNT #
  175. BEGIN
  176. NEWSIZE = ACNTBS[0] - ACNTESIZE; # SIZE TO REDUCE ACNT TO #
  177. MREDUCE(P<ACNT>,NEWSIZE); # SHRINK ACNT #
  178. ACBACNT[0] = P<ACNT>; # UPDATE ACNT ADDRESS #
  179. ACNTNFE[0] = ACNTNFE - ACNTESIZE; # UPDATE NO. FREE ENTRIES #
  180. END
  181. ACBNCN[0] = ACBNCN[0] - 1; # DECREMENT NO. OF CONN IN ACB #
  182. IF KDIS$RT
  183. AND ACBKNDX[0] NQ 0
  184. AND ACBKNDX[0] GQ KDAPPST[0]
  185. AND ACBKNDX[0] LQ KDAPPND[0]
  186. THEN
  187. BEGIN
  188. TMPINDX=ACBKNDX[0]-KDAPPST[0];
  189. KPUT(KHDRNP[0],TMPINDX,KPAPNCN,ACBNCN[0]) ;
  190. END
  191. ELSE
  192. TMPINDX=-1;
  193.  
  194. IF NOT SWFLAG AND P<ACNB> NQ 0
  195. THEN # NOT A CONNECTION SWITCH #
  196. BEGIN
  197. # RELEASE DATA RING #
  198. P<DRHDRWD> = 0;
  199. CURR = ACNBDRFP[0]; # FIRST ENTRY IN DATA RING #
  200. FOR CURR = CURR WHILE CURR NQ LOC(ACNBDRFP[0]) AND
  201. CURR NQ 0 DO
  202. BEGIN
  203. NEXT = NEXTPTR[CURR]; # NEXT ENTRY IN DATA RING #
  204. MRELS(CURR); # RELEASE DATA RING ENTRY #
  205. CURR = NEXT;
  206. END
  207. IF ACNBBLKSQ[0] NQ 0
  208. THEN # DATA QUEUED TO ACNB #
  209. BEGIN
  210. HUPDDAW(P<ACB>,P<ACNB>,-ACNBBLKSQ[0],-ACNBBLKSQ[0]);
  211. DELCDR(P<ACNB>); # DELETE ACNB FROM CONNECTION DATA RING #
  212. END
  213. IF ACNBNCNB[0] NQ 0
  214. THEN # NCNB EXISTS #
  215. BEGIN
  216. P<NCNB> = ACNBNCNB[0];
  217. NCNBACNB[0] = 0; # CLEAR ACNB POINTER #
  218. END
  219. IF TMPINDX GQ 0 THEN
  220. KPUT(KHDRNP[0],TMPINDX,KPAPNDM,ACBBLKSQ[0]) ;
  221.  
  222. MRELS(P<ACNB>);
  223. END
  224.  
  225. RETURN ; # RETURN TO CALLING PROGRAM #
  226. END
  227. TERM
cdc/nos2.source/nam5871/relacnb.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator