User Tools

Site Tools


cdc:nos2.source:nam5871:qtsup

Table of Contents

QTSUP

Table Of Contents

  • [00006] PROC QTSUP(SMC,WSA)
  • [00365] PROC NETPUT
  • [00366] PROC NETPUTF
  • [00367] PROC NP$ERR
  • [00368] PROC QTTIP
  • [00373] FUNC CHKCN B
  • [01246] FUNC CHKCN B

Source Code

QTSUP.txt
  1. *DECK QTSUP
  2. USETEXT AIPDEF
  3. USETEXT QTRMBUF
  4. USETEXT QTRMCOM
  5. USETEXT QTRMNIT
  6. PROC QTSUP(SMC,WSA);
  7. *IF DEF,IMS
  8. #
  9. *1DC QTSUP
  10. *
  11. * 1. PROC NAME AUTHOR DATE
  12. * QTSUP E. GEE 11/01/84
  13. *
  14. * 2. FUNCTION DESCRIPTION.
  15. * SEND ASYNCHRONOUS SUPERVISORY MESSAGES TO NAM.
  16. *
  17. * 3. METHOD USED.
  18. * IF QTOPEN NOT CALLED YET,
  19. * CALL NP$ERR TO ISSUE DAYFILE MESSAGE AND ABORT APP.
  20. * IF SUPERVISORY MESSAGE CODE VALID,
  21. * INIT RETURN CODE FIELD IN NIT TO QTSUP REJECT VALUE.
  22. * CREATE APPLICATION BLOCK HEADER WORD.
  23. * JUMP ACCORDING TO THE SUPERVISORY MESSAGE CODE.
  24. *
  25. * 0: IF SIZE OF SUP MSG NOT SPECIFIED,
  26. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  27. * ELSE (SIZE OF SUP MSG SPECIFIED),
  28. * IF SIZE OF SUP MSG TOO LARGE,
  29. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  30. * ELSE (SIZE OF SUP MSG OKAY),
  31. * IF SUP MSG BEING SENT REQUIRES RESPONSE AND CAN BE
  32. * SENT BY CALLING QTSUP WITH OTHER SUPERVISORY
  33. * MESSAGE CODE,
  34. * ABORT APP.
  35. * ELSE (OKAY FOR APP TO SEND THIS SUP MSG),
  36. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  37. * CREATE FRAGMENT ARRAY FOR SUP MSG.
  38. * CALL NETPUTF TO SEND SUP MSG TO NAM.
  39. *
  40. * 1: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  41. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  42. * ELSE (NIT ENTRY IS IN USE),
  43. * IF CONNECTION IN WRONG STATE,
  44. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  45. * ELSE (OKAY TO SEND FC/BRK),
  46. * CREATE FC/BRK SUP MSG.
  47. * CALL NETPUT TO SEND SUP MSG TO NAM.
  48. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  49. *
  50. * 2: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  51. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  52. * ELSE (NIT ENTRY IS IN USE),
  53. * IF BAD CHARACTER SET VALUE SPECIFIED FOR DATA,
  54. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  55. * ELSE (GOOD CHAR SET VALUE SPECIFIED FOR DATA),
  56. * IF BAD CHARACTER SET VALUE SPECIFIED FOR SYNC SM,
  57. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  58. * ELSE (OKAY TO SEND DC/CICT SUP MSG),
  59. * CREATE DC/CICT SUP MSG.
  60. * CALL NETPUT TO SEND SUP MSG TO NAM.
  61. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  62. *
  63. * 3: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  64. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  65. * ELSE (CONNECTION NUMBER IS OKAY),
  66. * CREATE DC/TRU SUP MSG.
  67. * CALL NETPUT TO SEND SUP MSG TO NAM.
  68. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  69. *
  70. * 4: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  71. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  72. * ELSE (NIT ENTRY IS IN USE),
  73. * IF CONNECTION IN WRONG STATE,
  74. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  75. * ELSE (OKAY TO SEND INTR/APP),
  76. * CREATE INTR/APP SUP MSG.
  77. * CALL NETPUT TO SEND SUP MSG TO NAM.
  78. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  79. * IF DEVICE CONNECTION,
  80. * IF CURRENT BLOCK LIMIT IS NOT ZERO
  81. * CREATE TO/MARK SYNCHRONOUS SUPERVISORY MESSAGE.
  82. * CALL QTTIP TO SEND SUP MSG TO NAM.
  83. *
  84. * 5: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  85. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  86. * ELSE (CONNECTION NUMBER IS OKAY),
  87. * CREATE LST/FDX SUP MSG.
  88. * CALL NETPUT TO SEND SUP MSG TO NAM.
  89. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  90. *
  91. * 6: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  92. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  93. * ELSE (NIT ENTRY IS IN USE),
  94. * IF PARM-FLG1 IS NOT SET CORRECTLY,
  95. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  96. * ELSE (OKAY TO SEND LST/HDX),
  97. * CREATE LST/HDX SUP MSG.
  98. * CALL NETPUT TO SEND SUP MSG TO NAM.
  99. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  100. *
  101. * 7: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  102. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  103. * ELSE (CONNECTION NUMBER IS OKAY),
  104. * CREATE LST/OFF SUP MSG.
  105. * CALL NETPUT TO SEND SUP MSG TO NAM.
  106. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  107. *
  108. * 8: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  109. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  110. * ELSE (CONNECTION NUMBER IS OKAY),
  111. * CREATE LST/ON SUP MSG.
  112. * CALL NETPUT TO SEND SUP MSG TO NAM.
  113. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  114. *
  115. * 9: IF K-DISPLAY IS NOT ASSIGNED TO APPLICATION,
  116. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  117. * ELSE (K-DISPLAY IS ASSIGNED TO APP),
  118. * IF NO SIZE SPECIFED FOR DISPLAY DATA,
  119. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  120. * ELSE (SIZE SPECIFIED FOR DISPLAY DATA),
  121. * IF SPECIFIED SIZE IS TOO LARGE,
  122. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  123. * ELSE (SPECIFIED SIZE IS OKAY),
  124. * IF PARM-FLG1 NOT SET TO GOOD VALUE,
  125. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  126. * ELSE (OKAY TO SEND HOP/DIS SUP MSG),
  127. * CREATE FRAGMENTED ARRAYS FOR SUP MSG.
  128. * CREATE HOP/DIS SUP MSG.
  129. * CALL NETPUTF TO SEND SUP MSG TO NAM.
  130. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  131. *
  132. * 10: IF APPLICATION DOES NOT SUPPORT K-DISPLAY,
  133. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  134. * ELSE (APPLICATION SUPPORTS K-DISPLAY),
  135. * IF NO SIZE SPECIFIED FOR DAYFILE MESSAGE,
  136. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  137. * ELSE (SIZE SPECIFIED FOR DAYFILE MESSAGE),
  138. * IF SPECIFED SIZE IS TOO LARGE,
  139. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  140. * ELSE (GOOD SIZE SPECIFIED FOR DAYFILE MESSAGE),
  141. * CREATE FRAGMENTED ARRAYS FOR SUP MSG.
  142. * CREATE HOP/LG SUP MSG.
  143. * CALL NETPUTF TO SEND SUP MSG TO NAM.
  144. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  145. *
  146. * 11: IF APPLICATION DOES NOT SUPPORT K-DISPLAY,
  147. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  148. * ELSE (APPLICATION SUPPORTS K-DISPLAY),
  149. * IF OPERATOR NOT IGNORING THIS APPLICATION,
  150. * CREATE HOP/ALT SUP MSG.
  151. * CALL NETPUT TO SEND SUP MSG TO NAM.
  152. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  153. *
  154. * 12: IF K-DISPLAY IS NOT ASSIGNED TO APPLICATION,
  155. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  156. * ELSE (K-DISPLAY IS ASSIGNED TO APP),
  157. * IF PARM-FLG1 NTO SET TO GOOD VALUE,
  158. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  159. * ELSE (OKAY TO SEND HOP/DAY SUP MSG),
  160. * CREATE HOP/DAY SUP MSG.
  161. * CALL NETPUT TO SEND SUP MSG TO NAM.
  162. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  163. *
  164. * 13: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  165. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  166. * ELSE (CONNECTION NUMBER IS OKAY),
  167. * IF PARM-FLG1 NTO SET TO GOOD VALUE,
  168. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  169. * ELSE (OKAY TO SEND DC/STMR SUP MSG),
  170. * CREATE DC/STMR SUP MSG.
  171. * CALL NETPUT TO SEND SUP MSG TO NAM.
  172. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  173. *
  174. * 14: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  175. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  176. * ELSE (CONNECTION NUMBER IS OKAY),
  177. * IF PRU INTERFACE IS NOT ALLOWED ON THIS DEVICE TYPE,
  178. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  179. * ELSE (PRU INTERFACE ALLOWED ON THIS DEVICE TYPE),
  180. * IF CONNECTION STATE IS NOT NORMAL,
  181. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  182. * ELSE (CONNECTION IS IN CORRECT STATE),
  183. * IF DOWNLINE BLOCKS OUTSTANDING,
  184. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  185. * ELSE (NOT WAITING FOR ANY BACKS),
  186. * IF INVALID PRU SIZE SPECIFIED,
  187. * SET SEC-RETURN-CODE FIELD IN NIT TO ERR CODE .
  188. * ELSE (OKAY TO SEND PRU/ON/R SUP MSG),
  189. * CREATE PRU/ON/R SUP MSG.
  190. * CALL NETPUT TO SEND SUP MSG TO NAM.
  191. * UPDATE CONNECTION STATE IN NIT.
  192. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  193. *
  194. * 15: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  195. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  196. * ELSE (CONNECTION NUMBER IS OKAY),
  197. * IF CONNECTION STATE IS NOT PRU CONNECTION STATE,
  198. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  199. * ELSE (CONNECTION IS IN RIGHT STATE),
  200. * IF NO SIZE SPECIFIED FOR SET/DEV TEXT,
  201. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  202. * ELSE (SIZE WAS SPECIFIED FOR SET/DEV TEXT),
  203. * IF SPECIFIED SIZE IS TOO LARGE,
  204. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  205. * ELSE (VALID SIZE WAS SPECIFIED FOR SET/DEV TEXT),
  206. * CREATE SET/DEV SUP MSG.
  207. * CREATE FRAGMENTED ARRAYS FOR SUP MSG.
  208. * CALL NETPUTF TO SEND SUP MSG TO NAM.
  209. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  210. *
  211. * 16: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  212. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  213. * ELSE (CONNECTION NUMBER IS OKAY),
  214. * IF CONNECTION STATE IS NOT PRU CONNECTION STATE,
  215. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  216. * ELSE (CONNECTION IS IN RIGHT STATE),
  217. * IF NO SIZE SPECIFIED FOR SET/FILE TEXT,
  218. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  219. * ELSE (SIZE WAS SPECIFIED FOR SET/FILE TEXT),
  220. * IF SPECIFIED SIZE IS TOO LARGE,
  221. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  222. * ELSE (VALID SIZE WAS SPECIFIED FOR SET/FILE TEXT),
  223. * CREATE SET/FILE SUP MSG.
  224. * CREATE FRAGMENTED ARRAYS FOR SUP MSG.
  225. * CALL NETPUTF TO SEND SUP MSG TO NAM.
  226. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  227. *
  228. * 17: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  229. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  230. * ELSE (CONNECTION NUMBER IS OKAY),
  231. * IF CONNECTION STATE IS NOT PRU CONNECTION STATE,
  232. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  233. * ELSE (CONNECTION IS IN RIGHT STATE),
  234. * IF NO SIZE SPECIFIED FOR OFC/DATA TEXT,
  235. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  236. * ELSE (SIZE WAS SPECIFIED FOR OFC/DATA TEXT),
  237. * IF SPECIFIED SIZE IS TOO LARGE,
  238. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  239. * ELSE (VALID SIZE WAS SPECIFIED FOR OFC/DATA TEXT),
  240. * CREATE OFC/DATA/R SUP MSG.
  241. * CREATE FRAGMENTED ARRAYS FOR SUP MSG.
  242. * CALL NETPUTF TO SEND SUP MSG TO NAM.
  243. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  244. *
  245. * 18: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  246. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  247. * ELSE (CONNECTION NUMBER IS OKAY),
  248. * IF CONNECTION STATE IS NOT INITIAL PRU STATE,
  249. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  250. * ELSE (OKAY TO SEND OFC/STRT SUPERVISORY MESSAGE),
  251. * CREATE OFC/STRT/R SUP MSG.
  252. * CREATE FRAGMENTED ARRAYS FOR SUP MSG.
  253. * CALL NETPUTF TO SEND SUP MSG TO NAM.
  254. * UPDATE CONNECTION STATE IN NIT.
  255. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  256. *
  257. * 19: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  258. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  259. * ELSE (CONNECTION NUMBER IS OKAY),
  260. * IF CONNECTION STATE IS NOT STOPPED PRU STATE,
  261. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  262. * ELSE (OKAY TO SEND RESTART PRU TRAFFIC),
  263. * IF NETWORK NEEDS TO BE RESTARTED,
  264. * CREATE OFC/RSTR SUP MSG.
  265. * ELSE (ONLY PIP NEEDS TO BE RESTARTED),
  266. * CREATE OFC/RSM SUP MSG.
  267. * CALL NETPUT TO SEND SUP MSG TO NAM.
  268. * UPDATE CONNECTION STATE IN NIT.
  269. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  270. *
  271. * 20: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  272. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  273. * ELSE (CONNECTION NUMBER IS OKAY),
  274. * IF CONNECTION STATE IS NOT IN ACTIVE PRU STATE,
  275. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  276. * ELSE (OKAY TO SEND STOP PRU TRAFFIC),
  277. * CREATE OFC/STP/R SUP MSG.
  278. * CALL NETPUT TO SEND SUP MSG TO NAM.
  279. * UPDATE CONNECTION STATE IN NIT.
  280. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  281. *
  282. * 21: IF BAD CONNECTION NUMBER WAS SPECIFIED,
  283. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  284. * ELSE (CONNECTION NUMBER IS OKAY),
  285. * IF CONNECTION STATE IN PRU CONNECTION STATE,
  286. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  287. * ELSE (OKAY TO SEND ABORT PRU TRAFFIC),
  288. * CREATE OFC/ABT/R SUP MSG.
  289. * CALL NETPUT TO SEND SUP MSG TO NAM.
  290. * UPDATE CONNECTION STATE IN NIT.
  291. * SET RETURN CODE IN NIT TO NORMAL COMPLETION.
  292. *
  293. * ELSE (INVALID SUPERVISORY MESSAGE CODE),
  294. * SET SEC-RETURN-CODE FIELD IN NIT TO ERROR CODE.
  295. *
  296. * 4. ENTRY CONDITIONS.
  297. * SMC COMMAND CODE
  298. * WSA ADDR OF TEXT FOR SOME OF THE SUP MSG
  299. *
  300. * 5. NORMAL EXIT CONDITIONS.
  301. * NIT$RC NORMAL COMPLETION RETURN CODE
  302. *
  303. * 6. ABNORMAL EXIT CONDITIONS.
  304. * NIT$RC QTCMD REJECT RETURN CODE
  305. * NIT$S$RC REASON FOR QTCMD REJECTING CALL
  306. *
  307. * 7. COMDECKS AND SYMPL TEXT USED.
  308. * AIPDEF AIP DEFINITIONS
  309. * NP$CRT CDC COPYRIGHT
  310. * QTRMBUF QTRM SUP MSG BUFFER
  311. * QTRMCOM QTRM VARIABLES
  312. * QTRMNIT NIT
  313. *
  314. * 8. ROUTINES AND OVERLAYS CALLED.
  315. * CHKCN INTERNAL FUNCTION TO CHECK CONNECTION
  316. * NETPUT OUTPUT SUP MSG TO THE NETWORK
  317. * NETPUTF OUTPUT FRAGMENTED SUP MSG TO THE NETWORK
  318. * NP$ERR ISSUE ERROR MESSAGE AND ABORT APP
  319. * QTTIP SEND SYNCHRONOUS SUPERVISORY MESSAGE
  320. *
  321. * 9. DAYFILE MESSAGES OR OTHER IMPORTANT INFORMATION.
  322. * *** NETWORK APPLICATION ABORTED, RC = 77. ***
  323. * *** QTSUP: REQUEST INVALID BEFORE QTOPEN. ***
  324. *
  325.  #
  326. *ENDIF
  327.  
  328. # CONTROL DEFINITIONS
  329. #
  330. CONTROL PRESET;
  331. CONTROL PACK;
  332. CONTROL DISJOINT;
  333. CONTROL INERT;
  334. CONTROL FASTLOOP;
  335.  
  336. *CALL NP$CRT
  337. #
  338.   INPUT VARIABLES
  339. #
  340. ITEM SMC ; # SUPERVISORY MESSAGE CODE #
  341. ITEM WSA ; # ADDR OF TEXT FOR SOME OF THE SUP MSGS #
  342. DEF ENDTAB # 7 #; # SIZE OF TABLE FOR CHECKING PFC/SFCS #
  343. BASED ARRAY QPFSFC[0:0] S(1);
  344. BEGIN
  345. ITEM QPFCSFC U(00,00,16);
  346. END
  347. ARRAY QPFCSFCTAB [0:ENDTAB];
  348. BEGIN
  349. ITEM QTRSMFC U(00,00,16) =
  350. [CONEND, # 0 #
  351. CONACR, # 1 #
  352. FCBRK, # 2 #
  353. INTRAPP, # 3 #
  354. PRUON, # 4 #
  355. OFCDTA, # 5 #
  356. OFCSTP, # 6 #
  357. OFCABRT # 7 #
  358. ];
  359. END
  360. #
  361.   ROUTINES CALLED
  362. #
  363. XREF
  364. BEGIN
  365. PROC NETPUT; # OUTPUT SUP MSG TO THE NETWORK #
  366. PROC NETPUTF; # OUTPUT FRAGMENTED SUP MSG TO THE NETWORK#
  367. PROC NP$ERR; # DAYFILE ERROR MESSAGE AND ABORT APP #
  368. PROC QTTIP; # SEND SYNCHRONOUS SUPERVISORY MESSAGE #
  369. END
  370.  
  371. XDEF
  372. BEGIN
  373. FUNC CHKCN B; # CHECK IF CONNECTION NUMBER IS VALID #
  374. END
  375. #
  376.   LOCAL VARIABLES
  377. #
  378. DEF MINSMC#0#; # MINIMUM SUPERVISORY MESSAGE CODE #
  379. DEF MAXSMC#21#; # MAXIMUM SUPERVISORY MESSAGE CODE #
  380.  
  381. ITEM ACN; # CONNECTION NO ASSOCIATED WITH SUP MSG #
  382. ITEM I; # NUMBER OF FRAGMENTS #
  383. ITEM INDEX; # LOOP INDEX #
  384.  
  385. SWITCH SWTCH$SMC SMC$0,SMC$1,SMC$2,SMC$3,SMC$4,SMC$5,SMC$6,
  386. SMC$7,SMC$8,SMC$9,SMC$10,SMC$11,SMC$12,SMC$13,
  387. SMC$14,SMC$15,SMC$16,SMC$17,SMC$18,SMC$19,
  388. SMC$20,SMC$21;
  389.  
  390. #**********************************************************************#
  391. CONTROL EJECT;
  392.  
  393. #
  394.   EXECUTABLE CODE BEGINS HERE
  395. #
  396. BEGIN
  397. IF NOT NETON$STATUS
  398. THEN # QTOPEN HAS NOT BEEN CALLED #
  399. BEGIN
  400. NP$ERR("77"); # ISSUE ERROR MESSAGE AND ABORT APP #
  401. END
  402.  
  403. P<NIT> = NIT$ADDR; # ADDRESS OF NETWORK INFORMATION TABLE #
  404. ACN = NIT$CON; # CONNECTION NUMBER FROM NIT #
  405. NIT$RC[0] = S"QTSUPREJ"; # INITIALIZE RETURN CODE TO QTSUP REJ #
  406.  
  407. IF (SMC GQ MINSMC) AND
  408. (SMC LQ MAXSMC)
  409. THEN # VALID COMMAND CODE #
  410. BEGIN
  411.  
  412. ABHWORD[0] = 0; # CLEAR APP BLOCK HEADER WORD #
  413. ABHABT[0] = APPCMD; # APP BLOCK TYPE FOR ASYNC SUP MSG #
  414. ABHACT[0] = CT60TRANS; # APP CHAR TYPE FOR ASYNC SUP MSG #
  415. SPMSG0[0] = 0; # CLEAR FIRST WORD OF SUP MSG BUFFER #
  416. SPMSG1[0] = 0; # CLEAR SECOND WORD OF SUP MSG BUFFER #
  417.  
  418. GOTO SWTCH$SMC[SMC];
  419.  
  420. SMC$0: # SEND SUPERVISORY MESSAGE #
  421.  
  422. BEGIN
  423. IF NIT$CTLC[0] EQ 0
  424. THEN # NO SIZE SPECIFIED FOR SUP MSG #
  425. BEGIN
  426. NIT$S$RC[0] = S"NOSIZE"; # STORE REASON FOR BAD CALL #
  427. END
  428. ELSE # SIZE SPECIFIED FOR SUP MSG #
  429. BEGIN
  430. IF NIT$CTLC[0] GR 410
  431. THEN # SIZE OF SUP MSG IS TOO LARGE #
  432. BEGIN
  433. NIT$S$RC[0] = S"BADSIZE"; # STORE REASON FOR BAD CALL #
  434. END
  435. ELSE # SIZE SPECIFIED FOR SUP MSG #
  436. BEGIN
  437. P<QPFSFC> = LOC(WSA);# SET SUPERVISORY MESSAGE TEMPLETE #
  438. # TO THE ACTUAL SUPERVISORY MSG #
  439. FOR INDEX = 0 STEP 1 UNTIL ENDTAB
  440. DO
  441. BEGIN
  442. IF QTRSMFC[INDEX] EQ QPFCSFC[0]
  443. THEN
  444. BEGIN
  445. NP$ERR("84"); # RESERVED PFCSFC USED #
  446. END
  447. END
  448. ABHTLC[0] = NIT$CTLC[0]; # SIZE OF SUPERVISORY MESSAGE #
  449. NOFRAG = (NIT$CTLC[0]+62)/63; # NUMBER OF FRAGMENTS #
  450. FOR I = 0 STEP 1 UNTIL NOFRAG-1
  451. DO # CREATE FRAGMENT ARRAY FOR SUP MSG #
  452. BEGIN
  453. FRAGSZ0[I] = 63; # SIZE OF FRAGMENT #
  454. FRAGAD0[I] = LOC(WSA) + I*63; # ADDRESS OF FRAGMENT #
  455. END
  456. NETPUTF(HEADER,NOFRAG,FRAG); # SEND SUP MSG TO NAM #
  457. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  458. END
  459. END
  460. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  461. END
  462.  
  463. SMC$1: # SEND FC/BRK SUP MSG #
  464.  
  465. BEGIN
  466. IF CHKCN
  467. THEN # GOOD CONNECTION NUMBER SPECIFIED #
  468. BEGIN
  469. IF NIT$STATE[ACN] NQ S"OK"
  470. THEN # CANNOT SEND FC/BRK AT THIS TIME #
  471. BEGIN
  472. NIT$S$RC[0] = S"BADSTATE"; # STORE REASON FOR BAD CALL #
  473. END
  474. ELSE # OKAY TO SEND FC/BRK SUP MSG #
  475. BEGIN
  476. ABHTLC[0] = LFCBRK; # LENGTH OF FC/BRK SUP MSG #
  477. PFCSFC[0] = FCBRK; # PFC/SFC VALUE FOR FC/BRK #
  478. RC[0] = NIT$SB$RC[0]; # REASON CODE FOR BREAK SUP MSG #
  479. FCACN[0] = ACN; # CONNECTION NUMBER TO RECEIVE FC/BRK #
  480. NETPUT(HEADER,SUP$MES); # SEND FC/BRK SUP MSG TO NAM #
  481.  
  482. NIT$STATE[ACN] = S"FCBRK"; # NEW STATE FOR CONNECTION #
  483.  
  484. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  485. END
  486. END
  487. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  488. END
  489.  
  490. SMC$2: # SEND DC/CICT SUP MSG #
  491.  
  492. BEGIN
  493. IF CHKCN
  494. THEN # GOOD CONNECTION NUMBER SPECIFIED #
  495. BEGIN
  496. IF (NIT$CHAR$SET[0] GR CT6DISPLAY) AND
  497. (NIT$CHAR$SET[0] NQ 10) AND
  498. (NIT$CHAR$SET[0] NQ 11)
  499. THEN # BAD CHARACTER SET VALUE SPECIFIED #
  500. BEGIN
  501. NIT$S$RC[0] = S"BADICT"; # STORE REASON FOR BAD CALL #
  502. END
  503. ELSE # CHARACTER SET VALUE WITHIN RANGE #
  504. BEGIN
  505. IF (ICTD[0] EQ CT6DISPLAY) AND # INITIAL ICT IS DIS CD #
  506. (NIT$CHAR$SET[0] NQ 0) AND
  507. ((NIT$DEVTYP[ACN] EQ DT$INTA) OR #INTRAHOST A-A CON #
  508. (NIT$DEVTYP[ACN] EQ DT$INTE)) # INTERHOST A-A CON #
  509. THEN
  510. BEGIN
  511. NIT$S$RC[0] = S"CCICT"; # CANNOT CHANGE ICT #
  512. END
  513. ELSE # OKAY TO CHANGE INPUT CHAR SET FOR DATA #
  514. BEGIN
  515. IF (NIT$PARMFLG1[0] NQ 0) AND
  516. (NIT$PARMFLG1[0] NQ CT8ASCII) AND
  517. (NIT$PARMFLG1[0] NQ CT12ASCII)
  518. THEN # BAD ICT FOR SYNC SUP MSG #
  519. BEGIN
  520. NIT$S$RC[0] = S"BADICTS"; # STORE REASON FOR BAD CAL#
  521. END
  522. ELSE # OKAY TO SEND DC/CICT SUP MSG #
  523. BEGIN
  524. ABHTLC[0] = LDC; # LENGTH OF DC/CICT SUP MSG #
  525. PFCSFC[0] = DCCICT; # PFC/SFC VALUE FOR DC/CICT #
  526. IF NIT$PARMFLG1[0] EQ 0
  527. THEN # NO ICT SPECIFIED FOR SYNC SUP MSG #
  528. BEGIN
  529. IF NIT$SICT[ACN] EQ CT12ASCII
  530. THEN # PREVIOUS ICT WAS 12 BIT ASCII #
  531. BEGIN
  532. DCSCT[0] = TRUE; # SET FLAG FOR 12 BIT ASCII #
  533. END
  534. END
  535. ELSE # NEW ICT FOR SYNC SUP MSG SPECIFIED #
  536. BEGIN
  537. NIT$SICT[ACN] = NIT$PARMFLG1[0]; # SAVE ICT IN NIT#
  538. IF NIT$PARMFLG1[0] EQ CT12ASCII
  539. THEN # ICT FOR SYNC SUP MSG IS 12 BIT ASCII #
  540. BEGIN
  541. DCSCT[0] = TRUE; # SET FLAG FOR 12 BIT ASCII #
  542. END
  543. END
  544. IF NIT$CHAR$SET[0] EQ 0
  545. THEN # NO ICT SPECIFIED FOR DATA #
  546. BEGIN
  547. DCACT[0] = ICTD[0]; # OLD INPUT CHARACTER TYPE #
  548. DCNXP[0] = ICTX[0]; # OLD TRANSPARENT DATA FLAG #
  549. END
  550. ELSE # NEW CHAR SET SPECIFIED FOR INPUT DATA #
  551. BEGIN
  552. NIT$ICT[ACN] = NIT$CHAR$SET[0]; # SAVE NEW ICT #
  553. DCACT[0] = NIT$PUTSET; # NEW INPUT CHAR TYPE #
  554. IF NIT$XPTSET[0] EQ 0
  555. THEN # NO TRANSPARENT DATA DESIRED #
  556. BEGIN
  557. DCNXP[0] = TRUE; # NO TRANSPARENT DATA DESIRED #
  558. END
  559. END
  560. DCACN[0] = ACN; # CONNECTION NO TO RECEIVE DC/CICT #
  561. NETPUT(HEADER,SUP$MES); # SEND DC/CICT TO NAM #
  562.  
  563. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  564. END
  565. END
  566. END
  567. END
  568. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  569. END
  570.  
  571. SMC$3: # SEND DC/TRU SUP MSG #
  572.  
  573. BEGIN
  574. IF (ACN EQ 0) OR
  575. ((ACN NQ 0) AND
  576. (CHKCN))
  577. THEN # OKAY TO SEND DC/TRU SUP MSG #
  578. BEGIN
  579. ABHTLC[0] = LDC; # LENGTH OF DC/TRU SUP MSG #
  580. PFCSFC[0] = DCTRU; # PFC/SFC VALUE FOR DC/TRU #
  581. DCACN[0] = ACN; # CONNECTION NUMBER FOR DATA TRUNCATION #
  582. NETPUT(HEADER,SUP$MES); # SEND FC/BRK SUP MSG TO NAM #
  583.  
  584. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  585. END
  586. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  587. END
  588.  
  589. SMC$4: # SEND INTR/APP SUP MSG #
  590.  
  591. BEGIN
  592. IF CHKCN
  593. THEN # GOOD CONNECTION NUMBER SPECIFIED #
  594. BEGIN
  595. IF NIT$STATE[ACN] NQ S"OK"
  596. THEN # CANNOT SEND INTR/APP AT THIS TIME #
  597. BEGIN
  598. NIT$S$RC[0] = S"BADSTATE"; # STORE REASON FOR BAD CALL #
  599. END
  600. ELSE # OKAY TO SEND INTR/APP SUP MSG #
  601. BEGIN
  602. ABHTLC[0] = LINTR; # LENGTH OF INTR/APP SUP MSG #
  603. PFCSFC[0] = INTRAPP; # PFC/SFC VALUE FOR FC/BRK #
  604. RC[0] = NIT$SB$RC[0]; # REASON CODE FOR INTR SUP MSG #
  605. INTRACN[0] = ACN; # CONNECTION NO TO RECEIVE INTR/APP #
  606. NETPUT(HEADER,SUP$MES); # SEND INCT/APP SUP MSG TO NAM #
  607. #
  608.   SEND TERMINATE OUTPUT MARKER IF TERMINAL CONNECTION
  609. #
  610. NIT$STATE[ACN] = S"INTRRSP"; # NEW STATE FOR CONNECTION #
  611. IF NIT$DEVTYP[ACN] EQ 0
  612. THEN # TERMINAL CONNECTION #
  613. BEGIN
  614. IF NIT$C$ABL[ACN] NQ 0
  615. THEN # OKAY TO SEND TO/MARK SUP MSG #
  616. BEGIN
  617. NIT$CHAR$SET[0] = CT8ASCII; # APPLICATION CHAR TYPE #
  618. NIT$CTLC[0] = LTOMARK; # LENGTH OF SUP MSG #
  619. SPMSG0[0] = 0;
  620. PFCSFC[0] = TOMARK; # PFC/SFC VALUE FOR TO/MARK #
  621. QTTIP(SUP$MES); # SEND SYNC SUP MSG #
  622.  
  623. END
  624. ELSE # CANNOT SEND TO/MARK UNTIL RECEIVE FC/ACK#
  625. BEGIN
  626. NIT$STATE[ACN] = S"WTOMARK"; # CHANGE STATE #
  627. END
  628. END
  629. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  630. END
  631. END
  632. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  633. END
  634.  
  635. SMC$5: # SEND LST/FDX SUP MSG #
  636.  
  637. BEGIN
  638. IF (ACN EQ 0) OR
  639. ((ACN NQ 0) AND
  640. (CHKCN))
  641. THEN # OKAY TO SEND LST/FDX SUP MSG #
  642. BEGIN
  643. ABHTLC[0] = LLST; # LENGTH OF LST/FDX SUP MSG #
  644. PFCSFC[0] = LSTFDX; # PFC/SFC VALUE FOR LST/FDX #
  645. LSTACN[0] = ACN; # CONNECTION NUMBER FOR FULL DUPLEX #
  646. NETPUT(HEADER,SUP$MES); # SEND LST/FDX SUP MSG TO NAM #
  647.  
  648. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  649. END
  650. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  651. END
  652.  
  653. SMC$6: # SEND LST/HDX SUP MSG #
  654.  
  655. BEGIN
  656. IF (ACN EQ 0) OR
  657. ((ACN NQ 0) AND
  658. (CHKCN))
  659. THEN # GOOD CONNECTION NUMBER SPECIFIED #
  660. BEGIN
  661. IF (NIT$PARMFLG1[0] NQ 0) AND
  662. (NIT$PARMFLG1[0] NQ 1)
  663. THEN # BAD VALUE SPECIFIED FOR PARM-FLG1 IN NIT#
  664. BEGIN
  665. NIT$S$RC[0] = S"BADDISF"; # STORE REASON FOR BAD CALL #
  666. END
  667. ELSE # GOOD VALUE SPECIFIED IN PARM-FLG1 IN NIT#
  668. BEGIN
  669. LSTDIS[0] = FALSE; # INITIAL ENABLE FOR LIST PROCESS #
  670. IF NIT$PARMFLG1[0] NQ 0
  671. THEN # APP WANTS INITIAL LIST PROCESS DISABLED #
  672. BEGIN
  673. LSTDIS[0] = TRUE; # INITIAL DISABLE FOR LIST PROCESS #
  674. END
  675. ABHTLC[0] = LLST; # LENGTH OF LST/HDX SUP MSG #
  676. PFCSFC[0] = LSTHDX; # PFC/SFC VALUE FOR LSTHDX #
  677. LSTACN[0] = ACN; # CONNECTION NO TO GO TO HALF DUPLEX #
  678. NETPUT(HEADER,SUP$MES); # SEND LST/HDX SUP MSG TO NAM #
  679.  
  680. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  681. END
  682. END
  683. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  684. END
  685.  
  686. SMC$7: # SEND LST/OFF SUP MSG #
  687.  
  688. BEGIN
  689. IF CHKCN
  690. THEN # OKAY TO SEND LST/OFF SUP MSG #
  691. BEGIN
  692. ABHTLC[0] = LLST; # LENGTH OF LST/OFF SUP MSG #
  693. PFCSFC[0] = LSTOFF; # PFC/SFC VALUE FOR LST/OFF #
  694. LSTACN[0] = ACN; # CONNECTION NUMBER TO TURN LIST OFF #
  695. NETPUT(HEADER,SUP$MES); # SEND LST/OFF SUP MSG TO NAM #
  696.  
  697. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  698. END
  699. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  700. END
  701.  
  702. SMC$8: # SEND LST/ON SUP MSG #
  703.  
  704. BEGIN
  705. IF CHKCN
  706. THEN # OKAY TO SEND LST/ON SUP MSG #
  707. BEGIN
  708. ABHTLC[0] = LLST; # LENGTH OF LST/ON SUP MSG #
  709. PFCSFC[0] = LSTON; # PFC/SFC VALUE FOR LST/ON #
  710. LSTACN[0] = ACN; # CONNECTION NUMBER TO TURN LIST ON #
  711. NETPUT(HEADER,SUP$MES); # SEND LST/ON SUP MSG TO NAM #
  712.  
  713. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  714. END
  715. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  716. END
  717.  
  718. SMC$9: # SEND HOP/DIS SUPERVISORY MESSAGE #
  719.  
  720. BEGIN
  721. IF NOT KDISAS
  722. THEN # APP IS NOT ASSIGNED TO K-DISPLAY #
  723. BEGIN
  724. NIT$S$RC[0] = S"KNOTASS"; # STORE REASON FOR BAD CALL #
  725. END
  726. ELSE # APP SUPPORTS NAM K-DISPLAY #
  727. BEGIN
  728. IF NIT$CTLC[0] EQ 0
  729. THEN # NO SIZE SPECIFIED FOR DISPLAY DATA #
  730. BEGIN
  731. NIT$S$RC[0] = S"NOSIZE"; # STORE REASON FOR BAD CALL #
  732. END
  733. ELSE # SIZE WAS SPECIFIED FOR DISPLAY DATA #
  734. BEGIN
  735. IF NIT$CTLC[0] GR 410
  736. THEN # SPECIFIED SIZE IS TOO LARGE #
  737. BEGIN
  738. NIT$S$RC[0] = S"BADSIZE"; # STORE REASON FOR BAD CALL #
  739. END
  740. ELSE # SIZE SPECIFIED FOR DISPLAY DATA IS OKAY #
  741. BEGIN
  742. IF (NIT$PARMFLG1[0] NQ 0) AND
  743. (NIT$PARMFLG1[0] GQ 4)
  744. THEN # BAD VALUE SPECIFIED FOR PARM-FLG1 IN NIT#
  745. BEGIN
  746. NIT$S$RC[0] = S"BADINF"; # STORE REASON FOR BAD CALL#
  747. END
  748. ELSE # GOOD VALUE SPECIFIED IN PARM-FLG1 IN NIT#
  749. BEGIN
  750. HOPI[0] = FALSE; # INITIAL DISABLED FOR INPUT #
  751. IF (NIT$PARMFLG1[0] EQ 1) OR
  752. (NIT$PARMFLG1[0] EQ 3)
  753. THEN # APP WANTS INPUT ENABLED #
  754. BEGIN
  755. HOPI[0] = TRUE; # SET FLAG FOR INPUT ALLOWED #
  756. END
  757. IF (NIT$PARMFLG1[0] EQ 2) OR
  758. (NIT$PARMFLG1[0] EQ 3)
  759. THEN # DISPLAY DATA IS FOR RIGHT SCREEN #
  760. BEGIN
  761. HOPSCR[0] = TRUE;
  762. END
  763. ABHTLC[0] = NIT$CTLC[0] + 2; # LENGTH OF HOP/DIS #
  764.  
  765. PFCSFC[0] = HOPDIS; # PFC/SFC VALUE FOR HOP/DIS #
  766.  
  767. NOFRAG = (NIT$CTLC[0]+62)/63 + 2; # NUMBER OF FRAGS #
  768. FRAGSZ0[0] = 1; # SIZE OF FIRST FRAGMENT #
  769. FRAGAD0[0] = LOC(SUP$MES); # ADDR OF FIRST FRAGMENT #
  770. FOR I = 1 STEP 1 UNTIL NOFRAG - 2
  771. DO # CREATE FRAGMENT ARRAY FOR SUP MSG #
  772. BEGIN
  773. FRAGSZ0[I] = 63; # SIZE OF FRAGMENT #
  774. FRAGAD0[I] = LOC(WSA) + (I-1)*63; # ADDR OF FRAG #
  775. END
  776. FRAGSZ0[NOFRAG-2] = NIT$CTLC[0] - (NOFRAG-3)*63;
  777. FRAGSZ0[NOFRAG-1] = 1; # SIZE OF LAST FRAGMENT #
  778. FRAGAD0[NOFRAG-1] = LOC(SUP$MES) + 1; # LAST FRAG ADR#
  779.  
  780. NETPUTF(HEADER,NOFRAG,FRAG); # SEND HOP/DIS TO NAM #
  781.  
  782. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  783. END
  784. END
  785. END
  786. END
  787. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  788. END
  789.  
  790. SMC$10: # SEND HOP/LG SUPERVISORY MESSAGE #
  791.  
  792. BEGIN
  793. IF NOT KDISPLAY
  794. THEN # APP DOES NOT SUPPORT K-DISPLAY #
  795. BEGIN
  796. NIT$S$RC[0] = S"KNOTSUP"; # STORE REASON FOR BAD CALL #
  797. END
  798. ELSE # APP SUPPORTS NAM K-DISPLAY #
  799. BEGIN
  800. IF NIT$CTLC[0] EQ 0
  801. THEN # NO SIZE SPECIFIED FOR DAYFILE MSG #
  802. BEGIN
  803. NIT$S$RC[0] = S"NOSIZE"; # STORE REASON FOR BAD CALL #
  804. END
  805. ELSE # SIZE SPECIFIED FOR DAYFILE MESSAGE #
  806. BEGIN
  807. IF (NIT$CTLC[0] GR 8)
  808. THEN # SPECIFIED SIZE IS TOO LARGE #
  809. BEGIN
  810. NIT$S$RC[0] = S"BADSIZE"; # STORE REASON FOR BAD CALL #
  811. END
  812. ELSE # GOOD SIZE SPECIFIED FOR SUP MSG #
  813. BEGIN
  814. ABHTLC[0] = NIT$CTLC[0] + 1; # LENGTH OF HOP/LG #
  815. PFCSFC[0] = HOPLG; # PFC/SFC VALUE FOR HOP/LG #
  816.  
  817. NOFRAG = 2; # NUMBER OF FRAGMENTS #
  818. FRAGSZ0[0] = 1; # SIZE OF FIRST FRAGMENT #
  819. FRAGAD0[0] = LOC(SUP$MES); # ADDR OF FIRST FRAGMENT #
  820. FRAGSZ0[1] = NIT$CTLC[0]; # SIZE OF SECOND FRAGMENT #
  821. FRAGAD0[1] = LOC(WSA); # ADDR OF SECOND FRAGMENT #
  822.  
  823. NETPUTF(HEADER,NOFRAG,FRAG); # SEND HOP/LG TO NAM #
  824.  
  825. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  826. END
  827. END
  828. END
  829. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  830. END
  831.  
  832. SMC$11: # SEND HOP/ALT SUPERVISORY MESSAGE #
  833.  
  834. BEGIN
  835. IF NOT KDISPLAY
  836. THEN # APP DOES NOT SUPPORT K-DISPLAY #
  837. BEGIN
  838. NIT$S$RC[0] = S"KNOTSUP"; # STORE REASON FOR BAD CALL #
  839. END
  840. ELSE # APP SUPPORTS NAM K-DISPLAY #
  841. BEGIN
  842. IF NOT IGNORE
  843. THEN # OPERATOR WANTS TO SEE HOP/ALT FROM APP #
  844. BEGIN
  845. ABHTLC[0] = LHOPALT; # LENGTH OF HOP/ALT SUP MSG #
  846. PFCSFC[0] = HOPALT; # PFC/SFC VALUE FOR HOP/ALT #
  847. NETPUT(HEADER,SUP$MES); # SEND LST/ON SUP MSG TO NAM #
  848. END
  849. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  850. END
  851. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  852. END
  853.  
  854. SMC$12: # SEND HOP/DAY SUPEVISORY MESSAGE #
  855. BEGIN
  856. IF NOT KDISAS
  857. THEN # APP IS NOT ASSIGNED TO K-DISPLAY #
  858. BEGIN
  859. NIT$S$RC[0] = S"KNOTASS"; # STORE REASON FOR BAD CALL #
  860. END
  861. ELSE # NAM K-DISPLAY IS ASSIGNED TO APP #
  862. BEGIN
  863. IF (NIT$PARMFLG1[0] NQ 0) AND
  864. (NIT$PARMFLG1[0] NQ 1)
  865. THEN # BAD VALUE SPECIFIED FOR PARM-FLG1 IN NIT#
  866. BEGIN
  867. NIT$S$RC[0] = S"BADDISF"; # STORE REASON FOR BAD CALL #
  868. END
  869. ELSE # GOOD VALUE SPECIFIED IN PARM-FLG1 IN NIT#
  870. BEGIN
  871. ABHTLC[0] = LHOPDAY; # LENGTH OF HOP/DAY SUP MSG #
  872. PFCSFC[0] = HOPDAY; # PFC/SFC VALUE FOR HOP/DAY #
  873. HOPDAYF[0] = NIT$PARMFLG1[0] EQ 1; # SET DAYFILING FLAG #
  874. NETPUT(HEADER,SUP$MES); # SEND HOP/DAY SUP MSG TO NAM #
  875. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  876. END
  877. END
  878. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  879. END
  880.  
  881. SMC$13: # SEND DC/STMR SUPERVISORY MESSAGE #
  882. BEGIN
  883. IF ( ACN EQ 0 ) OR
  884. ( (ACN NQ 0) AND
  885. (CHKCN ) )
  886. THEN # OKAY TO SEND DC/STMR SUP MSG #
  887. BEGIN
  888. IF (NIT$PARMFLG1[0] NQ 0) AND
  889. (NIT$PARMFLG1[0] NQ 1)
  890. THEN # BAD VALUE SPECIFIED FOR PARM-FLG1 IN NIT#
  891. BEGIN
  892. NIT$S$RC[0] = S"BADDISF"; # STORE REASON FOR BAD CALL #
  893. END
  894. ELSE # GOOD VALUE SPECIFIED IN PARM-FLG1 IN NIT#
  895. BEGIN
  896. ABHTLC[0] = LDC; # LENGTH OF DC/STMR SUP MSG #
  897. PFCSFC[0] = DCSTMR; # PFC/SFC VALUE FOR DC/STMR #
  898. DCACN[0] = ACN; # CON NO FOR SETTING INACTIVITY TIMER #
  899. DCPERMT[0] = NIT$PARMFLG1[0] EQ 1; # PERM TIME CHNGE FLG#
  900. DCTIME[0] = WSA; # SET INACTIVITY TIMER VALUE #
  901. NETPUT(HEADER,SUP$MES); # SEND DC/STMR SUP MSG TO NAM #
  902. NIT$RC[0] = S"OK"; # NORMAL COMPLETION RETURN CODE #
  903. END
  904. END
  905. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  906. END
  907.  
  908. SMC$14: # SEND PRU/ON/R SUPERVISORY MESSAGE #
  909. BEGIN
  910. IF CHKCN
  911. THEN # GOOD CONNECTION NUMBER WAS SPECIFIED #
  912. BEGIN
  913. IF NIT$DEVTYP[ACN] EQ DT$CONS OR # CONSOLE DEVICE #
  914. NIT$DEVTYP[ACN] EQ DT$INTA # INTRAHOST A-A #
  915. THEN # PRU INTERFACE NOT SUPPORTED FOR THIS DT #
  916. BEGIN
  917. NIT$S$RC[0] = NITSRTC"NOPRUSUP"; # REASON FOR BAD CALL #
  918. END
  919. ELSE # PRU INTERFACE ALLOWED ON THIS DEVICE TYP#
  920. BEGIN
  921. IF NIT$STATE[ACN] NQ STATE"OK"
  922. THEN # CONNECTION IS IN WRONG STATE TO CONVERT #
  923. BEGIN
  924. NIT$S$RC[0] = NITSRTC"BADSTATE"; # REASON FOR BAD CALL#
  925. END
  926. ELSE # NAM K-DISPLAY IS ASSIGNED TO APP #
  927. BEGIN
  928. IF NIT$ABL[ACN] NQ NIT$C$ABL[ACN]
  929. THEN # BACKS OUTSTANDING - CANNOT CONVERT #
  930. BEGIN
  931. NIT$S$RC[0] = NITSRTC"DBLKSO"; # REASON FOR BAD CALL#
  932. END
  933. ELSE # OKAY TO SEND PRU/ON SUPERVISORY MESSAGE #
  934. BEGIN
  935. IF NIT$PARMFLG1[0] EQ 0 OR
  936. NIT$PARMFLG1[0] GR 3
  937. THEN # BAD PRU SIZE WAS SPECIFIED #
  938. BEGIN
  939. NIT$S$RC[0] = NITSRTC"BADPRUS"; # BAD PRU SIZ GIVEN#
  940. END
  941. ELSE # OKAY TO SEND PRU/ON/R SUPERVISORY MSG #
  942. BEGIN
  943. ABHTLC[0] = LPRU; # LENGTH OF PRU/ON/R SUP MSG #
  944. PFCSFC[0] = PRUON; # PFC/SFC VALUE FOR PRU/ON/R #
  945. PRUACN[0] = ACN; # CONNECTION NUMBER #
  946. IF NIT$DEVTYP[ACN] EQ DT$CR
  947. THEN # UPLINE (INPUT) PRU DEVICE #
  948. BEGIN
  949. PRUUPS[0] = NIT$PARMFLG1[0]; # PRU BLOCK SIZE #
  950. END
  951. ELSE # DOWNLINE (OUTPUT) PRU DEVICE #
  952. BEGIN
  953. PRUDPS[0] = NIT$PARMFLG1[0]; # PRU BLOCK SIZE #
  954. END
  955. NETPUT(HEADER,SUP$MES); # SEND PRU/ON/R SUP MSG #
  956. NIT$STATE[ACN] = STATE"AWAITPRU"; # CHANGE STATE #
  957. NIT$RC[0] = NITRTC"OK"; # NORMAL COMPLETION RC #
  958. END
  959. END
  960. END
  961. END
  962. END
  963. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  964. END
  965.  
  966. SMC$15: # SEND SET/DEV SUPERVISORY MESSAGE #
  967. BEGIN
  968. IF CHKCN
  969. THEN # GOOD CONNECTION NUMBER WAS SPECIFIED #
  970. BEGIN
  971. IF NIT$STATE[ACN] LS STATE"PRUCN" OR
  972. NIT$STATE[ACN] GR STATE"PRUEOO"
  973. THEN # SET/DEV SUP MSG NOT ALLOWED IN THESE STA#
  974. BEGIN
  975. NIT$S$RC[0] = NITSRTC"BADSTATE"; # REASON FOR BAD CALL #
  976. END
  977. ELSE # STATE OF CON IS OKAY FOR SET/DEV SUP MSG#
  978. BEGIN
  979. IF NIT$CTLC[0] EQ 0
  980. THEN # SIZE OF SET/DEV TEXT WAS NOT SPECIFIED #
  981. BEGIN
  982. NIT$S$RC[0] = NITSRTC"NOSIZE"; # REASON FOR BAD CALL #
  983. END
  984. ELSE # SIZE SPECIFIED FOR SET/DEV TEXT #
  985. BEGIN
  986. IF NIT$CTLC[0] GR 410
  987. THEN # SIZE OF SET/DEV TEXT IS TOO LARGE #
  988. BEGIN
  989. NIT$S$RC[0] = NITSRTC"BADSIZE";#STORE RC FOR BAD CALL#
  990. END
  991. ELSE # OKAY TO SEND SET/DEV SUPERVISORY MSG #
  992. BEGIN
  993. ABHTLC[0] = NIT$CTLC[0] + 1; # LENGTH OF SET/DEV SM #
  994. PFCSFC[0] = SETDEV; # PFC/SFC OF SET/DEF SUP MSG #
  995. OFCACN[0] = ACN; # APPLICATION CONNECTION NUMBER #
  996.  
  997. NOFRAG = 2; # NUMBER OF FRAGMENTS #
  998. FRAGSZ0[0] = 1; # SIZE OF FIRST FRAGMENT #
  999. FRAGAD0[0] = LOC(SUP$MES); # ADDR OF FIRST FRAGMENT #
  1000. FRAGSZ0[1] = NIT$CTLC[0]; # SIZE OF SECOND FRAGMENT #
  1001. FRAGAD0[1] = LOC(WSA); # ADDR OF SECOND FRAGMENT #
  1002.  
  1003. NETPUTF(HEADER,NOFRAG,FRAG); # SEND SET/DEV SUP MSG #
  1004.  
  1005. NIT$RC[0] = NITRTC"OK"; # NORMAL COMPLETION RC #
  1006. END
  1007. END
  1008. END
  1009. END
  1010. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  1011. END
  1012.  
  1013. SMC$16: # SEND SET/FILE SUPERVISORY MESSAGE #
  1014. BEGIN
  1015. IF CHKCN
  1016. THEN # GOOD CONNECTION NUMBER WAS SPECIFIED #
  1017. BEGIN
  1018. IF NIT$STATE[ACN] LS STATE"PRUCN" OR
  1019. NIT$STATE[ACN] GR STATE"PRUEOO"
  1020. THEN # SET/FILE SM NOT ALLOWED IN THESE STATES #
  1021. BEGIN
  1022. NIT$S$RC[0] = NITSRTC"BADSTATE"; # REASON FOR BAD CALL #
  1023. END
  1024. ELSE # STATE OF CON IS OK FOR SET/FILE SUP MSG #
  1025. BEGIN
  1026. IF NIT$CTLC[0] EQ 0
  1027. THEN # SIZE OF SET/FILE TEXT WAS NOT SPECIFIED #
  1028. BEGIN
  1029. NIT$S$RC[0] = NITSRTC"NOSIZE"; # REASON FOR BAD CALL #
  1030. END
  1031. ELSE # SIZE SPECIFIED FOR SET/FILE TEXT #
  1032. BEGIN
  1033. IF NIT$CTLC[0] GR 410
  1034. THEN # SIZE OF SET/FILE TEXT IS TOO LARGE #
  1035. BEGIN
  1036. NIT$S$RC[0] = NITSRTC"BADSIZE";#STORE RC FOR BAD CALL#
  1037. END
  1038. ELSE # OKAY TO SEND SET/FILE SUPERVISORY MSG #
  1039. BEGIN
  1040. ABHTLC[0] = NIT$CTLC[0] + 1; # LENGTH OF SET/FILE SM#
  1041. PFCSFC[0] = SETFLE; # PFC/SFC OF SET/FILE SUP MSG #
  1042. OFCACN[0] = ACN; # APPLICATION CONNECTION NUMBER #
  1043.  
  1044. NOFRAG = 2; # NUMBER OF FRAGMENTS #
  1045. FRAGSZ0[0] = 1; # SIZE OF FIRST FRAGMENT #
  1046. FRAGAD0[0] = LOC(SUP$MES); # ADDR OF FIRST FRAGMENT #
  1047. FRAGSZ0[1] = NIT$CTLC[0]; # SIZE OF SECOND FRAGMENT #
  1048. FRAGAD0[1] = LOC(WSA); # ADDR OF SECOND FRAGMENT #
  1049.  
  1050. NETPUTF(HEADER,NOFRAG,FRAG); # SEND SET/FILE SUP MSG #
  1051.  
  1052. NIT$RC[0] = NITRTC"OK";# NORMAL COMPLETION RETURN COD#
  1053. END
  1054. END
  1055. END
  1056. END
  1057. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  1058. END
  1059.  
  1060. SMC$17: # SEND OFC/DATA SUPERVISORY MESSAGE #
  1061. BEGIN
  1062. IF CHKCN
  1063. THEN # GOOD CONNECTION NUMBER WAS SPECIFIED #
  1064. BEGIN
  1065. IF NIT$STATE[ACN] LS STATE"PRUCN" OR
  1066. NIT$STATE[ACN] GR STATE"PRUEOO"
  1067. THEN # OFC/DATA SM NOT ALLOWED IN THESE STATES #
  1068. BEGIN
  1069. NIT$S$RC[0] = NITSRTC"BADSTATE"; # REASON FOR BAD CALL #
  1070. END
  1071. ELSE # STATE OF CON IS OK FOR OFC/DATA SUP MSG #
  1072. BEGIN
  1073. IF NIT$CTLC[0] EQ 0
  1074. THEN # SIZE OF OFC/DATA TEXT WAS NOT SPECIFIED #
  1075. BEGIN
  1076. NIT$S$RC[0] = NITSRTC"NOSIZE"; # REASON FOR BAD CALL #
  1077. END
  1078. ELSE # SIZE SPECIFIED FOR OFC/DATA TEXT #
  1079. BEGIN
  1080. IF NIT$CTLC[0] GR 410
  1081. THEN # SIZE OF OFC/DATA TEXT IS TOO LARGE #
  1082. BEGIN
  1083. NIT$S$RC[0] = NITSRTC"BADSIZE";#STORE RC FOR BAD CALL#
  1084. END
  1085. ELSE # OKAY TO SEND OFC/DATA SUPERVISORY MSG #
  1086. BEGIN
  1087. ABHTLC[0] = NIT$CTLC[0] + 1; # LENGTH OF OFC/DATA SM#
  1088. PFCSFC[0] = OFCDTA; # PFC/SFC OF OFC/DATA SUP MSG #
  1089. OFCACN[0] = ACN; # APPLICATION CONNECTION NUMBER #
  1090. EOJFLAG[0] = NIT$PARMFLG1[0] NQ 0; # SET EOJ FLAG #
  1091.  
  1092. NOFRAG = (NIT$CTLC[0]+62)/63 + 1; # NO OF FRAGMENTS #
  1093. FRAGSZ0[0] = 1; # SIZE OF FIRST FRAGMENT #
  1094. FRAGAD0[0] = LOC(SUP$MES); # ADDR OF FIRST FRAGMENT #
  1095. FOR I = 1 STEP 1 UNTIL NOFRAG - 1
  1096. DO # CREATE FRAGMENT ARRAY FOR SUP MSG #
  1097. BEGIN
  1098. FRAGSZ0[I] = 63; # SIZE OF FRAGMENT I #
  1099. FRAGAD0[I] = LOC(WSA) + (I-1)*63; # ADDR OF FRAG #
  1100. END
  1101. FRAGSZ0[NOFRAG-1] = NIT$CTLC[0] - (NOFRAG-2)*63;
  1102. NETPUTF(HEADER,NOFRAG,FRAG); # SEND OFC/DATA SUP MSG #
  1103.  
  1104. NIT$RC[0] = NITRTC"OK";# NORMAL COMPLETION RETURN COD#
  1105. END
  1106. END
  1107. END
  1108. END
  1109. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  1110. END
  1111.  
  1112. SMC$18: # SEND OFC/STRT SUPERVISORY MESSAGE #
  1113. BEGIN
  1114. IF CHKCN
  1115. THEN # GOOD CONNECTION NUMBER WAS SPECIFIED #
  1116. BEGIN
  1117. IF NIT$STATE[ACN] NQ STATE"PRUCN"
  1118. THEN # OFC/STRT SM NOT ALLOWED IN THESE STATES #
  1119. BEGIN
  1120. NIT$S$RC[0] = NITSRTC"BADSTATE"; # REASON FOR BAD CALL #
  1121. END
  1122. ELSE # STATE OF CON IS OK FOR OFC/STRT SUP MSG #
  1123. BEGIN
  1124. ABHTLC[0] = LOFCSTR; # LENGTH OF OFC/STRT SUP MSG #
  1125. PFCSFC[0] = OFCSTRT; # PFC/SFC OF OFC/STRT SUP MSG #
  1126. OFCACN[0] = ACN; # APPLICATION CONNECTION NUMBER #
  1127. OFCCURP[0] = WSA; # PRU POSITION TO START PRINTING#
  1128.  
  1129. NOFRAG = 2; # NUMBER OF FRAGMENTS #
  1130. FRAGSZ0[0] = 1; # SIZE OF FIRST FRAGMENT #
  1131. FRAGAD0[0] = LOC(SUP$MES); # ADDR OF FIRST FRAGMENT #
  1132. FRAGSZ0[1] = LOFCSTR-1; # SIZE OF SECOND FRAGMENT #
  1133. FRAGAD0[1] = LOC(WSA)+1; # ADDR OF SECOND FRAGMENT #
  1134.  
  1135. NETPUTF(HEADER,NOFRAG,FRAG); # SEND OFC/STRT SUP MSG #
  1136.  
  1137. NIT$STATE[ACN] = STATE"PRUACT"; # CHANGE STATE #
  1138. NIT$RC[0] = NITRTC"OK"; # NORMAL COMPLETION RETURN CODE #
  1139. END
  1140. END
  1141. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  1142. END
  1143.  
  1144. SMC$19: # SEND OFC/RSM OR OFC/RSTR SUP MSG #
  1145. BEGIN
  1146. IF CHKCN
  1147. THEN # GOOD CONNECTION NUMBER WAS SPECIFIED #
  1148. BEGIN
  1149. IF NIT$STATE[ACN] LS STATE"PRUSTPN" OR
  1150. NIT$STATE[ACN] GR STATE"PRUSTPP"
  1151. THEN # RESTART SMS NOT ALLOWED IN THESE STATES #
  1152. BEGIN
  1153. NIT$S$RC[0] = NITSRTC"BADSTATE"; # REASON FOR BAD CALL #
  1154. END
  1155. ELSE # STATE OF CON IS OK FOR RESTART SUP MSGS #
  1156. BEGIN
  1157. ABHTLC[0] = LOFCRSM; # LENGTH OF RESTART SUP MSG #
  1158. IF NIT$STATE[ACN] EQ STATE"PRUSTPD"
  1159. THEN # NETWORK NEEDS TO BE INFORMED ABOUT RSTRT#
  1160. BEGIN
  1161. PFCSFC[0] = OFCRSM; # PFC/SFC OF OFC/RSTR SUP MSG #
  1162. END
  1163. ELSE # ONLY PIP NEEDS TO BE RESTARTED #
  1164. BEGIN
  1165. PFCSFC[0] = OFCRSTR; # PFC/SFC OF OFC/RSM SUP MSG #
  1166. END
  1167. OFCACN[0] = ACN; # APPLICATION CONNECTION NUMBER #
  1168. OFCCURP[0] = WSA; # PRU POSITION TO RESTRT OUTPUT#
  1169.  
  1170. NETPUT(HEADER,SUP$MES); # SEND OFC/RSM OR OFC/RSTR SM #
  1171.  
  1172. NIT$STATE[ACN] = STATE"PRUACT"; # CHANGE STATE #
  1173. NIT$RC[0] = NITRTC"OK"; # NORMAL COMPLETION RETURN CODE #
  1174. END
  1175. END
  1176. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  1177. END
  1178.  
  1179. SMC$20: # SEND OFC/STP/R SUPERVISORY MESSAGE #
  1180. BEGIN
  1181. IF CHKCN
  1182. THEN # GOOD CONNECTION NUMBER WAS SPECIFIED #
  1183. BEGIN
  1184. IF NIT$STATE[ACN] NQ STATE"PRUACT"
  1185. THEN # OFC/STP/R SM NOT ALLOWED IN THESE STATES#
  1186. BEGIN
  1187. NIT$S$RC[0] = NITSRTC"BADSTATE"; # REASON FOR BAD CALL #
  1188. END
  1189. ELSE # STATE OF CON IS OK FOR OFC/STP/R SUP MSG#
  1190. BEGIN
  1191. ABHTLC[0] = LOFCST; # LENGTH OF OFC/STP/R SUP MSG #
  1192. PFCSFC[0] = OFCSTP; # PFC/SFC OF OFC/STP/R SUP MSG #
  1193. OFCACN[0] = ACN; # APPLICATION CONNECTION NUMBER #
  1194.  
  1195. NETPUT(HEADER,SUP$MES); # SEND OFC/STP/R SUP MSG #
  1196.  
  1197. NIT$STATE[ACN] = STATE"PRUSTOP"; # CHANGE CN STATE #
  1198. NIT$RC[0] = NITRTC"OK"; # NORMAL COMPLETION RETURN CODE #
  1199. END
  1200. END
  1201. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  1202. END
  1203.  
  1204. SMC$21: # SEND OFC/ABT/R SUPERVISORY MESSAGE #
  1205. # FOLLOWED BY OFC/TOM SUPERVISORY MESSAGE #
  1206. BEGIN
  1207. IF CHKCN
  1208. THEN # GOOD CONNECTION NUMBER WAS SPECIFIED #
  1209. BEGIN
  1210. IF NIT$STATE[ACN] LS STATE"PRUACT" OR
  1211. NIT$STATE[ACN] EQ STATE"PRUABT"
  1212. THEN # OFC/ABT/R SM NOT ALLOWED IN THESE STATES#
  1213. BEGIN
  1214. NIT$S$RC[0] = NITSRTC"BADSTATE"; # REASON FOR BAD CALL #
  1215. END
  1216. ELSE # STATE OF CON IS OK FOR OFC/ABT/R SUP MSG#
  1217. BEGIN
  1218. ABHTLC[0] = LOFCABT; # LENGTH OF OFC/ABT/R SUP MSG #
  1219. PFCSFC[0] = OFCABRT; # PFC/SFC OF OFC/ABT/R SUP MSG #
  1220. OFCACN[0] = ACN; # APPLICATION CONNECTION NUMBER #
  1221.  
  1222. NETPUT(HEADER,SUP$MES); # SEND OFC/ABT/R SUP MSG #
  1223.  
  1224. ABHTLC[0] = LOFCTOM; # LENGTH OF OFC/TOM SUP MSG #
  1225. PFCSFC[0] = OFCTOM; # PFC/SFC OF OFC/TOM SUP MSG #
  1226. OFCACN[0] = ACN; # APPLICATION CONNECTION NUMBER #
  1227.  
  1228. NETPUT(HEADER,SUP$MES); # SEND OFC/TOM SUP MSG #
  1229.  
  1230. NIT$STATE[ACN] = STATE"PRUABT"; # CHANGE CN STATE #
  1231. NIT$RC[0] = NITRTC"OK"; # NORMAL COMPLETION RETURN CODE #
  1232. END
  1233. END
  1234. GOTO SMC$END; # GO TO END OF CASE STATEMENT #
  1235. END
  1236.  
  1237. SMC$END:
  1238. # END OF CASE STATEMENT #
  1239. END
  1240. ELSE # BAD SUPERVISORY MESSAGE CODE WAS GIVEN #
  1241. BEGIN
  1242. NIT$S$RC[0] = S"UNRECOG"; # STORE REASON CODE FOR BAD CALL #
  1243. END
  1244. RETURN;
  1245.  
  1246. FUNC CHKCN B; # FUNCTION TO CHECK IF FOR VALID CON NO #
  1247. *IF DEF,IMS
  1248. #
  1249. *1DC CHKCN
  1250. *
  1251. * 1. PROC NAME AUTHOR DATE
  1252. * CHKCN E. GEE 11/03/84
  1253. *
  1254. * 2. FUNCTIONAL DESCRIPTION.
  1255. * VALIDATE CONNECTION NUMBER SUPPLIED BY APPLICATION.
  1256. *
  1257. * 3. METHOD USED.
  1258. * SET FUNCTION TO FALSE.
  1259. * IF CONNECTION ENTRY IN NIT IS NOT IN USE,
  1260. * STORE ERROR RETURN CODE IN SEC-RETURN-CODE FIELD IN NIT.
  1261. * ELSE (CONNECTION ENTRY IN NIT IS IN USE),
  1262. * IF CONNECTION WAS LOANED TO ANOTHER APPLICATION,
  1263. * STORE ERROR RETURN CODE IN SEC-RETURN-CODE FIELD IN NIT.
  1264. * ELSE (CONNECTION NUMBER IS OKAY),
  1265. * SET FUNCTION TO TRUE.
  1266. *
  1267. * 4. ENTRY CONDITIONS.
  1268. * ACN CONNECTION NUMBER TO VALIDATE
  1269. *
  1270. * 5. NORMAL EXIT CONDITIONS.
  1271. * CHKCN TRUE
  1272. *
  1273. * 6. ABNORMAL EXIT CONDITIONS.
  1274. * CHKCN FALSE
  1275. * NIT$S$RC REASON CODE FOR REJECTING CALL
  1276. *
  1277. * 7. COMDECKS AND SYMPL TEXT USED.
  1278. * NONE
  1279. *
  1280. * 8. ROUTINES CALLED.
  1281. * NONE
  1282. *
  1283. * 9. DAYFILE MESSAGE OR OTHER IMPORTANT INFORMATION.
  1284. * THE FUNCTION IS AN INTERAL PROC OF QTSUP.
  1285. *
  1286.  #
  1287. *ENDIF
  1288. BEGIN
  1289. CHKCN = FALSE; # INITIALIZE VALUE FOR RETURNING TO CALLER#
  1290. IF (ACN EQ 0 ) OR
  1291. (ACN GR NIT$NO$TERMS[0] ) OR
  1292. (NIT$STATE[ACN] EQ S"NULL")
  1293. THEN # CONNECTION DOES NOT EXIST #
  1294. BEGIN
  1295. NIT$S$RC[0] = S"BADCN"; # STORE REASON FOR BAD CALL #
  1296. END
  1297. ELSE # CONNECTION EXISTS #
  1298. BEGIN
  1299. IF (NIT$STATE[ACN] EQ S"LEND") OR
  1300. (NIT$STATE[ACN] EQ S"LENT")
  1301. THEN # CONNECTION HAS BEEN LENT TO ANOTHER APP #
  1302. BEGIN
  1303. NIT$S$RC[0] = S"CONLOANED"; # STORE REASON FOR BAD CALL #
  1304. END
  1305. ELSE # CONNECTION NUMBER IS OKAY #
  1306. BEGIN
  1307. CHKCN = TRUE; # RETURN TRUE VALUE TO CALLER #
  1308. END
  1309. END
  1310. END
  1311.  
  1312. END # END OF QTSUP #
  1313. TERM
cdc/nos2.source/nam5871/qtsup.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator