User Tools

Site Tools


cdc:nos2.source:nam5871:qtget

Table of Contents

QTGET

Table Of Contents

  • [00005] PROC QTGET(WSA)
  • [00329] PROC NP$ERR
  • [00330] PROC NETDBG
  • [00331] PROC NETGET
  • [00332] PROC NETGETL
  • [00333] PROC NETPUT
  • [00334] PROC NETOFF
  • [00335] PROC NETWAIT
  • [00336] PROC QTENDT
  • [00337] PROC QTTIP

Source Code

QTGET.txt
  1. *DECK QTGET
  2. USETEXT AIPDEF
  3. USETEXT QTRMBUF
  4. USETEXT QTRMNIT
  5. PROC QTGET(WSA);
  6. *IF,DEF,IMS
  7. #
  8. *1DC QTGET
  9. *
  10. * 1. PROC NAME AUTHOR DATE
  11. * QTGET D. P. OCONNELL 78/12/12
  12. *
  13. * 2. FUNCTION DESCRIPTION
  14. * GET DATA MESSAGE FROM NETWORK AND PLACE IN
  15. * USERS MESSAGE BUFFER UNLESS A CONDITION ARISES
  16. * THAT THE USER SHOULD BE INFORMED OF. IN ANY
  17. * CASE INFORM THE USER OF WHAT WAS ACCOMPLISHED
  18. * BY PROVIDING A RETURN CODE.
  19. *
  20. * 3. METHOD USED
  21. * IF NETON NOT SUCCESSFUL YET,
  22. * CALL NP$ERR TO ISSUE DAYFILE MSG AND ABORT APP.
  23. * ELSE (NETON COMPLETED),
  24. * CALCULATE SIZE OF APPLICATION BUFFER.
  25. * LOOP UNTIL NECESSARY TO SEND RETURN CODE TO APP.
  26. * IF CONNECTION POLLING IS IN EFFECT AND CONNECTION NUMBER
  27. * IS NONZERO,
  28. * SET NULL BLOCK IN APP BLOCK HEADER WORD.
  29. * ELSE (NEED TO GET ASYNCH SUPERVISORY MESSAGES IF ANY),
  30. * CALL NETGET WITH ACN = 0 TO PICK UP ASYNC SUP MSGS.
  31. * IF VALID BLOCK TYPE IN APP BLOCK HEADER WORD,
  32. * IF RECEIVED ASYNCHRONOUS SUP MSG,
  33. * LOOP CHECKING FOR PFC RECOGNIZED BY QTRM.
  34. * IF RECOGNIZED PFC,
  35. * JUMP ACCORDING TO TYPE OF PFC:
  36. *
  37. * CON: IF CON/REQ SUP MSG,
  38. * IF DEVICE TYPE FOR NEW CONNECTION SUPPORTED,
  39. * SET UP NIT CONNECTION ENTRY.
  40. * IF APP WANTS TO BE INFORMED ABOUT CON/REQ,
  41. * SET FLAG TO STOP LOOPING AND INFORM APP.
  42. * IF DATA FROM PREVIOUS APP WHICH HAD CON,
  43. * COPY DATA TO APPLICATION BUFFER.
  44. * ELSE (APP DOES NOT SUPPORT THIS DEVICE TYPE),
  45. * REJECT CONNECTION.
  46. * ELSE (NOT CON/REQ SUP MSG),
  47. * IF CON/CB SUP MSG,
  48. * IF OKAY TO SEND CON/END SUP MSG,
  49. * CALL QTENDT TO TERMINATE CONNECTION.
  50. * IF APP KNOWS ABOUT CONNECTION,
  51. * SET FLAG TO STOP LOOPING AND INFORM AP.
  52. * ELSE (APP NO LONGER HAS CONNECTION),
  53. * IF NOT TERMINATED CONNECTION,
  54. * SET FLAG TO STOP LOOPING AND INFORM AP.
  55. * ELSE (NOT CON/CB OR CON/REQ SUP MSG),
  56. * IF CON/ACRQ/A SUP MSG,
  57. * SET FLAG TO STOP LOOPING AND INFORM APP.
  58. * ELSE (MUST BE CON/END/N SUP MSG),
  59. * INIT NIT CONNECTION ENTRY.
  60. *
  61. * ERR: SET FLAG TO STOP LOOPING AND INFORM APP.
  62. *
  63. * FC: JUMP ACCORDING TO TYPE OF SFC:
  64. *
  65. * ACK: UPDATE NIT CONNECTION ENTRY.
  66. * IF RO/MARK NEEDS TO BE SENT DOWNLINE,
  67. * BUILD RO/MARK SYNC SUP MSG.
  68. * CALL QTTIP TO SEND RO/MARK SUP MSG.
  69. * ELSE (DO NOT NEED TO SEND RO/MARK),
  70. * IF TO/MARK NEEDS TO BE SENT DOWNLINE,
  71. * BUILD TO/MARK SYNC SUP MSG.
  72. * CALL QTTIP TO SEND TO/MARK SUP MSG.
  73. *
  74. * BRK: IF CONNECTION HAS NOT BEEN TERMINATED,
  75. * UPDATE NIT CONNECTION ENTRY.
  76. * BUILD FC/RST SUP MSG.
  77. * CALL NETPUT TO SEND FC/RST SUP MSG TO NAM.
  78. * SET FLAG TO STOP LOOPING AND INFORM APP.
  79. *
  80. * INACT: IF APPLICATION STILL HAS CONNECTION,
  81. * IF APPLICATION KNOWS ABOUT CONNECTION,
  82. * IF APPLICATION WANTS TO BE INFORMED,
  83. * SET FLAG TO STOP LOOPING AND INFORM AP.
  84. * ELSE (APP DOES NOT KNOW ABOUT CONNECTION),
  85. * CALL QTENDT TO TERMINATE CONNECTION.
  86. *
  87. * INIT: IF WAITING FOR FC/INIT/R SUP MSG,
  88. * BUILD FC/INIT/N FROM FC/INIT/R.
  89. * CALL NETPUT TO SEND FC/INIT/N TO NAM.
  90. * UPDATE NIT CONNECTION ENTRY.
  91. * IF PRU/ON PROCESSING,
  92. * BUILD PRU/ON/R SUP MSG.
  93. * CALL NETPUT TO SEND PRU/ON/R TO NAM.
  94. * ELSE (NO PRU/ON SUP MSG PROCESSING),
  95. * SET FLAG TO STOP LOOPING AND INFORM APP.
  96. *
  97. * NAK: IF CONNECTION HAS NOT BEEN TERMINATED,
  98. * CALL QTENDT TO TERMINATE CONNECTION.
  99. * SET FLAG TO STOP LOOPING AND INFORM APP.
  100. *
  101. * RST: IF EXPECTING FC/RST SUP MSG,
  102. * UPDATE NIT CONNECTION ENTRY.
  103. * SET FLAG TO STOP LOOPING AND INFORM APP.
  104. *
  105. * SHUT: IF FORCED SHUTDOWN,
  106. * CALL NETOFF TO TERMINATE LINK TO NAM.
  107. * SET FLAG TO STOP LOOPING AND INFORM APP.
  108. *
  109. * TCH: UPDATE NIT CONNECTION ENTRY.
  110. *
  111. * INTR: IF INTR/RSP SUP MSG,
  112. * SET FLAG TO STOP LOOPING AND INFORM APP.
  113. * ELSE (MUST BE INTR/USR RECEIVED),
  114. * IF CONNECTION HAS NOT BEEN TERMINATED,
  115. * IF USER BREAK FROM TERMINAL,
  116. * SET FLAG TO STOP LOOPING AND INFORM APP.
  117. * UPDATE NIT CONNECTION ENTRY.
  118. * IF QTRM NEEDS TO SEND RO/MARK SUP MSG,
  119. * BUILD RO/MARK SYNC SUP MSG.
  120. * CALL QTTIP TO SEND RO/MARK SUP MSG.
  121. * ELSE (NOT USER BREAK FROM TERMINAL),
  122. * UPDATE NIT CONNECTION ENTRY.
  123. * BUILD INTR/RSP SUP MSG.
  124. * CALL NETPUT TO SEND SUP MSG TO NAM.
  125. *
  126. * HOP: SET FLAG TO STOP LOOPING.
  127. * JUMP ACCORDING TO TYPE OF SFC:
  128. *
  129. * BRK: IF APPLICATION SUPPORTS K-DISPLAY,
  130. * SET RETURN CODE TO INFORM APP.
  131. * ELSE (APP DOES NOT SUPPORT K-DISPLAY,
  132. * CLEAR FLAG TO CONTINUE LOOPING.
  133. *
  134. * CMD: IF APPLICATION SUPPORTS K-DISPLAY,
  135. * SET RETURN CODE TO INFORM APP.
  136. * UPDATE NIT.
  137. * COPY OPERATOR TYPEIN TO APP BUFFER.
  138. * ELSE (APP DOES NOT SUPPORT K-DISPLAY,
  139. * CLEAR FLAG TO CONTINUE LOOPING.
  140. *
  141. * TRCE: CALL NETDBG TO TURN ON AIP TRACING.
  142. * CLEAR FLAG TO CONTINUE LOOPING.
  143. *
  144. * DU: SET RETURN CODE TO INFORM APP.
  145. *
  146. * IG: SET INTERNAL FLAG TO NOT SEND HOP/ALT.
  147. * CLEAR FLAG TO CONTINUE LOOPING.
  148. *
  149. * STRT: CLEAR INTERNAL FLAG TO NOT SEND HOP/ALT.
  150. * IF APPLICATION SUPPORTS K-DISPLAY,
  151. * SET RETURN CODE TO INFORM APP.
  152. * COPY SCREEN SIZES TO APP BUFFER.
  153. * ELSE (APP DOES NOT SUPPORT K-DISPLAY),
  154. * CLEAR FLAG TO CONTINUE LOOPING.
  155. *
  156. * END: IF APPLICATION SUPPORTS K-DISPLAY,
  157. * SET RETURN CODE TO INFORM APP.
  158. * ELSE (APP DOES NOT SUPPORT K-DISPLAY),
  159. * CLEAR FLAG TO CONTINUE LOOPING.
  160. *
  161. * NOTR: CALL NETDBG TO TURN OFF AIP TRACING.
  162. * CLEAR FLAG TO CONTINUE LOOPING.
  163. *
  164. * RS: SET RETURN CODE TO INFORM APP.
  165. *
  166. * PAGE: IF APPLICATION SUPPORTS K-DISPLAY,
  167. * SET RETURN CODE TO INFORM APP.
  168. * ELSE (APP DOES NOT SUPPORT K-DISPLAY),
  169. * CLEAR FLAG TO CONTINUE LOOPING.
  170. *
  171. * REL: SET RETURN CODE TO INFORM APP.
  172. *
  173. * DB: SET RETURN CODE TO INFORM APP.
  174. *
  175. * DE: SET RETURN CODE TO INFORM APP.
  176. *
  177. * OFC: IF CONNECTION STILL ESTABLISHED,
  178. * SET FLAG TO STOP LOOPING.
  179. * IF OFC/ABORT/N RECEIVED,
  180. * UPDATE CONNECTION STATE IN NIT.
  181. * SET RETURN CODE TO INFORM APP.
  182. * RETURN ACCTNG AND LFN INFO TO APP.
  183. * ELSE (NOT OFC/ABORT/N),
  184. * IF OFC/DATA/N RECEIVED,
  185. * IF WAITING FOR END OF OUTPUT JOB,
  186. * UPDATE CONNECTION STATE IN NIT.
  187. * SET RETURN CODE TO INFORM APP.
  188. * ELSE (INFORM APP ABOUT OFC/DATA/N),
  189. * SET RETURN CODE TO INFORM APP.
  190. * ELSE (IF NOT OFC/ABORT/N NOR OFC/DATA/N),
  191. * IF OFC/EOO RECEIVED,
  192. * IF WAITING FOR END OF OUTPUT JOB,
  193. * UPDATE CONNECTION STATE IN NIT.
  194. * SET RETURN CODE TO INFORM APP.
  195. * ELSE (INFORM APP ABOUT END OF OUTPUT),
  196. * UPDATE CONNECTION STATE IN NIT.
  197. * SET RETURN CODE TO INFORM APP.
  198. * RETURN ACCTNG AND LFN INFO TO APP.
  199. * ELSE (EITHER OFC/STPD OR OFC/STP/N),
  200. * RETURN CURRENT PRU POSITION TO APP.
  201. * IF OFC/STPD RECEIVED,
  202. * UPDATE CONNECTION STATE IN NIT.
  203. * SET RETURN CODE TO INFORM APP.
  204. * IF PM MESSAGE,
  205. * IF APP WANTS PM MSG IN DISPLAY CD,
  206. * IF PM MSG IS TOO LARGE FOR BUF,
  207. * SET TRUCATION FLAG IN NIT.
  208. * REDUCE NO OF CHARS TO CONVERT.
  209. * EXTRACT EACH CHAR IN PM MSG.
  210. * CONVERT EACH CHAR TO DISPLAY CD.
  211. * STORE DISPLAY CODE CHAR IN BUF.
  212. * ELSE (APP WANTS PM MSG AS IS),
  213. * IF PM MSG IS TOO LARGE FOR BUF,
  214. * SET TRUCATION FLAG IN NIT.
  215. * REDUCE NO OF WORDS TO COPY.
  216. * COPY PM MSG TO APP BUFFER.
  217. * STORE SIZE OF PM MSG IN NIT.
  218. * ELSE (MUST BE OFC/STP/N RECEIVED),
  219. * UPDATE CONNECTION STATE IN NIT.
  220. * SET RETURN CODE TO INFORM APP.
  221. *
  222. * PRU: SET FLAG TO STOP LOOPING.
  223. * IF ABNORMAL RESPONSE RECEIVED,
  224. * IF PRU/ON PROCESSING ON,
  225. * CALL QTENDT TO TERMINATE CONNECTION.
  226. * SET FLAG TO RESUME LOOPING.
  227. * ELSE (APP SENT PRU/ON SUP MSG),
  228. * UPDATE CONNECTION STATE IN NIT.
  229. * SET RETURN CODE TO INFORM APP.
  230. * ELSE (PRU CONNECTION ESTABLISHED),
  231. * UPDATE CONNECTION STATE IN NIT.
  232. * SET RETURN CODE TO INFORM APP.
  233. *
  234. * ELSE (NO SUPERVISORY MESSAGE RECEIVED),
  235. * IF CONNECTION POLLING IS IN EFFECT,
  236. * IF CONNECTION NUMBER IS NOT VALID,
  237. * SKIP TO END AND REJECT QTGET CALL.
  238. * ELSE (VALID CONNECTION NUMBER WAS SPECIFIED),
  239. * CALL NETGET WITH SPECIFIED ACN TO PICK UP DATA.
  240. * ELSE (LIST PROCESSING IS IN EFFECT),
  241. * CALL NETGETL TO PICK UP DATA.
  242. * JUMP ACCORDING TO BLOCK TYPE IN ABH:
  243. *
  244. * NULL: IF SLEEP IS ZERO,
  245. * SET FLAG TO STOP LOOPING AND INFORM APP.
  246. * ELSE (CALL NETWAIT IF NOTHING TO DO),
  247. * IF SLEEP IS NEGATIVE,
  248. * CALL NETWAIT FOR MAXIMUM TIME INTERVAL.
  249. * ELSE (SLEEP IS POSITIVE DIGIT),
  250. * IF NETWAIT HAS ALREADY BEEN CALLED,
  251. * SET FLAG TO STOP LOOPING AND INFORM APP.
  252. * ELSE (NETWAIT HAS NOT BEEN CALLED YET),
  253. * CALL NETWAIT FOR SLEEP TIME INTERVAL.
  254. *
  255. * CMD: IF BI/MARK SYNC SUP MSG RECEIVED,
  256. * IF CONNECTION HAS NOT BEEN TERMINATED
  257. * AND APP WANTS TO BE INFORMED,
  258. * SET FLAG TO STOP LOOPING AND INFORM APP.
  259. * ELSE (SYNC SUP MSG NOT BI/MARK),
  260. * CONTINUE PROCESSING AS DATA BLOCK.
  261. *
  262. * BLK:
  263. * MSG:
  264. * QBLK:
  265. * QMSG: IF CANCEL BIT NOT SET IN ABH,
  266. * UPDATE NIT CONNECTION ENTRY.
  267. * IF IBU BIT SET IN ABH,
  268. * CALL QTENDT TO TERMINATE CONNECTION.
  269. * SET FLAG TO STOP LOOPING AND INFORM APP.
  270. * IF QTRM IS IN MIDDLE OF AUTO BREAK PROCESSING,
  271. * IGNORE BLOCK.
  272. * ELSE (OKAY TO INFORM APP ABOUT DATA BLOCK),
  273. * IF DATA IS IN DISPLAY CODE,
  274. * BLANK FILL LAST WORD OF DATA.
  275. * IF ASCII DATA ON A-A DISPLAY CODE CONNECTION,
  276. * IF DATA BLOCK IS WRONG SIZE,
  277. * CALL QTENDT TO TERMINATE CONNECTION.
  278. * ELSE (DATA BLOCK IS RIGHT SIZE),
  279. * CONVERT COUNT OF CHARS TO DISPLAY CODE VAL.
  280. * SET FLAG TO STOP LOOPING AND INFORM APP.
  281. *
  282. * 4. ENTRY CONDITIONS
  283. * WSA STARTING ADDRESS OF BUFFER AREA IN APPLICATION
  284. * WHERE DATA IS TO BE DELIVERED TO.
  285. *
  286. * 5. EXIT CONDITIONS
  287. * NIT FIELDS UPDATED DEPENDING ON THE RETURN CODE.
  288. * NIT$RC RESPONSE RETURN CODE.
  289. *
  290. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  291. * AIPDEF NP$CRT QTRMBUF QTRMCOM
  292. * QTRMNIT
  293. *
  294. * 7. ROUTINES CALLED
  295. * NETDBG AIP TURN AIP TRACE ON/OFF.
  296. * NETGET AIP INPUT FROM NETWORK.
  297. * NETGETL AIP INPUT (LIST) FROM NETWORK.
  298. * NETOFF AIP DISCONNECT FROM NETWORK.
  299. * NETPUT AIP OUTPUT TO NETWORK.
  300. * NETWAIT AIP SUSPEND PROCESSING.
  301. * NP$ERR AIP ERROR DAYFILE ROUTINE.
  302. * QTENDT QTRM END CONNECTION.
  303. * QTTIP QTRM ROUTINE TO SEND SYNC SUP MSG
  304. *
  305. * 8. DAYFILE MESSAGES
  306. * NETWORK APPLICATION ABORTED, RC = 71.
  307. * QTGET: REQUEST INVALID BEFORE QTOPEN.
  308. *
  309. * NETWORK APPLICATION ABORTED, RC = 99.
  310. * QTGET: NETWORK LOGICAL ERROR.
  311. *
  312. *
  313.  #
  314. *ENDIF
  315.  
  316. #
  317.   CONTROL DEFINITIONS
  318. #
  319. CONTROL PRESET;
  320. CONTROL PACK;
  321. CONTROL DISJOINT;
  322. CONTROL INERT;
  323. CONTROL FASTLOOP;
  324. #
  325.   ROUTINES CALLED
  326. #
  327. XREF
  328. BEGIN
  329. PROC NP$ERR; # AIP ROUTINE TO DAYFILE ERROR MESSAGE #
  330. PROC NETDBG; # AIP ROUTINE TO TURN ON/OFF AIP TRACING #
  331. PROC NETGET; # AIP PROCEDURE TO GET A BLOCK #
  332. PROC NETGETL; # AIP PROCEDURE TO GET A BLOCK ON LIST #
  333. PROC NETPUT; # AIP PROCEDURE TO OUTPUT A BLOCK #
  334. PROC NETOFF; # AIP PROCEDURE TO TERMINATE NAM ACCESS #
  335. PROC NETWAIT; # AIP PROCEDURE TO SUSPEND PROCESSING #
  336. PROC QTENDT; # END A CONNECTION #
  337. PROC QTTIP; # QTRM ROUTINE TO ISSUE SYNC SUP MSG #
  338. END
  339. #
  340.   STANDARD DEFS
  341. #
  342.  
  343. *CALL CRCOM
  344. *CALL QTRMCOM
  345.  
  346.  
  347. #
  348.   INPUT VARIABLES.
  349. #
  350. ARRAY WSA [0:0] S(1);
  351. # STARTING ADDRESS OF BUFFER IN #
  352. # USER AREA WHERE DATA BLOCK SHOULD #
  353. # BE RETURNED #
  354. BEGIN
  355. ITEM WSA$WORD U(00,00,60); # WHOLE WORD #
  356. ITEM WSA$FC U(00,00,16); # PFC/SFC FOR SYNCHRONOUS COMMANDS #
  357. ITEM WSA$PC U(00,00,08); # PFC FOR SYN COMMAND IN ACT=2 #
  358. ITEM WSA$SC U(00,10,06); # SFC FOR SYN COMMAND IN ACT=2 #
  359. ITEM WSA$P1 U(00,00,12); # PFC FOR SYN COMMAND IN ACT=3 #
  360. ITEM WSA$S1 U(00,14,10); # SFC FOR SYN COMMAND IN ACT=3 #
  361. END
  362.  
  363.  
  364. #
  365.   LOCAL VARIABLES
  366. #
  367.  
  368. ARRAY PFC$ARRAY [0:8];
  369. BEGIN
  370. ITEM PFC$VALUE U(0,0,60) = [CON,ERR,FC,SHUT,TCH,INTR,HOP,OFC,
  371. PRU];
  372. END
  373.  
  374. ITEM RESPONSE B; # EXIT CONTROL VARIABLE #
  375. ITEM NOSLEEP B; # POSITIVE SLEEP CONTROL VARIABLE#
  376. ITEM SLEEP I; #INTERMEDIATE SLEEP VARIABLE#
  377. ITEM MAXWORDS U; # LENGTH USER BUFFER AREA (WORDS)#
  378. ITEM TEMP1 I; # TEMPORARY VARIABLES #
  379. ITEM TEMP2 I; # REASON FOR BREAK #
  380. ITEM TEMP3 I; # TEMPORARY VARIABLE #
  381. ITEM WORDS I; # NUMBER OF FULL WORDS IN BLOCK #
  382. ITEM CHARS I; # NUMBER OF CHARACTORS IN LAST WORD #
  383. ITEM CHARSET I; # CURRENT INPUT CHARACTER SET #
  384. ITEM ACN U; # APPLICATION CONNECTION NUMBER #
  385. ITEM FOUNDMATCH B; # FLAG FOR FINDING MATCH ON PFC SCAN #
  386. ITEM I I; # INDUCTION VARIABLE #
  387. ITEM J I; # INDUCTION VARIABLE #
  388. ITEM NEWCHAR I; # DISPLAY CODE CHAR FROM PM MESSAGE #
  389. ITEM NEWCP I; # CHAR POSITION INDEX FOR PM MESSAGE #
  390. ITEM NEWWP I; # WORD POSITION INDEX FOR PM MESSAGE #
  391. ITEM OLDCP I; # CHAR POSITION INDEX FOR WSA BUFFER #
  392. ITEM OLDWP I; # WORD POSITION INDEX FOR WSA BUFFER #
  393.  
  394. BASED ARRAY MEM [0:0] S(1); # BASED ARRAY FOR COPYING MEMORY #
  395. BEGIN
  396. ITEM MEM$WORD U(0,0,60); # ONE CENTRAL MEMORY WORD #
  397. END
  398.  
  399. #
  400.   SWITCH DEFINITIONS
  401. #
  402. SWITCH SWTCH$ABT$L ABT$L$NULL, ABT$L$BLK, ABT$L$MSG, ABT$L$CMD,,,
  403. ABT$L$QBLK,ABT$L$QMSG;
  404.  
  405. SWITCH SWTCH$PFC A$PFC$CON, A$PFC$ERR, A$PFC$FC,
  406. A$PFC$SHUT,A$PFC$TCH,A$PFC$INTR,
  407. A$PFC$HOP,A$PFC$OFC,A$PFC$PRU;
  408.  
  409. SWITCH SWTCH$FC FC$BRK,FC$RST,FC$ACK,FC$NAK,FC$INACT,,,FC$INIT;
  410.  
  411. SWITCH SWTCH$HOP HOP$BRK,HOP$CMD,HOP$TRCE,HOP$DU,HOP$IG,
  412. HOP$STRT,HOP$END,HOP$NOTR,HOP$RS,,,,
  413. HOP$PAGE,HOP$REL,HOP$DB,HOP$DE;
  414.  
  415. CONTROL EJECT;
  416.  
  417. #
  418.   BEGIN QTGET PROCEDURE
  419. #
  420. BEGIN
  421. IF NOT NETON$STATUS # CHECK IF NETON WAS COMPLETED #
  422. THEN
  423. NP$ERR("71"); # REQUEST INVALID BEFORE QTOPEN.#
  424.  
  425. RESPONSE = FALSE; # INITIALIZE RESPONSE FLAG #
  426.  
  427. NOSLEEP = FALSE; # PRESET POSITIVE SLEEP OK. #
  428. P<NIT> = NIT$ADDR; # ADDRESS OF NIT TABLE #
  429. NIT$CTLC[0] = 0; # INIT TEXT LENGTH RECEIVED FIELD #
  430. NIT$TRUNC[0] = 0; # INIT TRUNCATION FLAG TO FALSE #
  431. #
  432.   DETERMINE APPLICATION BUFFER LENGTH IN WORDS
  433. #
  434. MAXWORDS = NIT$MTLC[0]; # MAX BUF LENGTH IN CHARACTER SET LENGTH#
  435. IF ICTD[0] EQ CT8ASCII
  436. THEN # CHARACTER SET IS 8 BIT ASCII #
  437. BEGIN
  438. MAXWORDS = (NIT$MTLC[0] * 2) / 15; # NO OF CM WORDS #
  439. END
  440. ELSE # NOT 8 BIT ASCII CHARACTER SET #
  441. BEGIN
  442. IF ICTD[0] EQ CT12ASCII
  443. THEN # CHARACTER SET IS 12 BIT ASCII #
  444. BEGIN
  445. MAXWORDS = NIT$MTLC[0] / 5; # NO OF CM WORDS #
  446. END
  447. ELSE # NOT 12 BIT ASCII CHARACTER SET EITHER #
  448. BEGIN
  449. IF ICTD[0] EQ CT6DISPLAY
  450. THEN # CHARACTER SET IS 6 BIT DISPLAY CODE #
  451. BEGIN
  452. MAXWORDS = NIT$MTLC[0] / 10; # NO OF CM WORDS #
  453. END
  454. END
  455. END
  456. #
  457.   LOOP UNTIL SOME RESPONSE IS AVAILABLE FOR USER
  458. #
  459. FOR TEMP1=TEMP1 WHILE NOT RESPONSE DO
  460. BEGIN # BEGIN RESPONSE CONTROLLED LOOP #
  461. #
  462.   IF CONNECTION POLLING IS IN EFFECT AND THE CONNECTION NUMBER
  463.   SPECIFIED WAS NONZERO, THEN WE DO NOT WANT TO GET ANY
  464.   ASYNCHRONOUS SUPERVISORY MESSAGES. OTHERWISE, GET ASYNCHRONOUS
  465.   SUPERVISORY MESSAGES.
  466. #
  467. IF (CONPOLL ) AND # CONNECTION POLLING IN EFFECT #
  468. (NIT$CON[0] NQ 0) # CONNECTION NUMBER IS NONZERO #
  469. THEN
  470. BEGIN
  471. ABHABT[0] = APPNULL; # ASSUME NO SUP MSG WAS FOUND #
  472. END
  473. ELSE # NEED TO GET ASYNC SUP MSGS #
  474. BEGIN
  475. NETGET(0,HEADER,SUP$MES,63); # GET ASYNC SUP MSGS #
  476. END
  477. # CHECK FOR VALID BLOCK TYPE #
  478. IF ABHABT[0] EQ APPNULL OR ABHABT[0] EQ APPCMD
  479. THEN
  480. BEGIN
  481. # CHECK IF BLOCK TYPE IS SUP OR NULL #
  482. IF ABHABT[0] EQ APPCMD
  483. THEN
  484.  
  485.  
  486.  
  487. #
  488.   ASYNC SUPERVISORY MESSAGE BLOCK PROCESSING.
  489. #
  490. BEGIN
  491. FOUNDMATCH = FALSE; # INIT TO NO MATCH ON PFC SCAN #
  492. FOR I = 0 STEP 1 WHILE (I LQ 8 ) AND
  493. (NOT FOUNDMATCH)
  494. DO # CHECK FOR VALID PFC-S #
  495. BEGIN
  496. IF PFC[0] EQ PFC$VALUE[I]
  497. THEN # VALID PFC #
  498. BEGIN
  499. GOTO SWTCH$PFC[I];
  500.  
  501. A$PFC$CON:
  502. #
  503.   SUPERVISORY CONNECTION MESSAGE RECIEVED
  504. #
  505. BEGIN
  506. ACN = CONACN[0]; # APPLICATION CONNECTION NUMBER #
  507. NIT$CON[0] = ACN;
  508. # CHECK IF CON/REQ OR OTHER CON #
  509. IF SFC[0] EQ REQ
  510. THEN
  511. BEGIN
  512. #
  513.   CHECK IF DEVICE TYPE OF THIS CONNECTION IS SUPPORTED
  514. #
  515. IF ((SUPDTW[0] LAN 2**(COND[0])) NQ 0)
  516. THEN # THIS DEVICE TYPE IS SUPPORTED #
  517. BEGIN # SET UP NIT ENTRY FOR NEW CON #
  518. NIT$WD0[ACN] = 0;
  519. NIT$WD1[ACN] = 0;
  520. NIT$WD2[ACN] = 0;
  521. NIT$WD3[ACN] = 0;
  522. NIT$WD4[ACN] = 0;
  523. NIT$WD5[ACN] = 0;
  524. NIT$WD6[ACN] = 0;
  525. NIT$WD7[ACN] = 0;
  526. NIT$WD8[ACN] = 0;
  527. NIT$WD9[ACN] = 0;
  528. NIT$STATE[ACN] = S"LIMBO";
  529. NIT$RC[0] = S"CON$REQ"; # SET NIT RETURN CODE #
  530. NIT$DEVTYP[ACN] = COND[0];
  531. NIT$SL[ACN] = CONSL[0]; # SECURITY LEVEL #
  532. NIT$ICT[ACN] = ICTD[0]; # ICT FOR DATA #
  533. NIT$SICT[ACN] = CT8ASCII; # ICT FOR SYNC SUP MSG#
  534. NIT$CDCNT[ACN] = CONNET[0];# CDCNET FLAG #
  535.  
  536. NIT$UPS[ACN] = CONUPS[0]; # UPLINE BLOCK SIZE #
  537. NIT$DPS[ACN] = CONDPS[0]; # DOWNLINE BLOCK SIZE #
  538.  
  539. IF ( (COND[0] NQ DT$INTA) AND # INTRAHOST A-A #
  540. (COND[0] NQ DT$INTE) ) # INTERHOST A-A #
  541. THEN
  542. BEGIN
  543. NIT$TNAME[ACN] = CONTNM[0];
  544. NIT$TC[ACN] = CONT[0];
  545. NIT$PW[ACN] = CONPW[0];
  546. NIT$PL[ACN] = CONPL[0];
  547. NIT$FAMNAME[ACN]=CONFAM[0]; # FAMILY NAME #
  548. NIT$USERNAME[ACN]=CONUSE[0]; # USER NAME #
  549. IF CONLST[0] EQ 8
  550. THEN # THIS IS A LOANED CONNECTION #
  551. BEGIN
  552. NIT$LOAN[ACN] = 1; # SET LOAN FLAG #
  553. END
  554. ELSE # NOT SEC APP RECEIVING LOANED CONNECTION#
  555. BEGIN
  556. IF (CONLST[0] GQ 16) AND
  557. (CONLST[0] LQ 23)
  558. THEN # RECONNECTION OF LOANED CONNECTION #
  559. BEGIN
  560. NIT$STATE[ACN] = S"LENDRET"; # SET CON ST #
  561. NIT$RC[0] = S"LEND$RET"; # SET RETURN CODE#
  562. NIT$SB$RC[0] = CONLST[0]; # SET SEC RC #
  563. END
  564. END
  565. CONACT[0] = ICTD[0]; # INPUT CHARACTER TYPE #
  566. END
  567. ELSE # APPL TO APPL CONNECTION #
  568. BEGIN
  569. IF CONABN[0] NQ 0
  570. THEN
  571. BEGIN
  572. NIT$STATE[ACN] = S"POSE";
  573. REQAA = FALSE;
  574. END
  575. NIT$HOSTID[ACN] = CONHID[0]; # APP NAME #
  576. CONACT[0] = ICTD[0]; # INPUT CHARACTER TYPE #
  577. IF ICTD[0] EQ CT6DISPLAY
  578. THEN # INPUT CHAR TYPE IS DISPLAY CODE #
  579. BEGIN
  580. CONACT[0] = CT8ASCII; # ICT IS 8 BIT ASCII #
  581. END
  582. END
  583. CONNXP[0] = NOT ICTX[0]; # REJECT TRANS INPUT #
  584. NIT$ABL[ACN] = CONABL[0];
  585. NIT$BSZ[ACN] = CONDBZ[0] ;
  586.  
  587. CONALN[0] = 1; # PUT TERMINAL ON LIST = 1 #
  588. RB[0] = TRUE;
  589. IF CONINIT
  590. THEN # APP WANTS TO BE INFORMED ABOUT CON/REQ #
  591. BEGIN
  592. RESPONSE = TRUE;
  593. TEMP2 = ABHTLC[0] - LCONREQ; # LENGTH OF DATA #
  594. IF TEMP2 NQ 0
  595. THEN # DATA WAS PASSED FROM PREVIOUS APP #
  596. BEGIN
  597. IF MAXWORDS GR TEMP2
  598. THEN # WSA BUFFER IS BIG ENOUGH FOR DATA #
  599. BEGIN
  600. NIT$CTLC[0] = TEMP2; # LENGTH OF DATA #
  601. END
  602. ELSE # WSA BUFFER WAS NOT BIG ENOUGH #
  603. BEGIN
  604. NIT$CTLC[0] = MAXWORDS; # LENGTH OF BUF #
  605. NIT$TRUNC[0] = 1; # DATA TRUNCATED FLAG #
  606. TEMP2 = MAXWORDS; # NO OF WORDS TO COPY #
  607. END
  608. P<MEM> = LOC(SUP$MES); # ADDR OF SUP MSG #
  609. FOR J = 0 STEP 1 UNTIL TEMP2 - 1
  610. DO # COPY PASSED DATA TO WSA BUFFER #
  611. BEGIN
  612. WSA$WORD[J] = MEM$WORD[J + LCONREQ];
  613. END
  614. END
  615. END
  616. END
  617. ELSE # REJECT BATCH OR A-A CONNECTION #
  618. BEGIN
  619. EB[0] = TRUE;
  620. CONRRA[0] = S"REJ";
  621. END
  622. CONSCT[0] = FALSE; # SET SYNC SUP MSG ACT = 2 #
  623. ABHTLC[0] = LCORQR;
  624. NETPUT(HEADER,SUP$MES);
  625. END
  626. ELSE # NOT CON/REQ SUPERVISORY MESSAGE #
  627. BEGIN
  628. # CHECK FOR CON/END, CON/CB OR CON/ACRQ/A #
  629. IF SFC[0] EQ CB
  630. THEN # CLEAN UP TABLES FOR BROKEN CONNECTION #
  631. BEGIN
  632. # CHECK IF USER SHOULD BE INFORMED #
  633. TEMP1 = NIT$STATE[ACN];
  634. TEMP3 = RC[0];
  635. IF (TEMP1 NQ STATE"LEND") AND
  636. (TEMP1 NQ STATE"LENT") AND
  637. (TEMP1 NQ STATE"WCONENDN")
  638. THEN # OKAY TO ISSUE CON/END SUP MSG #
  639. BEGIN
  640. NIT$PARMADR[0] = 0; # INIT DATA ADDR #
  641. QTENDT; # END A BROKEN CONNECTION #
  642. IF (CONINIT ) OR
  643. ( (TEMP1 NQ STATE"LIMBO" ) AND
  644. (TEMP1 NQ STATE"WAITPRU") )
  645. THEN # INFORM APP ABOUT CONNECTION BROKEN #
  646. BEGIN
  647. RESPONSE = TRUE;
  648. END
  649. IF TEMP1 EQ STATE"POSE"
  650. THEN # BAD CON/REQ RESPONSE CAUSED CON/CB #
  651. BEGIN
  652. NIT$RC[0] = S"ACRQ$ERR";
  653. NIT$S$RC[0] = TEMP3 + 32; # ADJUST SEC RC #
  654. END
  655. ELSE # NORMAL CONNECTION BROKEN #
  656. BEGIN
  657. NIT$RC[0] = S"CON$BROKEN";
  658. NIT$S$RC[0] = S"NORMRET"; # SET SEC-RC FIELD#
  659. NIT$SB$RC[0] = TEMP3; # RC FROM CON/CB #
  660. END
  661. END
  662. ELSE # APP DOES NOT HAVE CONNECTION #
  663. BEGIN
  664. IF TEMP1 NQ STATE"WCONENDN"
  665. THEN # NEED TO INFORM APP AND INIT NIT ENTRY #
  666. BEGIN
  667. RESPONSE = TRUE;
  668. NIT$RC[0] = S"LEND$CB";
  669. NIT$S$RC[0] = S"NORMRET"; # SET SEC-RC FIELD#
  670. NIT$SB$RC[0] = TEMP3; # RC FROM CON/CB #
  671. NIT$STATE[ACN] = S"NULL"; # INIT NIT ENTRY #
  672. END
  673. END
  674. END
  675. ELSE
  676. IF SFC[0] EQ ACRQ
  677. THEN # RECEIVED CON/ACRQ/A SUPERVISORY MESSAGE #
  678. BEGIN
  679. NIT$RC[0] = S"ACRQ$ERR";
  680. NIT$SB$RC = CONRAC[0]; # CON/ACRQ/A RC #
  681. NIT$SEC$RC = CONRAC2[0]; # CON/ACRQ/A SUB RC #
  682. REQAA = FALSE;
  683. NIT$CON[0] = 0;
  684. RESPONSE = TRUE;
  685. END
  686. ELSE # MUST BE CON/END/N SUPERVISORY MESSAGE #
  687. BEGIN
  688. IF NIT$STATE[ACN] EQ S"WCONENDN"
  689. THEN # TERMINATED CONNECTION #
  690. BEGIN
  691. NIT$STATE[ACN] = S"NULL";
  692. END
  693. ELSE # LOANED CONNECTION #
  694. BEGIN
  695. NIT$STATE[ACN] = S"LENT";
  696. END
  697. END
  698. END
  699. GOTO END$A$PFC;
  700. END
  701.  
  702. A$PFC$ERR:
  703. #
  704.   SUPERVISORY ERR MESSAGE BLOCK PROCESSING.
  705. #
  706. BEGIN
  707. #ERROR NETWORK LOGICAL ERROR ENCOUNTERED#
  708. NIT$RC[0] = S"LOGICERR"; # SET RETURN CODE #
  709. NIT$SEC$RC[0] = ERRRLG[0]; # SET SECONDARY RC #
  710. IF NOABTERRLGL
  711. THEN # DO NOT ABORT ON ERR/LGL SUP MSG #
  712. BEGIN
  713. RESPONSE = TRUE;
  714. END
  715. ELSE # ABORT APP WHEN WE RECEIVE ERR/LGL S M #
  716. BEGIN
  717. NP$ERR("99");
  718. END
  719. GOTO END$A$PFC;
  720. END
  721.  
  722. A$PFC$FC:
  723. #
  724.   SUPERVISORY FLOW OF CONTROL
  725.   MESSAGE BLOCK PROCESSING.
  726. #
  727. BEGIN
  728. ACN = FCACN[0];
  729. GOTO SWTCH$FC [SFC[0]];
  730.  
  731.  
  732.  
  733. FC$ACK:
  734. #
  735.   PROCESS AN ACKNOWLEDGEMENT.
  736. #
  737. BEGIN
  738. NIT$ACK$ABN[ACN] = FCABN[0];
  739. NIT$C$ABL[ACN] = NIT$C$ABL[ACN] + 1;
  740. NOSLEEP = TRUE; # POSITIVE SLEEP NOT OK. #
  741. IF (NIT$STATE[ACN] EQ S"WROMARK") OR
  742. (NIT$STATE[ACN] EQ S"WBIROMK") OR
  743. (NIT$STATE[ACN] EQ S"WTOMARK")
  744. THEN # WAITING FOR FC/ACK TO SEND SYNC SUP MSG #
  745. BEGIN
  746. CHARSET = NIT$CHAR$SET[0]; # SAVE OLD CHAR SET #
  747. NIT$CHAR$SET[0] = CT8ASCII; # APPL CHAR TYPE #
  748. NIT$CON[0] = ACN; # CONNECTION NUMBER #
  749. SPMSG0[0] = 0;
  750. IF NIT$STATE[ACN] EQ S"WTOMARK"
  751. THEN # WAITING TO SEND TO/MARK SUP MSG #
  752. BEGIN
  753. PFCSFC[0] = TOMARK; # PFC/SFC VALUE #
  754. NIT$CTLC[0] = LTOMARK; # LENGTH OF SUP MSG #
  755. END
  756. ELSE # WAITING TO SEND RO/MARK SUP MSG #
  757. BEGIN
  758. PFCSFC[0] = ROMARK; # PFC/SFC VALUE #
  759. NIT$CTLC[0] = LROMARK; # LENGTH OF SUP MSG #
  760. END
  761. QTTIP(SUP$MES); # SEND SYNC SUP MSG #
  762. NIT$CHAR$SET[0] = CHARSET; # RESTORE CHAR SET #
  763. IF (NIT$STATE[ACN] EQ S"WROMARK") OR
  764. (NIT$STATE[ACN] EQ S"WTOMARK")
  765. THEN # ONLY WAITING TO SEND SYNC SUP MSG #
  766. BEGIN
  767. NIT$STATE[ACN] = S"OK"; # SET STATE TO NORMAL #
  768. END
  769. ELSE # STILL WAITING FOR BI/MARK SUP MSG #
  770. BEGIN
  771. NIT$STATE[ACN] = S"USRBRK"; # CHANGE STATE #
  772. END
  773. END
  774. GOTO END$FC;
  775. END
  776.  
  777. FC$BRK:
  778. #
  779.   PROCESS AN UPLINE BREAK ( FOR A-A CONNECTION ONLY )
  780. #
  781. BEGIN
  782. # CHECK IF TERMINAL IS KNOWN TO USER. #
  783. # BRK CAN NOT OCCUR IN LIMBO STATE. #
  784. IF NIT$STATE[ACN] NQ S"WCONENDN"
  785. THEN
  786. BEGIN
  787. RESPONSE = TRUE;
  788. NIT$CON[0] = ACN;
  789. NIT$ABN[ACN] = NIT$ACK$ABN[ACN];
  790. NIT$C$ABL[ACN] = NIT$ABL[ACN];
  791. NIT$RC[0] = S"FC$BRK"; # NIT RETURN CODE #
  792. NIT$SB$RC[0] = FCRBR[0]; # BREAK REASON CODE #
  793. ABHWORD[0] = 0;
  794. ABHABT[0] = APPCMD;
  795. ABHACT[0] = ACFC;
  796. ABHTLC[0] = LFCRST;
  797. SPMSG0[0] = 0;
  798. PFCSFC[0] = FCRST;
  799. FCACN[0] = ACN;
  800. NETPUT(HEADER,SUP$MES); # SEND FC/RST #
  801. END
  802. GOTO END$FC;
  803. END
  804.  
  805. FC$INACT:
  806. #
  807.   PROCESS AN FC/INACT SUPERVISORY MESSAGE
  808. #
  809. BEGIN
  810. IF (NIT$STATE[ACN] NQ S"WCONENDN") AND
  811. (NIT$STATE[ACN] NQ S"LEND")
  812. THEN # CONNECTION HAS NOT BEEN TERMINATED #
  813. BEGIN
  814. NIT$CON[0] = ACN; # APPL CONNECTION NUMBER #
  815. IF (CONINIT) OR
  816. ( (NIT$STATE[ACN] NQ S"LIMBO") AND
  817. (NIT$STATE[ACN] NQ S"POSE") AND
  818. (NIT$STATE[ACN] NQ STATE"WAITPRU") AND
  819. (NIT$STATE[ACN] NQ S"LENDRET") )
  820. THEN # APP KNOWS ABOUT CONNECTION #
  821. BEGIN
  822. IF INACTIVE
  823. THEN # APP WANTS TO BE INFORMED ABOUT FC/INACT #
  824. BEGIN
  825. NIT$RC[0] = S"FC$INACT"; # SET RC FIELD #
  826. NIT$SB$RCB[0] = FCATF[0]; # APP SPECIFIED #
  827. # TIMEOUT FLAG #
  828. RESPONSE = TRUE;
  829. END
  830. END
  831. ELSE # APP DOES NOT KNOW ABOUT CONNECTION #
  832. BEGIN
  833. NIT$PARMADR[0] = 0;
  834. QTENDT; # END CN THAT DID NOT RECEIVE FC/INIT #
  835. END
  836. END
  837. GOTO END$FC;
  838. END
  839.  
  840. FC$INIT:
  841. #
  842.   PROCESS AN INITIALIZE.
  843. #
  844. BEGIN
  845. IF (NIT$STATE[ACN] EQ S"LIMBO") OR
  846. (NIT$STATE[ACN] EQ S"POSE") OR
  847. (NIT$STATE[ACN] EQ S"LENDRET")
  848. THEN # EXPECTING FC/INIT/R SUP MSG #
  849. BEGIN
  850. RB[0] = TRUE;
  851. NETPUT(HEADER,SUP$MES); #NORMAL RESP TO FC INIT#
  852. NIT$C$ABL[ACN] = NIT$ABL[ACN];
  853. IF NIT$STATE[ACN] EQ S"POSE"
  854. THEN # A-A CONNECTION REQUEST RESPONSE FC/INIT #
  855. BEGIN
  856. NIT$RC[0] = S"ACRQ$COMPL";
  857. END
  858. ELSE # RECONNECT OR NEW CONNECTION #
  859. BEGIN
  860. IF NIT$STATE[ACN] EQ S"LIMBO"
  861. THEN # NEW CONNECTION #
  862. BEGIN
  863. NIT$RC[0] = S"NEW$CON";
  864. END
  865. ELSE # RECONNECT OF LOANED CONNECTION #
  866. BEGIN
  867. NIT$RC[0] = S"NEW$RECON";
  868. END
  869. END
  870. IF ((PRUDTW[0] LAN 2**(NIT$DEVTYP[ACN])) NQ 0)
  871. THEN # QTRM IS TO SEND PRU/ON SUP MSG #
  872. BEGIN
  873. ABHWORD[0] = 0; # INITIALIZE ABH WORD #
  874. ABHABT[0] = APPCMD; # APPLICATION BLOCK TYPE #
  875. ABHACT[0] = ACPRU; # APPLICATION CHAR TYPE #
  876. ABHTLC[0] = LPRU; # LENGTH OF PRU/ON SUP MSG#
  877. SPMSG0[0] = 0; # INITIALIZE SUP MSG WORD #
  878. PFCSFC[0] = PRUON; # PFC/SFC FOR PRU/ON S M #
  879. PRUACN[0] = ACN; # CN FOR PRU/ON SUP MSG #
  880. IF NIT$DEVTYP[ACN] EQ DT$CR
  881. THEN # UPLINE (INPUT) DEVICE #
  882. BEGIN
  883. PRUUPS[0] = NIT$UPS[ACN]; # UPLINE PRU SIZE #
  884. END
  885. ELSE # DOWNLINE (OUTPUT) DEVICE#
  886. BEGIN
  887. PRUDPS[0] = NIT$DPS[ACN]; # DOWNLINE PRU SIZ#
  888. END
  889. NETPUT(HEADER,SUP$MES); # SEND PRU/ON SUP MSG #
  890. NIT$STATE[ACN] = STATE"WAITPRU"; #CHANGE STATE#
  891. END
  892. ELSE # INFORM APP ABOUT NEW CONNECTION NOW #
  893. BEGIN
  894. RESPONSE = TRUE; # TERMINATE LOOP #
  895. NIT$STATE[ACN] = STATE"OK"; # CHANGE STATE #
  896. NIT$CON[0] = ACN; # APP CONNECTION NUMBER #
  897. END
  898. END
  899. GOTO END$FC;
  900. END
  901.  
  902. FC$NAK:
  903. #
  904.   PROCESS A NAK.
  905. #
  906. BEGIN
  907. IF NIT$STATE[ACN] NQ S"WCONENDN"
  908. THEN
  909. BEGIN
  910. RESPONSE = TRUE;
  911. NIT$CON[0] = ACN;
  912. NIT$PARMADR[0] = 0;
  913. QTENDT; # END CONNECTION WHICH HAD THE NAK #
  914. NIT$RC[0] = S"CON$BROKEN";
  915. NIT$S$RC[0] = S"RECNAK"; # SET SEC-RC FIELD #
  916. END
  917. GOTO END$FC;
  918. END
  919.  
  920. FC$RST:
  921. #
  922.   PROCESS AN RESET RESPONSE
  923. #
  924. BEGIN
  925. IF NIT$STATE[ACN] EQ S"FCBRK"
  926. THEN # CONNECTION HAS NOT BEEN ENDED #
  927. BEGIN
  928. NIT$STATE[ACN] = S"OK"; # BACK TO NORMAL STATE #
  929. NIT$RC[0] = S"FC$RST"; # SET RETURN CODE FIELD #
  930. NIT$CON[0] = ACN; # CONNECTION NUMBER #
  931. NIT$C$ABL[ACN] = NIT$ABL[ACN];
  932. RESPONSE = TRUE;
  933. END
  934. GOTO END$FC; # GO TO END OF FC CASE STATEMENT #
  935. END
  936.  
  937. END$FC:
  938. GOTO END$A$PFC;
  939. END
  940.  
  941. A$PFC$SHUT:
  942. #
  943.   SUPERVISORY SHUTDOWN MESSAGE BLOCK PROCESSING.
  944. #
  945. BEGIN
  946. IF SFC[0] EQ INSD
  947. THEN
  948. BEGIN
  949. IF SHUTF[0]
  950. # IF A FORCED SHUTDOWN #
  951. THEN
  952. BEGIN
  953. NETOFF;
  954. NIT$RC[0] = S"SHUTDOWN";
  955. RESPONSE = TRUE;
  956. END
  957. ELSE
  958. BEGIN
  959. NIT$RC[0] = S"IDLEDOWN";
  960. RESPONSE = TRUE;
  961. END
  962. END
  963. GOTO END$A$PFC;
  964. END
  965.  
  966. A$PFC$TCH:
  967. #
  968.   SUPERVISORY CHANGE TERMINAL CHARACTERISTIC
  969.   MESSAGE BLOCK PROCESSING.
  970. #
  971. BEGIN
  972. ACN = TCHACN[0]; # APPLICATION CONNECTION NUMBER #
  973. NIT$PW[ACN] = TCHPW[0]; # PAGE WIDTH #
  974. NIT$PL[ACN] = TCHPL[0]; # PAGE LENGTH #
  975. NIT$TC[ACN] = TCHTCL[0]; # TERMINAL CLASS #
  976. GOTO END$A$PFC;
  977. END
  978.  
  979. A$PFC$INTR:
  980. #
  981.   INTRRUPT PROCESSING
  982. #
  983. BEGIN
  984. TEMP2 = INTRCHR[0]; # USER INTERRUPT CHARACTER #
  985. ACN = INTRACN[0]; # APPLICATION CONNECTION NUMBER #
  986. NIT$CON[0] = ACN;
  987. IF (NIT$STATE[ACN] EQ S"INTRRSP") AND
  988. (SFC[0] EQ RSP)
  989. THEN # INTERRUPT RESPONSE RECEIVED #
  990. BEGIN
  991. NIT$STATE[ACN] = S"OK"; # SET TO NORMAL STATE #
  992. NIT$RC[0] = S"INTR$RSP"; # SET RETURN CODE IN NIT #
  993. RESPONSE = TRUE;
  994. END
  995. ELSE # INTERRUPT USER RECEIVED #
  996. BEGIN
  997. IF (NIT$STATE[ACN] NQ S"WCONENDN") AND
  998. (NIT$STATE[ACN] NQ S"LEND")
  999. THEN # CONNECTION HAS NOT BEEN TERMINATED #
  1000. BEGIN
  1001. IF (NIT$DEVTYP[ACN] EQ 0) AND
  1002. ((TEMP2 EQ RIR"UB1") OR
  1003. (TEMP2 EQ RIR"UB2"))
  1004. THEN # USER BREAK ENTERED FROM TERMINAL #
  1005. BEGIN
  1006. NIT$STATE[ACN] = S"USRBRK"; # UPDATE STATE #
  1007. IF (NOT BREAKMARK) AND
  1008. (NIT$C$ABL[ACN] NQ 0)
  1009. THEN # QTRM NEEDS TO SEND RO/MARK FOR APP #
  1010. BEGIN
  1011. CHARSET = NIT$CHAR$SET[0]; # SAVE CHAR SET #
  1012. NIT$CHAR$SET[0] = CT8ASCII; # APPL CHAR TYPE#
  1013. NIT$CTLC[0] = LROMARK; # LENGTH OF SUP MSG #
  1014. SPMSG0[0] = 0;
  1015. PFCSFC[0] = ROMARK; # PFC/SFC VALUE #
  1016. QTTIP(SUP$MES); # SEND SYNC SUP MSG #
  1017. NIT$CHAR$SET[0] = CHARSET; # RESTORE CHR SET#
  1018. END
  1019. ELSE # CANNOT SEND RO/MARK SUP MSG #
  1020. BEGIN
  1021. IF NOT BREAKMARK
  1022. THEN # QTRM WILL SEND RO/MARK AFTER FC/ACK #
  1023. BEGIN
  1024. NIT$STATE[ACN] = S"WBIROMK"; # NEW STATE #
  1025. END
  1026. END
  1027. IF NOT AUTOBREAK
  1028. THEN # NEED TO INFORM APP ABOUT USER BREAK #
  1029. BEGIN
  1030. IF TEMP2 EQ RIR"UB1"
  1031. THEN # USER BREAK ONE OCCURRED #
  1032. BEGIN
  1033. NIT$RC[0] = S"USER$B1"; # SET RETURN CODE #
  1034. END
  1035. ELSE # USER BREAK TWO OCCURRED #
  1036. BEGIN
  1037. NIT$RC[0] = S"USER$B2"; # SET RETURN CODE #
  1038. END
  1039. RESPONSE = TRUE;
  1040. END
  1041. END
  1042. ELSE # USER OR APPLICATION INTERRUPT OCCURRED #
  1043. BEGIN
  1044. NIT$SB$RC[0] = INTRCHR[0]; # INTERRUPT CHAR #
  1045. IF USERINTR
  1046. THEN # INFORM APP ABOUT USER/APPLICATION INTR #
  1047. BEGIN
  1048. NIT$RC[0] = S"USR$INTR"; # SET RETURN CODE #
  1049. RESPONSE = TRUE;
  1050. END
  1051. END
  1052.  
  1053. ABHWORD[0] = 0;
  1054. ABHABT[0] = APPCMD; # APPLICATION BLOCK TYPE #
  1055. ABHACT[0] = ACINTR; # APPLICATION CHARACTER TYPE#
  1056. ABHTLC[0] = LINTR; # LENGTH OF SUPERVISORY MSG #
  1057. SPMSG0[0] = 0;
  1058. PFCSFC[0] = INTRRSP; # PFC/SFC VALUE FOR INTR/RS#
  1059. INTRACN[0] = ACN; # APPLICATION CONNECTION NUM #
  1060. NETPUT(HEADER,SUP$MES); # SEND INTR/RSP SUP MSG #
  1061. END
  1062. END
  1063. GOTO END$A$PFC;
  1064. END
  1065.  
  1066. A$PFC$HOP:
  1067. #
  1068.   HOST OPERATOR COMMAND PROCESSING
  1069. #
  1070. BEGIN
  1071. RESPONSE = TRUE; # INFORM APP UNLESS OTHERWISE #
  1072. GOTO SWTCH$HOP [SFC[0]];
  1073.  
  1074. HOP$BRK:
  1075. #
  1076.   PROCESS AN OPERATOR BREAK
  1077. #
  1078. BEGIN
  1079. IF KDISPLAY
  1080. THEN # APP SUPPORTS K-DISPLAY #
  1081. BEGIN
  1082. NIT$RC[0] = S"HOP$BRK"; # SET RETURN CODE #
  1083. END
  1084. ELSE # IGNORE SUPERVISORY MESSAGE #
  1085. BEGIN
  1086. RESPONSE = FALSE; # DO NOT INFORM APP #
  1087. END
  1088. GOTO END$HOP;
  1089. END
  1090.  
  1091. HOP$CMD:
  1092. #
  1093.   PROCESS AN OPERATOR TYPEIN
  1094. #
  1095. BEGIN
  1096. IF KDISPLAY
  1097. THEN # APP SUPPORTS K-DISPLAY #
  1098. BEGIN
  1099. NIT$RC[0] = S"HOP$CMD"; # SET RETURN CODE #
  1100. TEMP2 = ABHTLC[0] - 1; # NO OF CM WDS OF TYPE IN#
  1101. IF MAXWORDS GR TEMP2
  1102. THEN # WSA BUFFER IS BIG ENOUGH FOR TYPE IN #
  1103. BEGIN
  1104. NIT$CTLC[0] = HOPDTL[0]; # NO OF CHARS TYPED #
  1105. END
  1106. ELSE # WSA BUFFER IS NOT LONG ENOUGH #
  1107. BEGIN
  1108. NIT$TRUNC[0] = 1; # SET SUP MSG TRUNCATED FLAG#
  1109. NIT$CTLC[0] = MAXWORDS * 10; # NO OF CHARS #
  1110. TEMP2 = MAXWORDS; # NO OF WORDS TO COPY TO BUF#
  1111. END
  1112. P<MEM> = LOC(SUP$MES); # ADDRESS OF SUP MSG #
  1113. FOR J = 0 STEP 1 UNTIL TEMP2 - 1
  1114. DO # COPY OPERATOR TYPEIN TO WSA BUFFER #
  1115. BEGIN
  1116. WSA$WORD[J] = MEM$WORD[J+1]; # OPER TYPEIN TXT#
  1117. END
  1118. END
  1119. ELSE # IGNORE SUPERVISORY MESSAGE #
  1120. BEGIN
  1121. RESPONSE = FALSE; # DO NOT INFORM APP #
  1122. END
  1123. GOTO END$HOP;
  1124. END
  1125.  
  1126. HOP$TRCE:
  1127. #
  1128.   PROCESS AN OPERATOR REQUEST TO BEGIN AIP TRACING
  1129. #
  1130. BEGIN
  1131. NETDBG(1,1,SUP$MES); # TURN AIP TRACING ON #
  1132. RESPONSE = FALSE;
  1133. GOTO END$HOP;
  1134. END
  1135.  
  1136. HOP$DU:
  1137. #
  1138.   PROCESS AN OPERATOR REQUEST TO DUMP FIELD LENGTH
  1139. #
  1140. BEGIN
  1141. NIT$RC[0] = S"HOP$DU"; # SET RETURN CODE #
  1142. GOTO END$HOP;
  1143. END
  1144.  
  1145. HOP$IG:
  1146. #
  1147.   PROCESS AN OPERATOR REQUEST TO NOT SEND ALERTS
  1148. #
  1149. BEGIN
  1150. IGNORE = TRUE; # SET FLAG TO NOT SEND HOP/ALT #
  1151. RESPONSE = FALSE;
  1152. GOTO END$HOP;
  1153. END
  1154.  
  1155. HOP$STRT:
  1156. #
  1157.   PROCESS OPERATOR ASSIGNMENT OF K-DISPLAY TO THIS APP
  1158. #
  1159. BEGIN
  1160. IGNORE = FALSE; # CLEAR FLAG TO NOT SEND HOP/ALT #
  1161. IF KDISPLAY
  1162. THEN # APPLICATION SUPPORTS K-DISPLAY #
  1163. BEGIN
  1164. KDISAS = TRUE; # SET K-DISPLAY ASSIGNED FLAG #
  1165. NIT$RC[0] = S"HOP$START"; # SET RETURN CODE #
  1166. IF MAXWORDS NQ 0
  1167. THEN # WSA BUFFER IS AT LEAST ONE WORD LONG #
  1168. BEGIN
  1169. WSA$WORD[0] = SPMSG0[0]; # 1ST WD OF SUP MSG #
  1170. END
  1171. ELSE # WSA BUFFER IS ZERO WORDS LONG #
  1172. BEGIN
  1173. NIT$TRUNC[0] = 1; # SET SUP MSG TRUNCATED FLAG#
  1174. END
  1175. END
  1176. ELSE # DO NOT INFORM APPLICATION #
  1177. BEGIN
  1178. RESPONSE = FALSE;
  1179. END
  1180. GOTO END$HOP;
  1181. END
  1182.  
  1183. HOP$END:
  1184. #
  1185.   PROCESS OPERATOR TERMINATION OF K-DISPLAY ASSIGNMENT
  1186. #
  1187. BEGIN
  1188. IF KDISPLAY
  1189. THEN # APPLICATION SUPPORTS K-DISPLAY #
  1190. BEGIN
  1191. KDISAS = FALSE; # CLEAR K-DISPLAY ASSIGNED FLAG #
  1192. NIT$RC[0] = S"HOP$END"; # SET RETURN CODE #
  1193. END
  1194. ELSE # DO NOT INFORM APPLICATION #
  1195. BEGIN
  1196. RESPONSE = FALSE;
  1197. END
  1198. GOTO END$HOP;
  1199. END
  1200.  
  1201. HOP$NOTR:
  1202. #
  1203.   PROCESS AN OPERATOR REQUEST TO END AIP TRACING
  1204. #
  1205. BEGIN
  1206. NETDBG(0,0,SUP$MES); # TURN AIP TRACING OFF #
  1207. RESPONSE = FALSE;
  1208. GOTO END$HOP;
  1209. END
  1210.  
  1211. HOP$RS:
  1212. #
  1213.   PROCESS AN OPERATOR REQUEST TO RESET STATISTICS
  1214. #
  1215. BEGIN
  1216. NIT$RC[0] = S"HOP$RS"; # SET RETURN CODE #
  1217. GOTO END$HOP;
  1218. END
  1219.  
  1220. HOP$PAGE:
  1221. #
  1222.   PROCESS AN OPERATOR REQUEST TO CHANGE PAGING
  1223. #
  1224. BEGIN
  1225. IF KDISPLAY
  1226. THEN # APPLICATION SUPPORTS K-DISPLAY #
  1227. BEGIN
  1228. NIT$RC[0] = S"HOP$PAGE"; # SET RETURN CODE #
  1229. NIT$SBC$RC[0] = HOPPC[0]; # PAGE CHARACTER #
  1230. END
  1231. ELSE # DO NOT INFORM APPLICATION #
  1232. BEGIN
  1233. RESPONSE = FALSE;
  1234. END
  1235. GOTO END$HOP;
  1236. END
  1237.  
  1238. HOP$REL:
  1239. #
  1240.   PROCESS AN OPERATOR REQUEST TO RELEASE AIP DEBUG
  1241.   LOG FILE
  1242. #
  1243. BEGIN
  1244. NIT$RC[0] = S"HOP$REL"; # SET RETURN CODE #
  1245. GOTO END$HOP;
  1246. END
  1247.  
  1248. HOP$DB:
  1249. #
  1250.   PROCESS AN OPERATOR REQUEST TO TURN ON DEBUG CODE
  1251. #
  1252. BEGIN
  1253. NIT$RC[0] = S"HOP$DB"; # SET RETURN CODE #
  1254. GOTO END$HOP;
  1255. END
  1256.  
  1257. HOP$DE:
  1258. #
  1259.   PROCESS AN OPERATOR REQUEST TO TURN OFF DEBUG CODE
  1260. #
  1261. BEGIN
  1262. NIT$RC[0] = S"HOP$DE"; # SET RETURN CODE #
  1263. GOTO END$HOP;
  1264. END
  1265.  
  1266. END$HOP: # END OF HOP CASE STATEMENT #
  1267.  
  1268. GOTO END$A$PFC;
  1269. END
  1270.  
  1271. A$PFC$OFC:
  1272. #
  1273.   PRU OUTPUT DEVICE SUPERVISORY MESSAGE PROCESSING
  1274. #
  1275. BEGIN
  1276. ACN = OFCACN[0]; # ACN FROM OFC SUP MSG #
  1277. NIT$CON[0] = ACN; # APPLICATION CONNECTION NUMBER #
  1278. IF NIT$STATE[ACN] NQ STATE"WCONENDN" AND
  1279. NIT$STATE[ACN] NQ STATE"LEND"
  1280. THEN # APP STILL NOWS ABOUT CONNECTION #
  1281. BEGIN
  1282. RESPONSE = TRUE; # INFORM APP UNLESS OTHERWISE #
  1283. IF SFC[0] EQ ABRT
  1284. THEN # RECEIVED OFC/ABT/N SUP MSG #
  1285. BEGIN
  1286. NIT$STATE[ACN] = STATE"PRUEOO"; # CHANGE STATE #
  1287. NIT$RC[0] = NITRTC"OFCABTN"; # NIT RETURN CODE #
  1288. WSA$WORD[0] = OFCCURP[0]; # ACCOUNTING DATA #
  1289. WSA$WORD[1] = OFCPAR[0]; # LFN AND FNT ADR #
  1290. END
  1291. ELSE # DID NOT RECEIVE OFC/ABT/N SUP MSG #
  1292. BEGIN
  1293. IF SFC[0] EQ DATA
  1294. THEN # RECEIVED OFC/DATA/N SUP MSG #
  1295. BEGIN
  1296. IF NIT$STATE[ACN] EQ STATE"PRUEOO"
  1297. THEN # OFC/DATA/N WAS RESPONSE TO ACCTNG MSG #
  1298. BEGIN # OUTPUT JOB HAS ENDED #
  1299. NIT$STATE[ACN] = STATE"PRUCN"; # CHG STATE #
  1300. NIT$RC[0] = NITRTC"OFCEOJ"; # NIT RETURN CODE#
  1301. END
  1302. ELSE # OFC/DATA/N WAS RESPONSE TO BANNER MSG #
  1303. BEGIN
  1304. NIT$RC[0] = NITRTC"OFCDATAN"; # NIT RC #
  1305. END
  1306. END
  1307. ELSE # DID NOT RECEIVE OFC/DATA/N NOR OFC/ABT/N#
  1308. BEGIN
  1309. IF SFC[0] EQ EOO
  1310. THEN # RECEIVED OFC/EOO SUP MSG #
  1311. BEGIN
  1312. IF NIT$STATE[ACN] EQ STATE"PRUEOO"
  1313. THEN # COMPLETED TRANSFR OF OUTPUT JB#
  1314. BEGIN
  1315. NIT$STATE[ACN] = STATE"PRUCN"; # CHG STATE#
  1316. NIT$RC[0] = NITRTC"OFCEOJ"; # NIT RC #
  1317. END
  1318. ELSE # COMPLETED TRANSFR OF OUTPUT FL#
  1319. BEGIN
  1320. NIT$STATE[ACN] = STATE"PRUEOO"; # CHG STATE#
  1321. NIT$RC[0] = NITRTC"OFCEOO"; # NIT RC #
  1322. WSA$WORD[0] = OFCACNT[0]; # ACCOUNTING DATA#
  1323. WSA$WORD[1] = OFCPAR[0]; # LFN AND FNT ADR #
  1324. END
  1325. END
  1326. ELSE # RECEIVED OFC/STPD OR OFC/STP/N#
  1327. BEGIN
  1328. WSA$WORD[0] = OFCCURP[0]; # CURRENT PRU POS #
  1329. IF SFC[0] EQ STPD
  1330. THEN # RECEIVED OFC/STPD SUP MSG #
  1331. BEGIN
  1332. NIT$RC[0] = NITRTC"OFCSTPD"; # NIT RC #
  1333. NIT$SB$RC[0] = OFCRC[0]; # RC FOR STPD CON#
  1334. IF OFCRC[0] EQ ROS"MSE"
  1335. THEN # PIP STOPPED PRU TRAFFIC #
  1336. BEGIN
  1337. NIT$STATE[ACN] = STATE"PRUSTPP";
  1338. END
  1339. ELSE # NETWORK STOPPED PRU TRAFFIC #
  1340. BEGIN
  1341. NIT$STATE[ACN] = STATE"PRUSTPD";
  1342. IF OFCRC[0] EQ ROS"PMI"
  1343. THEN # PM MESSAGE TO COPY TO WSA #
  1344. BEGIN
  1345. TEMP2 = OFCPMCC[0]; # NO OF CHARS #
  1346. IF PMCONV NQ 0
  1347. THEN # NEED TO CONVERT PM MESSAGE #
  1348. BEGIN
  1349. IF MAXWORDS LS TEMP2/10
  1350. THEN # WSA BUFFER IS NOT BIG ENOUGH #
  1351. BEGIN
  1352. NIT$TRUNC[0] = 1; # PM MSG TRUNCATD#
  1353. TEMP2 = MAXWORDS*10; # SIZE OF PM #
  1354. END
  1355. OLDCP = 5; # INIT CHAR POS IN PM MSG #
  1356. OLDWP = 2; # INIT WORD POS IN PM MSG #
  1357. NEWCP = 0; # INIT CHAR POS IN WSA #
  1358. NEWWP = 1; # INIT WORD POS IN WSA #
  1359. P<MEM> = LOC(SUP$MES);
  1360. #
  1361.   PM MESSAGES ARE ASSUMED TO BE IN 8/12
  1362.   ASCII. IF CDCNET IS LATER ENHANCED
  1363.   TO SEND PM MESSAGES IN 6/12 DISPLAY
  1364.   CODE OR A QTRM APPLICATION IS USING
  1365.   PRU INTERFACE ON 2550 NETWORK, THEN
  1366.   THIS CODE WILL NEED TO BE CHANGED TO
  1367.   SUPPORT PM MESSAGES IN 6/12 DISPLAY
  1368.   CODE.
  1369. #
  1370. FOR J = 1 STEP 1 UNTIL TEMP2
  1371. DO # CONVERT CHARS ONE AT A TIME #
  1372. BEGIN
  1373. TEMP1 = B<OLDCP,7>MEM$WORD[OLDWP];
  1374. TEMP3 = TEMP1/10; # WRD INDEX #
  1375. TEMP1 = TEMP1 - TEMP3*10; # CHR IDX#
  1376. NEWCHAR = B<TEMP1*6,6>CONVW[TEMP3];
  1377. IF PMCONV EQ 2
  1378. THEN # CONVERT TO CONSOLE DISPLAY #
  1379. BEGIN
  1380. IF NEWCHAR GQ O"60"
  1381. THEN # NEED TO BLANK SPECIAL CHR#
  1382. BEGIN
  1383. NEWCHAR = O"55"; # BLANK CHAR #
  1384. END
  1385. END
  1386. B<NEWCP,6>WSA$WORD[NEWWP] = NEWCHAR;
  1387. OLDCP = OLDCP + 12; # NEXT PM CHAR#
  1388. IF OLDCP GQ 65
  1389. THEN # REACHED END OF THIS PM WORD#
  1390. BEGIN
  1391. OLDCP = 5; # INIT CHAR POS IN PM #
  1392. OLDWP = OLDWP + 1; # NEXT PM WORD#
  1393. END
  1394. NEWCP = NEWCP + 6; # NEXT WSA POS #
  1395. IF NEWCP GQ 60
  1396. THEN # REACHED END OF THS WSA WORD#
  1397. BEGIN
  1398. NEWCP = 0; # INIT CHAR POS IN WSA#
  1399. NEWWP = NEWWP + 1; # NEXT WSA WRD#
  1400. END
  1401. END
  1402. END
  1403. ELSE # COPY PM MSG TO WSA AS IS #
  1404. BEGIN
  1405. TEMP3 = ABHTLC[0] - 2; # NO OF WDS #
  1406. IF MAXWORDS LS TEMP3
  1407. THEN # WSA BUFFER IS NOT BIG ENOUGH #
  1408. BEGIN
  1409. NIT$TRUNC[0] = 1; # PM MSG TRUNCATD#
  1410. TEMP2 = MAXWORDS*5; # NO OF CHARS #
  1411. TEMP3 = MAXWORDS; # NO OF WDS #
  1412. END
  1413. P<MEM> = LOC(SUP$MES) + 1;
  1414. FOR J = 1 STEP 1 UNTIL TEMP3
  1415. DO # COPY PM MESSAGE TO WSA BUFFER #
  1416. BEGIN
  1417. WSA$WORD[J] = MEM$WORD[J];
  1418. END
  1419. END
  1420. NIT$CTLC[0] = TEMP2; # SIZE OF PM MSG #
  1421. END
  1422. END
  1423. END
  1424. ELSE # RECEIVED OFC/STP/N SUP MSG #
  1425. BEGIN
  1426. NIT$STATE[ACN] = STATE"PRUSTPN";
  1427. NIT$RC[0] = NITRTC"OFCSTPN"; # NIT RC #
  1428. END
  1429. END
  1430. END
  1431. END
  1432. END
  1433. GOTO END$A$PFC; # GO TO END OF CASE STATEMENT #
  1434. END
  1435.  
  1436. A$PFC$PRU:
  1437. #
  1438.   PRU CONNECTION ESTABLISHMENT PROCESSING
  1439. #
  1440. BEGIN
  1441. ACN = PRUACN[0]; # ACN FROM PRU SUP MSG #
  1442. NIT$CON[0] = ACN; # APPLICATION CONNECTION NUMBER #
  1443. RESPONSE = TRUE; # SET FLAG TO STOP LOOPING #
  1444. IF EB[0]
  1445. THEN # ABNORMAL RESPONSE RECEIVED #
  1446. BEGIN
  1447. IF NIT$STATE[ACN] EQ STATE"WAITPRU"
  1448. THEN # APPLICATION DOES NOT KNOW ABOUT CON #
  1449. BEGIN
  1450. NIT$PARMADR[0] = 0;
  1451. QTENDT;
  1452. RESPONSE = FALSE;# CLEAR FLAG TO CONTINUE LOOPING#
  1453. END
  1454. ELSE # INFORM APP THAT PRU CON NOT ESTABLISHED #
  1455. BEGIN
  1456. NIT$STATE[ACN] = STATE"OK";
  1457. NIT$RC[0] = NITRTC"PRUONA"; # SET RETURN CODE #
  1458. NIT$SB$RC[0] = PRURC[0]; # RC FROM PRU/ON/A #
  1459. END
  1460. END
  1461. ELSE # PRU CONNECTION ESTABLISHED #
  1462. BEGIN
  1463. NIT$STATE[ACN] = STATE"PRUCN";
  1464. NIT$RC[0] = NITRTC"PRUONN"; # SET RETURN CODE #
  1465. END
  1466. GOTO END$A$PFC; # GO TO END OF CASE STATEMENT #
  1467. END
  1468.  
  1469. END$A$PFC:
  1470. FOUNDMATCH = TRUE; # END FOR LOOP FOR PFC SCAN #
  1471. END
  1472. END
  1473.  
  1474. IF (CONPOLL ) AND
  1475. (NOT RESPONSE)
  1476. THEN
  1477. BEGIN
  1478. NIT$CON[0] = 0; # RESET POLLING TO ASYNC #
  1479. END
  1480. END
  1481. ELSE
  1482.  
  1483. #
  1484.   NO ASYNCHRONOUS SUPERVISORY MESSAGE HAS BEEN PROCESSED.
  1485.   TRY TO GET DATA FOR APPLICATION.
  1486. #
  1487. BEGIN
  1488. #
  1489.   IF CONNECTION POLLING IS IN EFFECT, THE CONNECTION NUMBER
  1490.   MUST BE CHECKED BEFORE WE ISSUE THE NETGET CALL. IF AN
  1491.   INVALID CONNECTION NUMBER WAS SPECIFIED, THE QTGET CALL IS
  1492.   REJECTED.
  1493. #
  1494. IF CONPOLL
  1495. THEN # CONNECTION POLLING IS IN EFFECT #
  1496. BEGIN
  1497. IF NIT$CON[0] NQ 0
  1498. THEN # NONZERO CONNECTION NUMBER WAS SPECIFIED #
  1499. BEGIN
  1500. #
  1501.   CHECK IF SPECIFIED CONNECTION NUMBER IS VALID
  1502. #
  1503. IF (NIT$CON[0] GR NIT$NO$TERMS[0] ) OR
  1504. (NIT$STATE[NIT$CON[0]] EQ S"NULL" ) OR
  1505. (NIT$STATE[NIT$CON[0]] EQ S"LEND" ) OR
  1506. (NIT$STATE[NIT$CON[0]] EQ S"LENT" ) OR
  1507. (NIT$STATE[NIT$CON[0]] EQ S"WCONENDN")
  1508. THEN # BAD CONNECTION NUMBER WAS SPECIFIED #
  1509. BEGIN
  1510. NIT$RC[0] = S"QTGETREJ"; # SET QTGET REJECT RC #
  1511. IF (NIT$STATE[NIT$CON[0]] EQ S"LEND" ) OR
  1512. (NIT$STATE[NIT$CON[0]] EQ S"LENT" )
  1513. THEN # CONNECTION HAS BEEN LOANED TO ANOTHER AP#
  1514. BEGIN
  1515. NIT$S$RC[0] = S"CONLOANED"; # STORE REASON FOR REJ#
  1516. END
  1517. ELSE # BAD CONNECTION NUMBER WAS SPECIFIED #
  1518. BEGIN
  1519. NIT$S$RC[0] = S"BADCN"; # STORE REASON FOR BAD CAL#
  1520. END
  1521. RESPONSE = TRUE; # TERMINATE LOOPING AND RETURN #
  1522. GOTO END$ABT$L;
  1523.  
  1524. END
  1525. ELSE # OKAY TO GET DATA FOR GIVEN CONNECTION NO#
  1526. BEGIN
  1527. NETGET(NIT$CON[0],HEADER,WSA,MAXWORDS); # GET DATA #
  1528. END
  1529. END
  1530. END
  1531. ELSE # LIST PROCESSING IS IN EFFECT #
  1532. BEGIN
  1533. #
  1534.   TRY TO GET DATA MESSAGE FROM ANY CONNECTION
  1535.   ALL CONNECTIONS ARE ON LIST = 1.
  1536. #
  1537. NETGETL(1,HEADER,WSA,MAXWORDS); # GET DATA FROM LIST #
  1538. END
  1539. BEGIN # BEGIN LIST = 1 ABT CASES #
  1540. GOTO SWTCH$ABT$L [ABHABT[0]];
  1541.  
  1542. ABT$L$NULL:
  1543. #
  1544.   NO MESSAGE BLOCKS ARE AVAILABLE
  1545. #
  1546. BEGIN
  1547. NIT$RC[0] = S"NOBLK"; #PRESET RC TO NO BLOCK AVAIL #
  1548.  
  1549. IF NIT$SLEEP NQ 0
  1550. THEN
  1551. SLEEP = NIT$SLEEP;
  1552. ELSE
  1553. SLEEP = NIT$XSLEEP;
  1554.  
  1555. IF SLEEP EQ 0
  1556. THEN
  1557. BEGIN
  1558. RESPONSE = TRUE;
  1559. END
  1560. ELSE # IF SLEEP NQ 0 #
  1561. BEGIN
  1562. IF SLEEP LS 0
  1563. THEN
  1564. BEGIN
  1565. NETWAIT(4095,0); #WAIT UNTIL INPUT BLOCK AVAIL#
  1566. END
  1567. ELSE # IF SLEEP GT 0 #
  1568. BEGIN
  1569. IF NOSLEEP
  1570. THEN
  1571. RESPONSE = TRUE;
  1572. ELSE
  1573. BEGIN
  1574. NETWAIT(SLEEP,0);
  1575. NOSLEEP = TRUE; #ONLY SLEEP ONCE#
  1576. END;
  1577. END; #SLEEP GT 0 #
  1578. END; #IF SLEEP NQ 0#
  1579. GOTO END$ABT$L;
  1580. END
  1581.  
  1582. ABT$L$CMD:
  1583. #
  1584.   SYNCHRONOUS COMMAND BLOCK PROCESSING
  1585. #
  1586. BEGIN
  1587. IF (ABHACT[0] EQ CT8ASCII
  1588. AND WSA$FC[0] EQ BIMARK)
  1589. OR (ABHACT[0] EQ CT12ASCII
  1590. AND WSA$P1[0] EQ BI
  1591. AND WSA$S1[0] EQ MARK)
  1592. THEN # RECEIVED BREAK MARKER SYNC SUP MSG #
  1593. BEGIN
  1594. ACN = ABHADR[0]; # APPLICATION CONNECTION NUMBER #
  1595. NIT$CON[0] = ACN;
  1596. IF (NIT$STATE[ACN] NQ S"WCONENDN") AND
  1597. (NOT AUTOBREAK) AND
  1598. (BREAKMARK)
  1599. THEN # INFORM APPLICATION ABOUT BREAK MARKER #
  1600. BEGIN
  1601. NIT$RC[0] = S"BI$MARK"; # SET RETURN CODE IN NIT#
  1602. RESPONSE = TRUE;
  1603. END
  1604. IF (NIT$STATE[ACN] EQ S"USRBRK") OR
  1605. (BREAKMARK)
  1606. THEN # WAITING FOR BI/MARK STATE #
  1607. BEGIN
  1608. NIT$STATE[ACN] = S"OK"; # BACK TO NORMAL STATE #
  1609. END
  1610. ELSE # WAITING FOR BI/MARK AND TO SEND RO/MARK #
  1611. BEGIN
  1612. NIT$STATE[ACN] = S"WROMARK"; # CHANGE STATE #
  1613. END
  1614. GOTO END$ABT$L;
  1615. END
  1616. END
  1617. ABT$L$BLK:
  1618. #
  1619.   BLOCK BLOCK PROCESSING
  1620. #
  1621.  
  1622. ABT$L$MSG:
  1623. #
  1624.   MESSAGE BLOCK PROCESSING
  1625. #
  1626. ABT$L$QBLK:
  1627. #
  1628.   QUALIFIED BLOCK BLOCK PROCESSING
  1629. #
  1630.  
  1631. ABT$L$QMSG:
  1632. #
  1633.   QUALIFIED MESSAGE BLOCK PROCESSING
  1634. #
  1635. IF ABHCAN NQ 0
  1636. THEN
  1637. GOTO END$ABT$L ; # IGNORE THIS MSG BLOCK AND #
  1638. # GO GET ANOTHER ONE #
  1639. BEGIN
  1640. ACN = ABHADR[0]; # APPLICATION CONNECTION NUMBER #
  1641. NIT$CON[0] = ACN;
  1642. # IF INPUT BLOCK UNDELIVERABLE OR #
  1643. IF ABHIBU[0] EQ 1
  1644. THEN # BREAK OFFENDING CONNECTION #
  1645. BEGIN
  1646. NIT$PARMADR[0] = 0;
  1647. QTENDT;
  1648. NIT$RC[0] = S"CON$BROKEN";
  1649. NIT$S$RC[0] = S"IBUSET"; # SET SEC RC FIELD IN NIT #
  1650. END
  1651. ELSE # DATA BLOCK WAS DELIVERED FROM NIP #
  1652. BEGIN
  1653. IF (AUTOBREAK) AND
  1654. ( (NIT$STATE[ACN] EQ S"USRBRK") OR
  1655. (NIT$STATE[ACN] EQ S"WBIROMK") )
  1656. THEN
  1657. BEGIN
  1658. GOTO END$ABT$L; # IGNORE THIS MSG BLOCK AND #
  1659. # GO GET ANOTHER ONE #
  1660. END
  1661.  
  1662. IF ABHABT[0] EQ APPCMD # SYNCHRONOUS SUPERVISORY #
  1663. THEN # MESSAGE #
  1664. BEGIN
  1665. NIT$RC[0] = S"UNS$SCMD"; # REASON CODE 29 #
  1666. END
  1667. ELSE
  1668. BEGIN
  1669. NIT$RC[0] = S"OK"; # REGULAR DATA MESSAGE #
  1670. END
  1671. NIT$UP$ABH[NIT$CON[0]] = ABHWORD[0];
  1672. NIT$CTLC[0] = ABHTLC[0];
  1673. IF ABHTRU[0] NQ 0
  1674. THEN # DATA HAS BEEN TRUNCATED #
  1675. BEGIN
  1676. NIT$TRUNC[0] = 1; # SET TRUNCATION FLAG IN NIT #
  1677. END
  1678. IF ABHACT[0] EQ CT6DISPLAY
  1679. THEN
  1680. BEGIN
  1681. WORDS = ABHTLC[0] / WC;
  1682. CHARS = ABHTLC[0] - (WORDS * WC);
  1683. FOR TEMP3 = CHARS STEP 1 UNTIL 9 DO
  1684. BEGIN
  1685. C<TEMP3,1> WSA$WORD[WORDS] = " ";
  1686. END
  1687. END
  1688. ELSE
  1689. BEGIN
  1690. IF (ABHACT[0] EQ CT8ASCII) AND
  1691. (ICTD[0] EQ CT6DISPLAY) AND
  1692. (ABHABT[0] NQ APPCMD) AND
  1693. (NIT$DEVTYP[ACN] NQ 0)
  1694. THEN # NEED TO CHECK AND CONVERT SIZE OF MSG #
  1695. BEGIN
  1696. TEMP3 = ABHTLC[0] - (ABHTLC[0]/3)*3;
  1697. IF TEMP3 NQ 0
  1698. THEN # APP RECEIVED WRONG SIZE BLOCK FROM APP #
  1699. BEGIN
  1700. NIT$PARMADR[0] = 0;
  1701. QTENDT; # TERMINATE CONNECTION #
  1702. NIT$RC[0] = S"CON$BROKEN"; # STORE RETURN CODE#
  1703. NIT$S$RC[0] = S"RECBSZ"; # SET SEC RC FIELD #
  1704. END
  1705. ELSE # DIS CODE BLOCK ON A-A CON HAD RIGHT SIZE#
  1706. BEGIN
  1707. NIT$CTLC[0] = (ABHTLC[0]/3)*4; # NO OF CHARS #
  1708. END
  1709. END
  1710. END
  1711.  
  1712. END
  1713. RESPONSE = TRUE;
  1714. GOTO END$ABT$L;
  1715. END
  1716.  
  1717.  
  1718. END$ABT$L:
  1719. END
  1720. END
  1721. END # END ACN = 0 CASES #
  1722. END # END RESPONCE CONTROLLED LOOP #
  1723. RETURN;
  1724. END
  1725. TERM
cdc/nos2.source/nam5871/qtget.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator