User Tools

Site Tools


cdc:nos2.source:nam5871:hconcbu

HCONCBU

Table Of Contents

  • [00012] PRGM HCONCBU
  • [00071] PROC BLINK
  • [00072] PROC MGETS
  • [00073] PROC OSCHAPP
  • [00074] PROC XTRACE

Source Code

HCONCBU.txt
  1. *DECK HCONCBU
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT ACNB
  5. USETEXT ACNT
  6. USETEXT AHEADER
  7. USETEXT APPSTAT
  8. USETEXT AT
  9. USETEXT PARAMS
  10. USETEXT PT
  11. USETEXT SUPMSG
  12. PRGM HCONCBU;
  13. STARTIMS;
  14. #
  15. *1DC HCONCBU
  16. *
  17. * 1. PROC NAME AUTHOR DATE
  18. * HCONCBU E. GEE 01/02/86
  19. *
  20. * 2. FUNCTIONAL DESCRIPTION.
  21. * SEND CON/CB/U TO PRIMARY AND/OR SECONDARY APPLICATION.
  22. *
  23. * 3. METHOD USED
  24. * DETERMINE IF CON/CB IS TO BE SENT TO PRIMARY APPLICATION.
  25. * DETERMINE IF CON/CB IS TO BE SENT TO SECONDARY APPLICATION.
  26. * LOOP BUILDING CON/CB SUP MSG TO SEND TO ZERO, ONE, OR TWO APPS.
  27. * FORMAT APPLICATION BLOCK HEADER
  28. * SET UP CON/CB/U MESSAGE
  29. * QUEUE MESSAGE ON APPLICATION-S ACB
  30. *
  31. * 4. ENTRY PARAMETERS
  32. * PARAMS1 REASON CODE FOR CON/CB SUP MSG
  33. * PARAMS2 ACNB OF APPLICATION
  34. *
  35. * 5. EXIT PARAMETERS
  36. * NONE
  37. *
  38. * 6. COMDECKS CALLED AND SYMPL TEXTS USED
  39. * ACB APPLICATION CONTROL BLOCK TEMPLATE
  40. * ACNB APPLICATION CONNECTION BLOCK TEMPLATE
  41. * ACNT APPLICATION CONNECTION TABLE TEMPLATE
  42. * AHEADER APPLICATION BLOCK HEADER WORD TEMPLATE
  43. * AT APPLICATION TABLE
  44. * NIPDEF CONSTANT DEFINITIONS
  45. * PARAMS COM BLK FOR PASSING PARAMETERS TO SEC OVLYS
  46. * PT MISCELLANEOUS VARIABLES, POINTERS
  47. * SUPMSG SUPERVISORY MESSAGE TEMPLATE
  48. *
  49. * 7. ROUTINES CALLED
  50. * BLINK LINK MESSAGE ON APPLICATION-S ACB
  51. * MGETS ALLOCATE EMTPY BUFFER
  52. * OSCHAPP SCHEDULE APPLICATION
  53. * XTRACE TRACE PROCEDURE CALL
  54. *
  55. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  56. * THIS IS A SECONDARY OVERLAY CALLED BY HCSTTP.
  57. *
  58. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY
  59. * OVERLAY BUFFER SIZE MINUS 5 (443B WORDS).
  60. *
  61. *
  62.  #
  63. STOPIMS;
  64.  
  65.  
  66. #
  67.   EXTERNAL VARIABLES
  68. #
  69. XREF
  70. BEGIN
  71. PROC BLINK; # LINK MSG ON APPL-S ACB #
  72. PROC MGETS; # ALLOCATE EMPTY BUFFER #
  73. PROC OSCHAPP; # SCHEDULE APPLICATION #
  74. PROC XTRACE; # TRACE PROCEDURE CALL #
  75. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  76. END
  77.  
  78. #
  79.   INTERNAL VARIABLES
  80. #
  81. ITEM BUFADDR; # SM BUFFER ADDRESS #
  82. ITEM I ; # INDUCTION VARIABLE #
  83. ITEM ACNTINDX ;
  84. ITEM INDX ;
  85. ITEM FOUND B ;
  86. ITEM PRIAPP; # = 0 IF SENDING CON/CB TO PRIMARY APP #
  87. # = 1 IF NOT SENDING CON/CB TO PRIMARY AP #
  88. ITEM SECAPP; # = 0 IF NOT SENDING CON/CB TO SEC APP #
  89. # = 1 IF SENDING CON/CB TO SEC APP #
  90.  
  91. #**********************************************************************#
  92.  
  93. BEGIN
  94.  
  95. CONTROL IFEQ DEBUG,1;
  96. XTRACE("CONCB"); # RECORD PROCEDURE CALL #
  97. CONTROL FI;
  98.  
  99. P<ACNB> = PARAMS2 ; # ADDRESS OF ACNB #
  100. P<ACB> = ATACBA[ACNBAN[0]] ;
  101. P<ACNT> = ACBACNT[0] ;
  102. IF (ACBORD2[0]) # THIS APPLICATION SENT SAC/NCL#
  103. # TO SET ERROR CONDITION FOR #
  104. THEN # CON/CB/U. #
  105. BEGIN
  106. ACBABTCB[0] = TRUE ; # READY TO ABORT THIS APPL #
  107. # AND DONT QUEUE ANY SM #
  108. GOTO HCONCBE ;
  109. END
  110.  
  111. #
  112.   DETERMINE IF PRIMARY APPLICATION NEEDS TO INFORMED
  113. #
  114. IF (ACNBPRID[0] NQ 0 ) AND # THERE IS A PRIMARY APP #
  115. (NOT ACNBPRAF[0] ) AND # PRIMARY APP HAS NOT FAILED #
  116. (PARAMS1 NQ RCB"CNB") # SEC APP NOT SENT BAD CON/REQ/N#
  117. THEN # NEED TO SEND CON/CB TO PRI APP#
  118. BEGIN
  119. PRIAPP = 0; # SET FLAG TO SEND CON/CB TO PRI#
  120. END
  121. ELSE # NO NEED TO SEND CON/CB TO PRI #
  122. BEGIN
  123. PRIAPP = 1; # SET FLAG TO NOT SEND CON/CB #
  124. END
  125. #
  126.   DETERMINE IF SECONDARY APPLICATION NEEDS TO BE INFORMED. THE
  127.   SECONDARY APPLICATION IS CONSIDERED TO BE THE APPLICATION THAT
  128.   THE ACNB IS CURRENTLY CONNECTED TO.
  129. #
  130. IF (ACNBAN[0] EQ NVFAN ) OR # SEC APP IS NVF #
  131. (PARAMS1 EQ RCB"LCA") # SEC APP ABORTING CONNECTION #
  132. THEN # NEED TO SEND CON/CB TO SEC APP#
  133. BEGIN
  134. SECAPP = 0; # SET FLAG TO NOT SEND CON/CB #
  135. END
  136. ELSE
  137. BEGIN
  138. IF ( ACNTCS[ACNBACN[0] + ACNTHSIZE - ACNTMINACN[0]]
  139. EQ HCSINVF ) # IN THE STATE THAT IS EXPECTING#
  140. # CON/REQ/N FROM APPLICATION #
  141. THEN # DO NOT SEND CON/CB/U NOW #
  142. SECAPP = 0 ; # SEND IT WHEN CON/REQ/N COMES #
  143. ELSE
  144. SECAPP = 1 ; # SET FLAG TO SEND CON/CB/U #
  145. END
  146. #
  147.   LOOPING ISSUING CON/CB SUPERVISORY MESSAGES
  148. #
  149. FOR I = PRIAPP STEP 1 WHILE I LQ SECAPP
  150. DO
  151. BEGIN
  152. IF I EQ 0
  153. THEN # SENDING CON/CB TO PRI APP #
  154. BEGIN # THIS IS A LOANED CONNECTION #
  155. P<ACB> = ATACBA[ACNBPRAN[0]];# ACB OF PRIMARY APP #
  156. P<ACNT> = ACBACNT[0] ;
  157. ACNTSECID[ACNBPRACN[0] + ACNTHSIZE - ACNTMINACN[0]] = 0 ;
  158. #
  159.   PRIMARY APPLICATION RECEIVES CON/CB/U ON THIS LOANED CONNECTION,
  160.   IT CONSIDERS THIS CONNECTION IS GONE, NIP NEEDS TO CLEAN UP THE
  161.   ACNT TABLE FOR FUTURE USAGE.
  162.   #
  163. ACNTINDX = ACNBPRACN[0] + ACNTHSIZE - ACNTMINACN[0] ;
  164. ACNTNFE[0] = ACNTNFE[0] + 1 ; # UPDATE NUMBER OF FREE ENTR#
  165. IF ACNBPRACN[0] LS ACNTFFCN[0]
  166. THEN
  167. ACNTFFCN[0] = ACNBPRACN[0] ; # UPDATE FIRST FREE ACN #
  168.  
  169. FOUND = FALSE;
  170. IF ACNBPRACN[0] EQ ACNTHCN[0]
  171. THEN # UPDATE HIGHEST CN IN USE #
  172. BEGIN # SEARCH FOR HIGHEST CN IN USE #
  173. FOR INDX = ACNTINDX - 1 STEP -1 WHILE INDX GQ ACNTHSIZE
  174. AND NOT FOUND
  175. DO
  176. BEGIN
  177. IF ACNTWD[INDX] NQ 0
  178. THEN # HIGHEST CN FOUND #
  179. BEGIN
  180. ACNTHCN[0] = INDX + ACNTMINACN[0] - ACNTHSIZE;
  181. FOUND = TRUE; # SET HIGHEST CN IN USE FOUND FLAG #
  182. END
  183. END
  184. IF NOT FOUND
  185. THEN # THERE ARE NO ENTRIES IN ACNT #
  186. ACNTHCN[0] = 0;
  187. END
  188. END
  189. ELSE # SENDING CON/CB TO SEC APP #
  190. BEGIN
  191. P<ACB> = ATACBA[ACNBAN[0]] ; # ACB OF SECONDARY APP #
  192. END
  193. #
  194.   ALLOCATE BUFFER FOR CON/CB/U
  195. #
  196.  
  197. MGETS(LCONCB + BLKHSIZE + ABHSIZE,BUFADDR,TRUE);
  198. #
  199.   SET UP APPLICATION BLOCK HEADER
  200. #
  201. P<AHEADER> = BUFADDR + BLKHSIZE; # BASE ABH #
  202. ABHABT[0] = APPCMD; # BLOCK TYPE #
  203. ABHACT[0] = CT60TRANS; # CHARACTER TYPE - TRANSPARENT #
  204. ABHTLC[0] = LCONCB; # TEXT LENGTH #
  205. #
  206.   SET UP CON/CB/U MESSAGE
  207. #
  208. P<SUPMSG> = P<AHEADER> + ABHSIZE; # FWA OF TEXT #
  209. PFCSFC[0] = CONCB; # SET FUNCTION CODE #
  210. CONRCB[0] = PARAMS1; # CONN. WITH RC FROM HCSTTP #
  211.  
  212. IF I EQ 0 # CON/CB FOR PRIMARY APPLICATION#
  213. THEN
  214. BEGIN # SEND CON/CB TO PRIM. APPL. TOO#
  215. CONACN[0] = ACNBPRACN[0]; # ACN OF PRIMARY. #
  216. CONLOAN[0] = TRUE; # LOANED CONNECTION TERMINATED #
  217. END
  218. ELSE
  219. BEGIN # SEND CON/CB TO SECONDARY APP #
  220. CONACN[0] = ACNBACN[0] ;
  221. END
  222. #
  223.   QUEUE CON/CB/U ON APPLICATION-S ACB
  224. #
  225. BLINK(BUFADDR,P<ACB>) ; # LINK CON/CB TO APPL. ACB #
  226. OSCHAPP(P<ACB>) ;
  227. END # END OF I FOR LOOP #
  228. HCONCBE:
  229. ACNBPRID[0] = 0 ; # CLEAR PRIMARY ID ,ANYWAY #
  230. GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
  231. END
  232. TERM
cdc/nos2.source/nam5871/hconcbu.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator