User Tools

Site Tools


cdc:nos2.source:nam5871:ssacni

SSACNI

Table Of Contents

  • [00004] PROC SSACNI (SWTESS)
  • [00005] SSACNI - CONTROL NETWORK INTERFACE.
  • [00009] CONTROL NETWORK INTERFACE.
  • [00050] PROC CSNVDSP
  • [00051] PROC NETGETL
  • [00052] PROC NETPUT
  • [00053] PROC NETREL
  • [00054] PROC SSTRQE
  • [00055] PROC RTIME
  • [00098] AID - ACCEPT INCOMMING DATA.
  • [00124] PROC AID

Source Code

SSACNI.txt
  1. *DECK SSACNI
  2. USETEXT TEXTSS
  3. USETEXT TXTAPSS
  4. PROC SSACNI (SWTESS);
  5. # TITLE SSACNI - CONTROL NETWORK INTERFACE. #
  6.  
  7. BEGIN # SSACNI #
  8. #
  9. ** SSACNI - CONTROL NETWORK INTERFACE.
  10. *
  11. * S. H. FISCHER. 81/08/18.
  12. * C. J. BRION. 82/06/09, 83/06/06.
  13. *
  14. * THIS ROUTINE CONTROLS THE NETWORK INTERFACE.
  15. * NETPUT S AND NETGET S ARE DONE IN PARALLEL MODE TO
  16. * SEND/RECEIVE DATA/SUPERVISARY BLOCKS TO/FROM
  17. * NIP AND THE NETWORK.
  18. *
  19. * PROC SSACNI (SWTE)
  20. *
  21. * ENTRY SWTE = STATUS WORKLIST MONITOR ARRAY.
  22. *
  23. * EXIT RETURN PARMETERS SET DEPENDING ON WHAT EVENT IS TO
  24. * RESTART THIS ROUTINE.
  25. *
  26. * NOTES THIS ROUTINE ASSUMES THAT THE AIP ROUTINE *NETCHEK*
  27. * IS BEING CALLED BY THE MAIN LOOP.
  28. *
  29. * METHOD THIS ROUTINE GIVES PRECEDENCE TO OUTGOING TRAFFIC.
  30. * ALL DATA BLOCKS OR SM S AVAILABLE TO BE SENT ARE
  31. * NETPUTED BEFORE ANY NETGETS ARE ATEMPTED.
  32. * SHOULD ANY TRANSFER NOT BE DONE IMMEDIATELY THIS
  33. * ROUTINE WILL EXIT TO BE RESTARTED WHEN THE TRANSFER
  34. * IS COMPLETE. NETGETS ARE DONE ONLY WHEN THE NSUP
  35. * WORD INDICATES THAT INCOMMING TRAFFIC IS AVAILABLE.
  36. * SM S TAKE PRECEDENCE OVER DATA BLOCKS ON INPUT.
  37. * NETREL IS CALLED AFTER MC MESSAGES ARE WRITTEN
  38. * TO THE TRACE FILE.
  39. #
  40.  
  41.  
  42.  
  43.  
  44. #
  45. **** PROC SSACNI - XREF LIST BEGIN.
  46. #
  47.  
  48. XREF
  49. BEGIN
  50. PROC CSNVDSP;
  51. PROC NETGETL;
  52. PROC NETPUT;
  53. PROC NETREL;
  54. PROC SSTRQE;
  55. PROC RTIME;
  56. END
  57. #
  58. ****
  59. #
  60.  
  61.  
  62.  
  63.  
  64.  
  65. *CALL SWTESS
  66.  
  67.  
  68.  
  69.  
  70. ITEM AABH U; # ABH BUFFER FOR NETWORK I/O #
  71. ITEM I U;
  72. ITEM FORCERTN B=FALSE; # TRUE WHEN EARLY RETURN NEEDED #
  73. ITEM WAITGET B=FALSE; # TRUE WHEN NETGET INCOMPLETE #
  74. ITEM BLK$MSG B; # BLK OR MSG FLAG #
  75. BASED ARRAY ABHTYPE[00:00] S(1); # BASED ARRAY FOR BLOCK TYPE #
  76. BEGIN
  77. ITEM ABH$TYPE U(00,00,06); # BLOCK TYPE #
  78. END
  79.  
  80.  
  81. ARRAY TXTAREA [00:273] S(1); # TEXT BUFFER FOR NETWORK I/O #
  82. BEGIN
  83. ITEM TXTA$WD U(00,00,60);
  84. END
  85. #
  86. * THIS ARRAY DEFINES THE LFN USED FOR THE NETREL CALL.
  87. #
  88. ARRAY NTRL$LFN [00:00] S(1);
  89. BEGIN
  90. ITEM NRL$NAM C(00,00,04) = ["NRF1"];
  91. ITEM NRL$ZFIL U(00,24,36) = [0];
  92. END
  93.  
  94.  
  95.  
  96. CONTROL EJECT;
  97. #
  98. ** AID - ACCEPT INCOMMING DATA.
  99. *
  100. * THIS INTERNAL PROC COMPUTES THE 60 BIT WORD COUNT OF THE DATA
  101. * RECEIVED AND PASSES THE BLOCK TO A ROUTINE WHICH QUEUES THE
  102. * INPUT. THIS ROUTINE HAS THE SAME ENTRY POINT NAME BUT IT IS
  103. * DIFFERENT FOR EACH PRODUCT.
  104. *
  105. * PROC AID
  106. *
  107. * ENTRY AABH = RECEIVED APPLICATION BLOCK HEADER.
  108. * TXTAREA = RECEIVED BLOCK.
  109. *
  110. * EXIT BLOCK PASSED TO PROGRAM.
  111. * (IF DATA PRESENT BUT ON A INHIBITED LIST THEN
  112. * REQUEST SUSPENSION IF NO OUTGOING DATA IS AVAILABLE.)
  113. *
  114. * METHOD CALCULATE WORD COUNT DEPENDING ON CHARACTER TYPE.
  115. * IF NOT A NULL BLOCK INDICATING DATA PRESENT BUT
  116. * UNDELIVERABLE CALL PRODUCT OWNCODE ROUTINE TO
  117. * QUEUE THE BLOCK. OTHERWISE REQUEST SUSPENSION.
  118. *
  119. #
  120.  
  121.  
  122.  
  123.  
  124. PROC AID; # ACCEPT INCOMMING DATA #
  125. BEGIN
  126. ABHWORD[0] = AABH; # TRANSFER ABH WORD #
  127.  
  128. # P<ABH> = LOC(ABHBUF) #
  129.  
  130. WCB$WORD[0] = 0; # CLEAR WORD COUNT WORD #
  131.  
  132.  
  133.  
  134. #
  135. * COMPUTE SIZE OF INCOMMING BLOCK IN 60 BIT WORDS.
  136. * ADD TWO TO ACCOUNT FOR ABH AND WORD COUNT WORDS IN
  137. * RESULTING QUEUE ENTRY.
  138. #
  139.  
  140.  
  141. IF ABHACT[0] EQ CT60TRANS
  142. THEN # 60 BIT TRANSPARENT CHARACTERS #
  143. BEGIN
  144. WCB$WC[0] = ABHTLC[0];
  145. END
  146. ELSE IF ABHACT[0] EQ CT8ASCII
  147. THEN # 8-BIT ASCII, 7.5 PER WORD #
  148. BEGIN
  149. WCB$WC[0] = ((ABHTLC[0] * 10) + 70 ) / 75;
  150. END
  151. ELSE IF ABHACT[0] EQ CT6DISPLAY
  152. THEN # 6-BIT DISPLAY CODE, 10 PER WORD #
  153. BEGIN
  154. WCB$WC[0] = (ABHTLC[0] + 9 ) / 10;
  155. END
  156.  
  157. WCB$WC[0] = WCB$WC[0] + 2;
  158.  
  159.  
  160.  
  161.  
  162. #
  163. * IF A NULL BLOCK IS RECEIVED AND IT IS FOR A NON-ZERO ACN
  164. * THEN IT IS QUEUED TO THE PROGRAM NORMALLY.
  165. * IN THE CASE OF A NULL BLOCK WITH AN ACN OF ZERO
  166. * THEN THE DATA BLOCK THAT WAS REQUESTED CANNOT BE DELIVERED
  167. * TO THE PROGRAM BY NIP AS THE BLOCK WAS ON A CONNECTION THAT
  168. * WAS INHIBITED DUE TO THE PROGRAM STILL PROCESSING THE LAST
  169. * DATA BLOCK AND THE HALF DUPLEX PROCESS ALLOWS ONLY ONE MSG
  170. * IN THE PROGRAM AT A TIME.
  171. * IN THIS CASE THE DATA BLOCK WILL BE REQUESTED AGAIN AFTER
  172. * ANY OUTPUT FROM THE PROGRAM OR THE DAYFILE CLOCK CHANGES
  173. * TO HANDLE THE CASE OF A BLOCK BEING RECEIVED BY NIP FOR
  174. * A DIFFERENT ACN WHICH IS NOT INHIBITED.
  175. * IN THE EVENT THAT A MAXNULL$ NUMBER OF NETGETLS ATTEMPTED
  176. * WITHOUT CONNECTION TRAFFIC (NON ZERO ACN), THE NUMBER OF
  177. * NULL NETGETS ALLOWED IS DECREMENTED. IF THIS COUNT REACHES
  178. * ZERO, THE FORCED ROLLOUT PROGRAM FLAG IS SET. THIS ALLOWS THE
  179. * CHECK IN SSSWNR TO ISSUE A FORCE ROLLOUT NETWAIT CALL.
  180. * THIS PROC INDICATES THIS SITUATION BY SETTING FORCERTN
  181. * TRUE.
  182. #
  183.  
  184.  
  185. IF ABHABT[0] EQ APPNULL
  186. THEN
  187. BEGIN # NULL BLOCK #
  188. IF ABHADR[0] EQ 0
  189. THEN # NO DATA OR SM DELIVERABLE #
  190. BEGIN
  191. FORCERTN = TRUE;
  192. PGM$NUGETS[0] = PGM$NUGETS[0] - 1;
  193. IF PGM$NUGETS[0] EQ 0
  194. THEN
  195. BEGIN
  196. PGM$FOROLL[0] = TRUE;
  197. PGM$NUGETS[0] = MAXNULL$;
  198. END
  199. ELSE
  200. PGM$FOROLL[0] = FALSE;
  201. RETURN;
  202. END
  203. END
  204.  
  205.  
  206.  
  207. #
  208. * THE BLOCK IS PASSED TO THE PROGRAM TO BE QUEUED.
  209. #
  210.  
  211.  
  212. PGM$NUGETS[0] = MAXNULL$;
  213. CSNVDSP (WCBUF, ABHBUF, TXTAREA );
  214.  
  215. RETURN;
  216.  
  217. END
  218. CONTROL EJECT;
  219. #
  220. * MAIN LINE CODE.
  221. *
  222. * SET THE STATUS WLE PARAMETERS FOR ONLY A SINGLE TYPE CHECK
  223. * ON THE NSUP WORD.
  224. #
  225. STE$RTN = LOC(SSACNI);
  226. STE$ADDR1 = LOC(NSUP);
  227. STE$INIT1 = NSUP$WORD;
  228. STE$ADDR2 = 0;
  229.  
  230. #
  231. *
  232. * IF PREVIOUS OPERATION STILL NOT COMPLETE
  233. * (FALSE WAKE UP OR INITIALIZATION CALL)
  234. * THEN WAIT FOR AIP TRANSFER TO COMPLETE.
  235. #
  236.  
  237.  
  238.  
  239.  
  240. IF NOT NSUP$COMP[0]
  241. THEN
  242. BEGIN # WAIT FOR NSUP TO COMPLETE #
  243. STE$SBIT1 = FALSE; # INSURE COMPLETE BIT IS CLEAR #
  244. RETURN;
  245. END
  246.  
  247.  
  248.  
  249.  
  250. #
  251. * IF REQUESTED INCOMMING DATA IS NOW AVAILABLE THEN PROCESS IT.
  252. * IF INPUT DATA IS PRESENT BUT CANNOT BE DELIVERED THEN STOP
  253. * IF OUTGOING DATA IS NOT READY TO BE SENT.
  254. * RESTART CONDITIONS ARE EITHER DAYFILE CLOCK CHANGING OR
  255. * NSUP WORD CHANGING.
  256. #
  257.  
  258.  
  259. IF WAITGET
  260. THEN
  261. BEGIN
  262. AID; # ACCEPT INCOMMING DATA #
  263. WAITGET = FALSE;
  264. IF FORCERTN
  265. THEN
  266. BEGIN
  267. FORCERTN = FALSE;
  268. IF SSOTQL[0] EQ 0
  269. THEN
  270. BEGIN # WAIT FOR NSUP WORD OR DAYFILE
  271.   CLOCK TO CHANGE #
  272. STE$ADDR2 = LOC(CTM$CLOCK[0]);
  273. STE$INIT2 = CTM$CLOCK[0];
  274. RETURN;
  275. END
  276. END
  277. END
  278.  
  279.  
  280.  
  281.  
  282. #
  283. * AS LONG AS OUTGOING DATA REMAINS AND TRANSFERS ARE DONE
  284. * IMMEDIATELY LOOP DOING NETPUTS.
  285. * IF A TRANSFER DOES NOT COMPLETE IMMEDIATELY STOP WITH
  286. * RESTART CONDITIONS BEING THE TRANSFER COMPLETED.
  287. * NOTE: THE MAIN LOOP CALLING *NETCHEK* IS ASSUMED.
  288. #
  289.  
  290.  
  291. BLK$MSG = FALSE; # SET BLK$MSG TO FALSE #
  292. FOR I = 1 WHILE SSOTQL[0] NQ 0
  293. DO
  294. BEGIN
  295. SSTRQE (SSIOTQ[0], WCBUF, AABH, TXTAREA);
  296. NETPUT (AABH, TXTAREA);
  297. P<ABHTYPE> = LOC(AABH); # GET BLOCK TYPE #
  298. IF ABH$TYPE[0] EQ SWAP$BLK OR ABH$TYPE[0] EQ SWAP$MSG
  299. THEN # BLK OF MSG BLOCKS #
  300. BEGIN
  301. IF SS$TWORD[0] EQ 0 # NEED NEW TIME STAMP #
  302. THEN
  303. BEGIN
  304. BLK$MSG = TRUE; # SET BLK OR MSG FLAG TO TRUE #
  305. END
  306. END
  307. IF NOT NSUP$COMP[0]
  308. THEN
  309. BEGIN # WAIT FOR NSUP TO COMPLETE #
  310. STE$INIT1 = NSUP$WORD;
  311. STE$SBIT1 = FALSE; # INSURE COMPLETE BIT IS CLEAR #
  312. IF BLK$MSG
  313. THEN # BLK OR MSG PUT'S EXIST #
  314. BEGIN
  315. RTIME(SS$SWAPW); # GET REAL TIME STAMP #
  316. END
  317. RETURN;
  318. END
  319. END
  320.  
  321. IF BLK$MSG
  322. THEN
  323. BEGIN
  324. RTIME(SS$SWAPW); # GET REAL TIME STAMP #
  325. END
  326.  
  327.  
  328.  
  329. #
  330. * AS LONG AS INCOMING SUPERVISORY MESSAGES ARE INDICATED TO BE
  331. * AVAILABLE, AND INCOMING DATA BLOCKS ARE INDICATED TO BE
  332. * DELIVERABLE, LOOP DOING NETGETS AND PASS THE BLOCKS TO THE
  333. * PROGRAM.
  334. * IF A TRANSFER DOES NOT COMPLETE IMMEDIATELY STOP WITH
  335. * RESTART CONDITIONS BEING THE TRANSFER COMPLETE.
  336. * NOTE: THE MAIN LOOP CALLING *NETCHEK* IS ASSUMED.
  337. *
  338. * IF INPUT DATA IS PRESENT BUT CANNOT BE DELIVERED THEN STOP.
  339. * RESTART CONDITIONS ARE EITHER DAYFILE CLOCK CHANGING OR
  340. * NSUP WORD CHANGING.
  341. #
  342.  
  343.  
  344. FOR I = 1 WHILE NSUP$SMIN[0]
  345. OR NSUP$DDEV[0]
  346. DO
  347. BEGIN # DATA OR SM AVAILABLE #
  348. NETGETL ( 0, AABH, TXTAREA, TXTALEN );
  349. STE$INIT1 = NSUP$WORD;
  350. IF NOT NSUP$COMP[0]
  351. THEN
  352. BEGIN # WAIT FOR NSUP TO COMPLETE #
  353. STE$SBIT1 = FALSE; # INSURE COMPLETE BIT IS CLEAR #
  354. STE$ADDR2 = 0; # DISABLE SECOND CHECK #
  355. WAITGET = TRUE;
  356. RETURN;
  357. END
  358. ELSE
  359. BEGIN
  360. AID; # ACCEPT INCOMMING DATA #
  361. IF FORCERTN
  362. THEN
  363. BEGIN
  364. FORCERTN = FALSE;
  365. STE$ADDR2 = LOC(CTM$CLOCK[0]);
  366. STE$INIT2 = CTM$CLOCK[0];
  367. ISSACNI = 0;
  368. RETURN;
  369. END
  370. END
  371. END
  372.  
  373.  
  374.  
  375.  
  376. #
  377. * IF THE NUMBER OF MESSAGES ON THE TRACE FILE REACHES *MC*
  378. * THEN CALL *NETREL* IF *MC* NE 0. IF *MC* IS ZERO THEN
  379. * THE TRACE FILE IS TO REMAIN ATTACHED TILL END OF RUN
  380. * SO NETREL CALLS ARE NOT DONE.
  381. * NOTE: THE NUMBER OF MESSAGES ON THE TRACE FILE CANNOT BE ASSUMED
  382. * TO BE EXACTLY *MC* AS THE *NETREL* CALL IS DELAYED DURING
  383. * PERIODS OF HIGH ACTIVITY.
  384. #
  385.  
  386.  
  387. IF MC NQ 0
  388. AND NSUP$MC[0] GR MC
  389. THEN
  390. BEGIN
  391. NETREL (NTRL$LFN, 0, 0 );
  392. END
  393.  
  394.  
  395.  
  396.  
  397. #
  398. * AIP TRAFFIC IS IDLE.
  399. * RESTART CONDITIONS ARE EITHER OUTGOING TRAFFIC
  400. * OR INCOMMING TRAFFIC AVAILABLE.
  401. #
  402.  
  403.  
  404. STE$INIT1 = NSUP$WORD;
  405. STE$ADDR2 = LOC(ISSACNI); # OUTGOING TRAFFIC QUEUE #
  406. STE$INIT2 = 0;
  407. ISSACNI = 0; # ZERO FLAG FOR OUTGOING TRAFFIC #
  408. RETURN;
  409.  
  410. END # SSACNI #
  411.  
  412. TERM
cdc/nos2.source/nam5871/ssacni.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator