User Tools

Site Tools


cdc:nos2.source:nam5871:qtendt

QTENDT

Table Of Contents

  • [00006] PROC QTENDT
  • [00113] PROC NETPUT
  • [00114] PROC NETPUTF
  • [00115] PROC NP$ERR
  • [00134] ENTRY PROC QTLEND

Source Code

QTENDT.txt
  1. *DECK QTENDT
  2. USETEXT AIPDEF
  3. USETEXT QTRMBUF
  4. USETEXT QTRMCOM
  5. USETEXT QTRMNIT
  6. PROC QTENDT;
  7. *IF DEF,IMS
  8. #
  9. *1DC QTENDT
  10. *
  11. * 1. PROC NAME AUTHOR DATE
  12. * QTENDT E. GEE 11/01/84
  13. *
  14. * 2. FUNCTIONAL DESCRIPTION.
  15. * TERMINATE OR LOAN A SPECIFIED CONNECTION
  16. *
  17. * 3. METHOD USED.
  18. * ENTRY POINT QTENDT:
  19. * SET LOAN FLAG TO FALSE.
  20. * ENTRY POINT QTLEND:
  21. * SET LOAN FLAG TO TRUE.
  22. * IF QTOPEN HAS NOT BEEN CALLED,
  23. * CALL NP$ERR TO ISSUE DAYFILE MESSAGE AND ABORT APP.
  24. * ELSE (QTOPEN HAS BEEN CALLED),
  25. * INITIALIZE RETURN CODE FIELD IN NIT TO QTRM REJECT CODE
  26. * IF NIT ENTRY NOT IN USE,
  27. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  28. * ELSE (NIT ENTRY IS IN USE),
  29. * IF CONNECTION HAS BEEN LOANED,
  30. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  31. * ELSE (CONNECTION DOES EXIST),
  32. * IF NEXT APPLICATION WAS SPECIFIED
  33. * AND DATA IS BEING PASSED TO IT
  34. * AND SIZE OF DATA IS NOT SPECIFIED,
  35. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  36. * ELSE (OKAY TO END/LOAN CONNECTION),
  37. * IF NEXT APPLICATION WAS SPECIFIED
  38. * AND DATA IS BEING PASSED TO IT
  39. * AND SIZE OF DATA IS TOO LARGE,
  40. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  41. * ELSE (GOOD SIZE SPECIFIED FOR DATA TO BE PASSED),
  42. * IF LOANING CONNECTION,
  43. * IF NOT DEVICE CONNECTION,
  44. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  45. * ELSE (DEVICE CONNECTION),
  46. * IF LOANED CONNECTION,
  47. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  48. * ELSE (DEVICE CONNECTION),
  49. * IF NEXT APPLICATION NOT SPECIFIED,
  50. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CD.
  51. * ELSE (NEXT APPLICATION WAS SPECIFIED),
  52. * IF DOWNLINE BLOCKS OUTSTANDING,
  53. * SET SEC-RETURN-CODE FIELD IN NIT TO ERR CD.
  54. * ELSE (OKAY TO LOAN CONNECTION),
  55. * STORE NORMAL COMPLETION RETURN CODE IN NIT.
  56. * ELSE (OKAY TO TERMINATE CONNECTION),
  57. * STORE NORMAL COMPLETION RETURN CODE IN NIT.
  58. * IF NORMAL COMPLETION RETURN CODE IN NIT,
  59. * SEND LST/OFF SM TO TURN OFF MSG TRAFFIC ON CON.
  60. * SEND CON/END/R SM WITH DATA IF ANY.
  61. *
  62. * 4. ENTRY CONDITIONS
  63. * NIT$CON NO OF CONNECTION TO BE TERMINATED OR LOANED
  64. * NIT$CTLC NO OF WDS OF DATA TO PASS TO NEXT APP
  65. * NIT$NEXT$APP NAME OF NEXT APPLICATION TO HAVE DEVICE CON
  66. * NIT$PARMADR ADDR OF DATA TO PASS TO NEXT APPLICATION
  67. *
  68. * 5. NORMAL EXIT CONDITIONS.
  69. * NIT$STATE WCONENDN STATE (IF TERMINATING CONNECTION)
  70. * NET$STATE LEND STATE (IF LOANING CONNECTION)
  71. * NIT$RC 0
  72. *
  73. * 6. ABNORMAL EXIT CONDITIONS.
  74. * NIT$RC QTENDTREJ RETURN CODE (IF QTENDT CALL)
  75. * NIT$RC QTLENDREJ RETURN CODE (IF QTLEND CALL)
  76. * NIT$S$RC REASON CODE FOR REJECTION
  77. *
  78. * 7. COMMON DECKS AND SYMPL TEXT USED.
  79. * AIPDEF NP$CRT QTRMBUF QTRMCOM
  80. * QTRMNIT
  81. *
  82. * 8. ROUTINES CALLED.
  83. * NETPUT OUTPUT BLOCK TO NETWORK
  84. * NETPUTF OUTPUT FRAGMENTED BLOCK TO NETWORK
  85. * NP$ERR DAYFILE ERROR MESSAGE AND ABORT APP
  86. *
  87. * 9. DAYFILE MESSAGES.
  88. * *** NETWORK APPLICATION ABORTED, RC = 70. ***
  89. * *** QTENDT: REQUEST INVALID BEFORE QTOPEN. ***
  90. * *** NETWORK APPLICATION ABORTED, RC = 76. ***
  91. * *** QTLEND: REQUEST INVALID BEFORE QTOPEN. ***
  92. *
  93. *
  94.  #
  95. *ENDIF
  96.  
  97. #
  98.   CONTROL DEFINITIONS
  99. #
  100. CONTROL PRESET;
  101. CONTROL PACK;
  102. CONTROL DISJOINT;
  103. CONTROL INERT;
  104. CONTROL FASTLOOP;
  105.  
  106. *CALL NP$CRT
  107.  
  108. #
  109.   ROUTINES CALLED
  110. #
  111. XREF
  112. BEGIN
  113. PROC NETPUT; # OUTPUT BLOCK TO NETWORK #
  114. PROC NETPUTF; # OUTPUT FRAGMENT SUP MSG #
  115. PROC NP$ERR; # DAYFILE ERR MSG AND ABORT #
  116. END
  117. #
  118.   LOCAL VARIABLES
  119. #
  120. ITEM ACN I; # APPLICATION CONNECTION NUMBER#
  121. ITEM LOAN B; # LOAN CONNECTION FLAG #
  122.  
  123. #**********************************************************************#
  124. CONTROL EJECT;
  125. #
  126.   BEGIN QTENDT PROCESSING
  127. #
  128. BEGIN
  129. LOAN = FALSE; # NOT LOANING CONNECTION #
  130. GOTO QTENDT1; # SKIP QTLOAN CODE #
  131. #
  132.   BEGIN QTLEND PROCESSING
  133. #
  134. ENTRY PROC QTLEND;
  135. LOAN = TRUE; # LOANING CONNECTION #
  136. #
  137.   BEGIN QTLEND/QTENDT COMMON CODE
  138. #
  139. QTENDT1:
  140. IF NOT NETON$STATUS # CHECK IF NETON HAD COMPLETED #
  141. THEN
  142. BEGIN
  143. IF LOAN
  144. THEN # QTLEND CALL #
  145. BEGIN
  146. NP$ERR("76"); # REQUEST INVALID BEFORE QTOPEN#
  147. END
  148. ELSE # QTENDT CALL #
  149. BEGIN
  150. NP$ERR("70"); # REQUEST INVALID BEFORE QTOPEN#
  151. END
  152. END
  153. P<NIT> = NIT$ADDR;
  154. ACN = NIT$CON[0]; # CONNECTION TO BE TERMINATED #
  155. IF LOAN
  156. THEN # QTLEND CALL #
  157. BEGIN
  158. NIT$RC[0] = S"QTLENDREJ"; # INIT RETURN CODE TO REJECT #
  159. END
  160. ELSE # QTENDT CALL #
  161. BEGIN
  162. NIT$RC[0] = S"QTENDTREJ"; # INIT RETURN CODE TO REJECT #
  163. END
  164. IF (NIT$STATE[ACN] EQ S"NULL") OR
  165. (NIT$STATE[ACN] EQ S"WCONENDN") OR
  166. (ACN EQ 0) OR
  167. (ACN GR NIT$NO$TERMS[0])
  168. THEN # BAD CONNECTION NUMBER #
  169. BEGIN
  170. NIT$S$RC[0] = S"BADCN"; # BAD CONNECTION NUMBER #
  171. END
  172. ELSE # NIT ENTRY EXISTS #
  173. BEGIN
  174. IF (NIT$STATE[ACN] EQ S"LEND") OR
  175. (NIT$STATE[ACN] EQ S"LENT")
  176. THEN # CONNECTION DOES NOT EXIST #
  177. BEGIN
  178. NIT$S$RC[0] = S"CONLOANED"; # CONNECTION IN WRONG STATE #
  179. END
  180. ELSE # CONNECTION IN RIGHT STATE #
  181. BEGIN
  182. IF (NIT$PARMADR[0] NQ 0) AND
  183. (NIT$CTLC[0] EQ 0)
  184. THEN # NO DATA LENGTH SPECIFIED #
  185. BEGIN
  186. NIT$S$RC[0] = S"NOSIZE"; # BAD SIZE FOR DATA TO PASS #
  187. END
  188. ELSE # DATA LENGTH WAS SPECIFIED #
  189. BEGIN
  190. IF (NIT$PARMADR[0] NQ 0) AND
  191. (NIT$CTLC[0] GR 52)
  192. THEN # BAD DATA LENGTH SPECIFIED #
  193. BEGIN
  194. NIT$S$RC[0] = S"BADSIZE"; # BAD SIZE FOR DATA TO PASS #
  195. END
  196. ELSE # OKAY TO END CONNECTION #
  197. BEGIN
  198. IF LOAN
  199. THEN # LOANING CONNECTION #
  200. BEGIN
  201. IF (NIT$DEVTYP[ACN] EQ DT$INTA) OR
  202. (NIT$DEVTYP[ACN] EQ DT$INTE)
  203. THEN # APP-TO-APP CONNECTION #
  204. BEGIN
  205. NIT$S$RC[0] = S"NOTDEVC"; # NOT DEVICE CONNECTION #
  206. END
  207. ELSE # DEVICE CONNECTION #
  208. BEGIN
  209. IF NIT$LOAN[ACN] NQ 0
  210. THEN # THIS IS ALREADY A LOANED CON #
  211. BEGIN
  212. NIT$S$RC[0] = S"LOANCON"; # CANNOT LOAN LOANED CON#
  213. END
  214. ELSE # NOT LOANED CONNECTION #
  215. BEGIN
  216. IF NIT$NEXT$APP[0] EQ 0
  217. THEN # NEXT APPLICATION NOT SPEC #
  218. BEGIN
  219. NIT$S$RC[0] = S"NONEXTAP"; # CAN-T LOAN IF NO AP#
  220. END
  221. ELSE # NEXT APPLICATION SPECIFIED #
  222. BEGIN
  223. IF NIT$ABL[ACN] NQ NIT$C$ABL[ACN]
  224. THEN # DOWNLINE BLOCKS OUTSTANDING #
  225. BEGIN
  226. NIT$S$RC[0] = S"DBLKSO"; # DWNLNE BLKS NOT ACK#
  227. END
  228. ELSE # OKAY TO LOAN CONNECTION #
  229. BEGIN
  230. NIT$RC[0] = S"OK"; # INIT RETURN CODE TO SUCCES#
  231. NIT$STATE[ACN] = S"LEND"; # CHANGE STATE #
  232. END
  233. END
  234. END
  235. END
  236. END
  237. ELSE # TERMINATING CONNECTION #
  238. BEGIN
  239. NIT$RC[0] = S"OK"; # INIT RETURN CODE TO SUCCESS#
  240. NIT$STATE[ACN] = S"WCONENDN"; # WAIT FOR CON/END/N STAT#
  241. END
  242. END
  243. IF NIT$RC[0] EQ S"OK"
  244. THEN # OKAY TO END/LOAN CONNECTION #
  245. BEGIN
  246. #
  247.   SEND LST/OFF SUPERVISORY MESSAGE FOR CONNECTION
  248. #
  249. ABHWORD[0] = 0;
  250. ABHABT[0] = APPCMD; # ABH FOR LST/OFF ON ACN #
  251. ABHACT[0] = ACLST; # ACT IS C60TRANS #
  252. ABHTLC[0] = LLST; # TLC IS 1 #
  253. SPMSG0[0] = 0;
  254. PFCSFC[0] = LSTOFF; # LST/OFF SUPERVISORY MESSAGE #
  255. LSTACN[0] = ACN;
  256. NETPUT(HEADER, SUP$MES); # SEND LST/OFF TO NAM #
  257. #
  258.   SEND CON/END SUPERVISORY MESSAGE
  259. #
  260. ABHWORD[0] = 0;
  261. ABHABT[0] = APPCMD; # ABH FOR CON/END #
  262. ABHACT[0] = ACCON; # ACT IS C60TRANS #
  263. FRAGSZ0[0] = LCONEN; # LENGTH OF SM WITHOUT DATA #
  264. FRAGAD0[0] = LOC(SUP$MES); # ADDR OF 1ST FRAGMENT BUFFER #
  265. SPMSG0[0] = 0;
  266. SPMSG1[0] = 0;
  267. PFCSFC[0] = CONEND; # CON/END SUPERVISORY MESSAGE #
  268. CONACN[0] = ACN;
  269. CONANM[0] = NIT$NEXT$APP[0];# SET NEXT APPLICATION FIELD #
  270. CONLOAN[0] = LOAN; # SET LOAN FLAG IN SUP MSG #
  271. IF ( (NIT$NEXT$APP[0] NQ 0) AND
  272. (NIT$PARMADR[0] NQ 0) ) OR
  273. ( (NIT$PARMADR[0] NQ 0) AND
  274. (NIT$LOAN[ACN] NQ 0) )
  275. THEN # SIZE OF DATA TO PASS IS OK #
  276. BEGIN
  277. FRAGSZ0[1] = NIT$CTLC[0]; # LENGTH OF DATA IN 2ND FRAG #
  278. FRAGAD0[1] = NIT$PARMADR[0]; # ADR OF 2ND FRAG BUFFER #
  279. ABHTLC[0] = LCONEN + NIT$CTLC[0]; # SIZE OF CON/END SM #
  280. NOFRAG = 2; # NUMBER OF FRAGMENT BUFFERS #
  281. END
  282. ELSE
  283. BEGIN
  284. ABHTLC[0] = LCONEN; # LENGTH OF SM WITHOUT DATA #
  285. NOFRAG = 1; # NUMBER OF FRAGMENT BUFFERS #
  286. END
  287. NETPUTF(HEADER,NOFRAG,FRAG); # SEND CON/END TO NAM #
  288.  
  289. END
  290. END
  291. END
  292. END
  293.  
  294. RETURN;
  295. END
  296. TERM
cdc/nos2.source/nam5871/qtendt.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator