User Tools

Site Tools


cdc:nos2.source:nam5871:qtopen

QTOPEN

Table Of Contents

  • [00006] PROC QTOPEN(NITADDRESS)

Source Code

QTOPEN.txt
  1. *DECK QTOPEN
  2. USETEXT AIPDEF
  3. USETEXT QTRMBUF
  4. USETEXT QTRMCOM
  5. USETEXT QTRMNIT
  6. PROC QTOPEN(NITADDRESS);
  7. *IF,DEF,IMS
  8. #
  9. *1DC QTOPEN
  10. *
  11. * 1. PROC NAME AUTHOR DATE
  12. * QTOPEN E. GEE 86/04/02
  13. *
  14. * 2. FUNCTIONAL DESCRIPTION.
  15. * PROVIDES INITIALIZATION PROCESSING FOR QTRM.
  16. * MAIN PURPOSE IS TO CONNECT (I.E. NETON) TO NETWORK.
  17. *
  18. * 3. METHOD USER.
  19. * INIT RETURN CODE FIELD IN NIT TO QTOPEN FAILED RC.
  20. * IF APPLICATION ALREADY NETTED ON,
  21. * IF APPLICATION DOES NOT WANT TO BE ABORTED,
  22. * STORE REASON CODE IN SEC-RETURN CODE FIELD IN NIT.
  23. * ELSE (OKAY TO ABORT APP),
  24. * CALL NP$ERR TO ISSUE DAYFILE MSG AND ABORT APP.
  25. * ELSE (FIRST TIME CALL TO QTOPEN),
  26. * IF MAX NUMBER OF CONNECTIONS IS ZERO,
  27. * IF APPLICATION DOES NOT WANT TO BE ABORTED,
  28. * STORE REASON CODE IN SEC-RETURN CODE FIELD IN NIT.
  29. * ELSE (OKAY TO ABORT APP),
  30. * CALL NP$ERR TO ISSUE DAYFILE MSG AND ABORT APP.
  31. * ELSE (NONZERO VALUE FOR MAX NUM OF CONNECTIONS),
  32. * LOOP 100 TIMES OR UNTIL NETON STATUS IS NOT NAM NOT AVAIL.
  33. * CALL NETON ROUTINE TO CONNECT TO NAM.
  34. * SET UP FIELD IN NIT TO INTRODUCE DELAY.
  35. * IF NETON STATUS IS NONZERO,
  36. * IF APPLICATION DOES NOT WANT TO BE ABORTED,
  37. * STORE REASON CODE IN SEC-RETURN CODE FIELD IN NIT.
  38. * ELSE (OKAY TO ABORT APP),
  39. * ELSE (NETON REQUEST WAS SUCCESSFUL),
  40. * COMPLETE INITIALIZING NIT.
  41. *
  42. * 4. ENTRY CONDITIONS.
  43. * PARAMETER (NITADDRESS) STARTING ADDRESS OF NETWORK
  44. * INFORMATION TABLE.
  45. *
  46. * 5. EXIT CONDITIONS.
  47. * NIT$RC = 0 IF QTOPEN COMPLETED SUCCESSFULLY.
  48. * REST OF NIT IS ALSO INITIALIZED.
  49. * = NONZERO IF QTOPEN DID NOT COMPLETE
  50. * SUCCESSFULLY. NIT$S$RC
  51. * CONTAINS REASON IT FAILED.
  52. *
  53. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  54. * AIPDEF AIP CONSTANTS DEFINITIONS
  55. * NP$CRT CONTROL DATA SYSTEMS COPYRIGHT
  56. * QTRMBUF QTRM BUFFER COMMON BLOCK
  57. * QTRMCOM QTRM COMMON VARIABLES
  58. * QTRMNIT QTRM NETWORK INFORMATION TABLE TEMPLATE
  59. *
  60. * 7. ROUTINES CALLED.
  61. * NP$ERR AIP ERROR DAYFILE ROUTINE.
  62. * NETFUNC AIP CHANGE PROCESSING ROUTINE.
  63. * NETON AIP NETWORK CONNECTION.
  64. * NETPUT AIP TRANMIT DOWNLINE MESSAGE.
  65. *
  66. * 8. DAYFILE MESSAGES.
  67. * NETWORK APPLICATION ABORTED, RC = 80.
  68. * QTOPEN: DUPLICATE QTOPEN.
  69. *
  70. * NETWORK APPLICATION ABORTED, RC = 81.
  71. * QTOPEN: NIT NUM-TERMS FIELD IS ZERO.
  72. *
  73. * NETWORK APPLICATION ABORTED, RC = 82.
  74. * QTOPEN: NETON REJECTED.
  75. *
  76. * NETWORK APPLICATION ABORTED, RC = 83.
  77. * QTOPEN: NETWORK NOT AVAILABLE.
  78. *
  79. *
  80.  #
  81. *ENDIF
  82. #
  83.   CONTROL DEFINITIONS.
  84. #
  85. CONTROL PRESET;
  86. CONTROL PACK;
  87. CONTROL DISJOINT;
  88. CONTROL INERT;
  89. CONTROL FASTLOOP;
  90.  
  91. #
  92.   XREFS / XDEFS
  93. #
  94. XREF PROC NP$ERR; # AIP ERROR DAYFILE ROUTINE #
  95. XREF PROC NETFUNC; # AIP CHANGE PROCESSING ROUTINE #
  96. XREF PROC NETON; # AIP CONNECT TO NETWORK #
  97. XREF PROC NETPUT;
  98. #
  99.   STANDARD DEFS
  100. #
  101. *CALL NP$CRT
  102.  
  103. #
  104.   DUMMY ARRAY USED AS TEMPORARY
  105. #
  106. BASED ARRAY DUMMY[0:0];
  107. BEGIN
  108. ITEM DUMMY$FLAG B(0,0,1);
  109. ITEM DUMMY$ITEM U(0,0,60);
  110. END
  111.  
  112. #
  113.   INPUT PARAMETERS
  114. #
  115. ARRAY NITADDRESS ;; #STARTING ADDRESS OF NIT #
  116.  
  117. #
  118.   QTRMCOM IS COMPILED INLINE TO PRESET COMMON.
  119. #
  120.  
  121. #
  122.   LOCAL VARIABLES
  123. #
  124. ITEM NETONCODE I; # RETURN STATUS FROM NETON #
  125. ITEM LENGTH I; #LENGTH OF TERMINAL ENTRY PORTION OF NIT #
  126. ITEM TEMP I; #FOR LOOP TEMPORARY VARIABLE #
  127. ITEM RETRY I; # FOR LOOP VARIABLE FOR RETRYING NETON. #
  128. ITEM COMMXCN U; # A COMBINATION OF 2 MAX CONNECTION LIMIT:#
  129. # . BIT 48-59: NIT$NO$TERMS #
  130. # . BIT 36-47: NIT$NUMRCNS #
  131.  
  132. BEGIN
  133. P<NIT> = LOC(NITADDRESS); # SET BASE OF NIT #
  134. NIT$ADDR = P<NIT>; # SAVE NIT ADDRESS IN COMMON #
  135. NIT$RC[0] = S"NETONREJ"; # INIT RC TO QTOPEN REJECT #
  136. IF NETON$STATUS
  137. THEN # DUPLICATE QTOPEN CALL #
  138. BEGIN
  139. IF NOABTNETONA
  140. THEN # DO NOT ABORT APP FOR BAD CALL #
  141. BEGIN
  142. NIT$S$RC[0] = S"DUPQTOPEN"; # REASON FOR QTOPEN REJECT #
  143. END
  144. ELSE # ABORT APP FOR BAD QTOPEN CALL #
  145. BEGIN
  146. NP$ERR("80"); # DUPLICATE QTOPEN. #
  147. END
  148. END
  149. ELSE # FIRST TIME CALL TO QTOPEN #
  150. BEGIN
  151. IF NIT$NO$TERMS EQ 0
  152. THEN # MAX NO OF CONNECTIONS IS ZERO #
  153. BEGIN
  154. IF NOABTNETONA
  155. THEN # DO NOT ABORT APP FOR BAD CALL #
  156. BEGIN
  157. NIT$S$RC[0] = S"ZEROCONS"; # REASON FOR QTOPEN REJECT #
  158. END
  159. ELSE # ABORT APP FOR BAD QTOPEN CALL #
  160. BEGIN
  161. NP$ERR("81"); # MAX NO OF CONNECTIONS IS ZERO #
  162. END
  163. END
  164. ELSE # GOOD VALUE FOR MAX NO OF CONS #
  165. BEGIN
  166. NETONCODE = 1; # INIT TO NAM NOT AVAILABLE #
  167. FOR RETRY = 0 STEP 1 WHILE (NETONCODE EQ 1) AND
  168. (RETRY LQ 100 )
  169. DO
  170. BEGIN
  171. P<DUMMY> = LOC(NIT$NSUP[0]); # LOCATION OF NSUP WORD. #
  172. COMMXCN = NIT$NUMRCNS[0]*4096 + NIT$NO$TERMS[0];
  173. NETON(NIT$APP$NAME[0],DUMMY,NETONCODE,1,COMMXCN);
  174. #
  175.   THE FOLLOWING INITIALIZATION STATEMENTS ARE INCLUDED IN
  176.   THE FOR LOOP IN ORDER TO INCREASE THE AMOUNT OF TIME
  177.   BETWEEN UNSUCESSFUL NETONS.
  178. #
  179. IF (NIT$CHAR$SET[0] LS CT60TRANS) OR
  180. ((NIT$CHAR$SET[0] GR CT12ASCII) AND
  181. (NIT$CHAR$SET[0] NQ 10) AND
  182. (NIT$CHAR$SET[0] NQ 11))
  183. THEN # DEFAULT TO DISPLAY CODE #
  184. BEGIN
  185. NIT$CHAR$SET[0] = CT6DISPLAY; # DISPLAY CODE CHAR SET VAL#
  186. ICTX[0] = FALSE; # SET NO TRANSPARENT INPUT FLAG #
  187. ICTD[0] = CT6DISPLAY; # DISPLAY CODE CHAR SET VALUE #
  188. END
  189. ELSE # APP SPECIFIED OTHER CHAR SET #
  190. BEGIN
  191. IF NIT$XPTSET[0] NQ 0
  192. THEN # TRANSPARENT INPUT ALLOWED #
  193. BEGIN
  194. ICTX[0] = TRUE; # SET TRANSPARENT INPUT ALLOWED #
  195. END
  196. ICTD[0] = NIT$PUTSET[0]; # INPUT CHARACTER SET #
  197. END
  198. NIT$S$RC[0] = 0; # ZERO SECONDARY RETURN CODE. #
  199. NIT$NXAP$NUM[0] = 0; # ZERO NEXT APPLICATION FIELD. #
  200. SUPDTW[0] = 1; # INIT DEVICE TYPE SUPPORT FLAG #
  201. # TO SUPPORT ONLY DEVICE TYPE 0 #
  202. IF NIT$SUPPAA EQ 1
  203. THEN # IF APP SUPPORTS A-TO-A CON #
  204. BEGIN
  205. SUPTRAA[0] = TRUE; # SUPPORT INTRAHOST A-A CON FLAG#
  206. SUPTERA[0] = TRUE; # SUPPORT INTERHOST A-A CON FLAG#
  207. END
  208. P<DUMMY> = LOC(NIT$WD0[1]);
  209. LENGTH = NIT$NO$TERMS[0] * 10 - 1;
  210. FOR TEMP = 0 STEP 1 UNTIL LENGTH
  211. DO
  212. BEGIN
  213. DUMMY$ITEM[TEMP] = 0; # ZERO FILL TERMINAL ENTRIES. #
  214. END
  215. END # END OF FOR LOOP. #
  216. IF NETONCODE NQ 0
  217. THEN # NETON HAS FAILED #
  218. BEGIN
  219. NIT$SEC$RC[0] = NETONCODE; # REASON FOR NETON REJECT #
  220. IF NOT NOABTNETONA
  221. THEN # ABORT APP CAUSE NETON FAILED #
  222. BEGIN
  223. IF NETONCODE EQ 1
  224. THEN # NAM WAS NOT AVAILABLE #
  225. BEGIN
  226. NP$ERR("83");
  227. END
  228. ELSE # NAM REJECTED NETON #
  229. BEGIN
  230. NP$ERR("82");
  231. END
  232. END
  233. END
  234. ELSE # NETON COMPLETED SUCCUSSFULLY #
  235. BEGIN
  236. #
  237.   NETON OK.
  238. #
  239. NIT$RC[0] = 0; # ASSUME NETON ACCEPTED #
  240. AUTOBREAK = FALSE; # INIT AUTOMATIC BREAK PROC FLG #
  241. BREAKMARK = FALSE; # INIT NOTIFY ON BI/MARK FLAG #
  242. CONINIT = FALSE; # INIT NOTIFY ON CON/REQ FLAG #
  243. CONPOLL = FALSE; # INIT CONNECTION POLLING FLAG #
  244. INACTIVE = FALSE; # INIT NOTIFY ON CON IDLE FLAG #
  245. KDISAS = FALSE; # INIT K-DISPLAY ASSIGNED FLAG #
  246. KDISPLAY = FALSE; # INIT K-DISPLAY SUPPORT FLAG #
  247. REQAA = FALSE; # INIT CON/ACRQ OUTSTANDING FLG #
  248. NETON$STATUS = TRUE; # NETON COMPLETE. #
  249. PMCONV = 0; # INIT CONVERT PM MSG FLAG #
  250. PRUDTW[0] = 0; # INIT PRU/ON PROCESSING FLAG #
  251. USERINTR = FALSE; # INIT NOTIFY ON INTR/USR FLAG #
  252. IGNORE = FALSE; # INIT NOT SEND HOP/ALT FLAG #
  253.  
  254. NETFUNC(1); # CHANGE AIP NETWAIT PROCESSING #
  255.  
  256. P<DUMMY> = LOC(NIT$WD0[0]);# ADDR OF NIT HEADER #
  257. DUMMY$ITEM[2] = 0; # CLEAR WORD 3 OF NIT HEADER #
  258. DUMMY$ITEM[3] = 0; # CLEAR WORD 4 OF NIT HEADER #
  259. DUMMY$ITEM[7] = 0; # CLEAR WORD 8 OF NIT HEADER #
  260. DUMMY$ITEM[8] = 0; # CLEAR WORD 9 OF NIT HEADER #
  261. IF SUPTERA[0]
  262. THEN # RESET SUPPORT A-A FLAG IN NIT #
  263. BEGIN
  264. NIT$SUPPAA[0] = 1;
  265. END
  266. NIT$XSLEEP[0] = 0; # INIT EXTENDED SLEEP FIELD TO 0#
  267. #
  268.   INITIALIZE ASCII TO DISPLAY CODE CONVERSION TABLE
  269. #
  270. CONVW[ 0] = O"55555555555555555555"; # 00010203040506070809#
  271. CONVW[ 1] = O"55555555555555555555"; # 0A0B0C0D0E0F10111213#
  272. CONVW[ 2] = O"55555555555555555555"; # 1415161718191A1B1C1D#
  273. CONVW[ 3] = O"55555566646053636770"; # 1E1F2021222324252627#
  274. CONVW[ 4] = O"51524556564657503334"; # 28292A2B2C2D2E2F3031#
  275. CONVW[ 5] = O"35363740414243440077"; # 32333435363738393A3B#
  276. CONVW[ 6] = O"72547371740102030405"; # 3C3D3E3F404142434445#
  277. CONVW[ 7] = O"06071011121314151617"; # 464748494A4B4C4D4E4F#
  278. CONVW[ 8] = O"20212223242526273031"; # 50515253545556575859#
  279. CONVW[ 9] = O"32617562766574010203"; # 5A5B5C5D5E5F60616263#
  280. CONVW[10] = O"04050607101112131415"; # 6465666768696A6B6C6D#
  281. CONVW[11] = O"16172021222324252627"; # 6E6F7071727374757677#
  282. CONVW[12] = O"30313261756276555555"; # 78797A7B7C7D7E7F #
  283. P<DUMMY> = O"67"; # WRD CONTAINING 63 CHAR SET FLG#
  284. IF NOT DUMMY$FLAG[0]
  285. THEN # 63 CHARACTER SET MACHINE #
  286. BEGIN
  287. CONVW[ 3] = O"55555566646053556770";
  288. CONVW[ 5] = O"35363740414243446377";
  289. END
  290. END
  291. END
  292. END
  293. RETURN; # QTOPEN COMPLETE. #
  294. END
  295. TERM
cdc/nos2.source/nam5871/qtopen.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator