User Tools

Site Tools


cdc:nos2.source:nam5871:np_stpr

NP$STPR

Table Of Contents

  • [00013] PROC NP$STPR(NETCON,NTRIGGER,NBACKTRIG)
  • [00080] PROC NP$STTP
  • [00081] PROC NETPUT
  • [00082] PROC NP$PUT
  • [00083] PROC NP$BTO8
  • [00084] PROC NP$8TIN
  • [00085] PROC NP$SHRK
  • [00086] PROC NP$XCMP
  • [00087] PROC NP$MSG
  • [00088] FUNC NP$CDD C(10)
  • [00089] PROC NP$CIO
  • [00090] PROC NP$SENF
  • [00091] PROC NP$RECV
  • [00092] PROC NP$RTIM
  • [00093] PROC NP$RLOC
  • [00094] PROC NP$XLCH
  • [00095] PROC NP$UPRU
  • [00096] PROC NETWAIT
  • [00200] PROC NET$SENDL7(NETLV7PFC,NETL7DD)

Source Code

NP$STPR.txt
  1. *DECK,NP$STPR
  2. *IF,DEF,XFR
  3. USETEXT NX$ACBF
  4. USETEXT AIPDEF
  5. USETEXT HEADER
  6. USETEXT NP$STAT
  7. USETEXT NP$DB
  8. USETEXT NP$NWL
  9. USETEXT NP$MODE
  10. USETEXT NP$GETS
  11. USETEXT NX$ACBX
  12. USETEXT NX$MSG
  13. PROC NP$STPR(NETCON,NTRIGGER,NBACKTRIG);
  14. BEGIN
  15. #
  16. **
  17. *1DC NP$STPR
  18. *
  19. * 1. PROC NAME AUTHOR DATE
  20. * NP$STPR Y. C. YIP 02/19/1985
  21. *
  22. * 2. FUNCTIONAL DESCRIPTION
  23. * THIS ROUTINE ACTS AS A CENTRAL PROCESSOR FOR THE RESPONSE
  24. * RETURNED BY CALLING NP$STTP, THE STATE TABLE DRIVER FOR
  25. * ACTIONS TAKEN DURING A FILE TRANSFER STATE. THE ACTIONS,
  26. * STATE TRANSITION, AND THE REASON ARE THEN EXECUTED
  27. * BY DOING A TABLE JUMP DEPENDING ON THE ACTION NUMBER AND
  28. * AND THE TABLE NUMBER WHETHER IT IS A PRU( SEND, RECEIVE) OR
  29. * CHARACTER (SEND , RECEIVE).
  30. *
  31. * 3. METHOD USED
  32. * THE PROCESSOR HAS TWO BANKS OF ACTIONS, ONE FOR PRU
  33. * SENDER AND RECEIVER AND THE OTHER FOR CHARACTER SENDER
  34. * AND RECEIVER. THE JUMPS TO THESE BANKS ARE FIRST TRIGGERED
  35. * BY TABLE ORDINAL SWITCHES AND THEN BY ACTION STATUS
  36. * SWITCHES. THERE ARE FOUR TABLES ORDINALS: 0 AND 1 FOR
  37. * PRU SENDER AND RECEIVER AND 2 AND 3 FOR CHARACTER SENDER
  38. * AND RECEIVER. IT OBTAINS THE ORDINALS AND CURRENT STATE
  39. * BY A TABLE LOOK OF THE FILE TRANSFER TABLE AND THE KEY IS
  40. * THE CONNECTION INDEX. THEN IT CALLS NP$STTP AND PERFORMS
  41. * ACTION1 AND ACTION2, UPDATING REASON CODE, NEWSTATE AND
  42. * PREVIOUS STATE OF THE FILE TRANSFER TABLE.
  43. * NP$STPR SETS NTRIGGER TO A NULL TRIGGER VALUE , 0, AT
  44. * ENTRY OF THE ROUTINE.
  45. * NORMALLY NBACKTRIG IS SET TO NULL, 0, AFTER A REGULAR
  46. * CALL TO NP$STTP. IN CASE, ANOTHER CALL TO NP$STPR
  47. * IS NEEDED, NBACKTRIG IS SET TO A NON-NULL VALUE.
  48. * EXAMPLES ARE ACTION "CLOSE".
  49. *
  50. * 4. ENTRY CONDITIONS
  51. * NETCON - CONNECTION INDEX IN THE FTT.
  52. * NTRIGGER - VALUE OF THE TRIGGER FOR THE STATE TABLE.
  53. * NBACKTRIG - RETURN TRIGGER.
  54. *
  55. * 5. EXIT CONDITONS
  56. * NETCON - UNCHANGED.
  57. * NTRIGGER - UNCHANGED.
  58. * NBACKTRIG - NULL IF NO RETURN ELSE VALUE OF
  59. * THE RETURN TRIGGER.
  60. * FTTSTATE, FTTSTRC ARE UPDATED TO THE CURRENT
  61. * FILE TRANSFER STATE AND REASON.
  62. *
  63. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  64. * NX$ACBX, NP$NWL.
  65. *
  66. * 7. ROUTINES CALLED
  67. * NP$MSG - DAYFILE PROCESSOR.
  68. * NP$STTP - COMPASS ROUTINE FOR STATE TABLE LOOKUP.
  69. *
  70. * 8. DAYFILE MESSAGES
  71. * - ERROR IN INTERFACING WITH NAM.
  72. *
  73. #
  74. CONTROL EJECT;
  75. #
  76. **** PROC NP$STPR - XREF LIST.
  77. #
  78. XREF
  79. BEGIN
  80. PROC NP$STTP; # NP$STTP PROCESSOR #
  81. PROC NETPUT; # NETPUT #
  82. PROC NP$PUT; # NP$PUT #
  83. PROC NP$BTO8; # CONVERTS BINARY TO ASCII #
  84. PROC NP$8TIN; # CONVERTS ASCII TO BINARY #
  85. PROC NP$SHRK; # SHRINK CHECKMARK TABLE #
  86. PROC NP$XCMP; # COMPLETE NET TRNASFER #
  87. PROC NP$MSG; # DAYFILE MESSAGE #
  88. FUNC NP$CDD C(10); # CONVERT INTEGER TO DISPLAY CODE #
  89. PROC NP$CIO; # PERFORMS CIO FUNCTIONS #
  90. PROC NP$SENF; # CHARCTER SENDER #
  91. PROC NP$RECV; # CHARACTER RECEIVER #
  92. PROC NP$RTIM; # PROC FOR UPDATING TIMER INFO #
  93. PROC NP$RLOC; # PROC FOR REALLOCATION BUFFERS #
  94. PROC NP$XLCH; # LOCATE CHECK MARK NUMBER #
  95. PROC NP$UPRU; # UPDATE PRU NUMBER IN FTT #
  96. PROC NETWAIT; # PROCEDURE TO DO NETWAIT #
  97. END
  98. #
  99. ****
  100. #
  101. ITEM NETCON; # CONNECTION INDEX #
  102. ITEM NTRIGGER; # TRIGGER #
  103. ITEM NBACKTRIG; # RETURN TRIGGER #
  104. ITEM ITEMP; # INTEGER TEMPORARY #
  105. ITEM ITEMP2; # INTEGER TEMPORARY #
  106. ITEM ORUDIFF; # DIFFERENCE IN PRU #
  107. SWITCH ORDLST ORD0, # SWITCH ITEM FOR TABLE ORDINAL #
  108. # 0 FOR PRU SENDER #
  109. ORD1, # 1 FOR PRU RECEIVER #
  110. ORD2, # 2 FOR CHARACTER SENDER #
  111. ORD3, # 3 FOR CHARACTER RECEIVER #
  112. EXITT; # DUMMY LABEL FOR ERROR EXIT #
  113.  
  114. SWITCH PJUMP PLACT0, # ACTION0 : STATUS = -1 #
  115. PLACT1, # ACITON1 : SS(CKPT) SENT #
  116. PLACT2, # ACTION2 : RETURN #
  117. PLACT3, # ACTION3 : PRU/ON #
  118. PLACT4, # ACTION4 : STATUS = 0 #
  119. PLACT5, # ACTION5 : OFT/START SENT #
  120. PLACT6, # ACTION6 : OFT/OFF/R #
  121. PLACT7, # ACTION7 : STATUS = -2 #
  122. PLACT8, # ACTION8 : ES(OK) SENT #
  123. PLACT9, # ACTION9 : FC/RST SENT #
  124. PLACT10, # ACTION10: ES(E) SENT #
  125. PLACT11, # ACTION11: IFT/START SENT #
  126. PLACT12, # ACTION12: IFT/OFF/R #
  127. PLACT13, # ACTION13: ER(OK) SENT #
  128. PLACT14, # ACTION14: FC/BRK SENT #
  129. PLACT15, # ACTION15: RR(CKPT) SENT #
  130. PLACT16, # ACTION16: ER(E) SENT #
  131. PLACT17, # ACTION17: QR(E) SENT #
  132. PLACT18, # ACTION19: INTRRSP #
  133. PLACT19, # ACTION19: SET IDLEDOWN #
  134. PLACT20, # ACTION20: SPECIAL RETURN ACTION #
  135. # FOR PRUONA #
  136. PLACT21, # ACTION21: SPECIAL RECEIVER'S #
  137. # ACTION FOR REALLOCATION OF BUFFERS#
  138. # AFTER RECEIVING PRUONA WITH RC= 4 #
  139. PLACT22, # ACTION22: LSTOFF #
  140. PLACT23; # ACTION23: LSTON #
  141.  
  142.  
  143.  
  144. SWITCH CJUMP CLACT0, # ACTION 0: STATUS = -1 #
  145. CLACT1, # ACTION 1: SS(0) SENT #
  146. CLACT2, # ACTION 2: STATUS = 0 #
  147. CLACT3, # ACTION 3: ES(E) SENT #
  148. CLACT4, # ACTION 4: ADVANCE ABL WINDOW #
  149. CLACT5, # ACTION 5: RETURN #
  150. CLACT6, # ACTION 6: RESET ABL WINDOW + FCRST#
  151. CLACT7, # ACTION 7: INTRRSP SENT #
  152. CLACT8, # ACTION 8: IDLEDOWN = TRUE #
  153. CLACT9, # ACTION 9 : STATUS = -1 AND RESET #
  154. CLACT10, # ACTION 10: ES(OK) SENT #
  155. CLACT11, # ACTION 11: ADV CHECKMARK WINDOW #
  156. CLACT12, # ACTION 12: SEND DATA #
  157. CLACT13, # ACTION 13: SEND SR #
  158. CLACT14, # ACTION 14: ER(E) SENT #
  159. CLACT15, # ACTION 15: STATUS = -1 AND RWL #
  160. CLACT16, # ACTION 16: SS(CHECKMARK) #
  161. CLACT17, # ACTION 17: STATUS = -2 #
  162. CLACT18, # ACTION 18: QR(E) SENT #
  163. CLACT19, # ACTION 19: CLOSE #
  164. CLACT20, # ACTION 20: SAVE CHECKMARK #
  165. CLACT21, # ACTION 21: STORE DATA #
  166. CLACT22, # ACTION 22: FCBRK SENT #
  167. CLACT23, # ACTION 23: MR SENT #
  168. CLACT24, # ACTION 24: RR(CHECKMARK) #
  169. CLACT25, # ACTION 25: ER(OK) #
  170. CLACT26, # ACTION 26: LSTOFF #
  171. CLACT27, # ACTION 27: LSTON #
  172. CLACT28; # ACTION 28: SPECIAL ADVANCE WINDOW #
  173.  
  174.  
  175. BASED ARRAY TABRESP[0:0] S(1); # TEMPLATE FOR RESPONSE WORD #
  176. BEGIN
  177. ITEM LEGB U(00,00,01); # LEGAL BIT #
  178. ITEM NEWSTATE U(00,30,06); # NEWSTATE #
  179. ITEM ACTION1 U(00,36,06); # ACTION 1 #
  180. ITEM ACTION2 U(00,42,06); # ACTION 2 #
  181. ITEM REASON U(00,48,06); # REASON CODE #
  182. END
  183.  
  184. BASED ARRAY COPYAREA[0:0] S(1);
  185. BEGIN
  186. ITEM WORD U(00,00,60);
  187. END
  188. ITEM RESP; # RESPONSE WORD #
  189. ITEM ACTIONC; # ACTION COUNT #
  190. ITEM CRNT$ACTION; # CURRENT ACTION #
  191. ITEM I; # LOOP INDEX #
  192. ITEM NINDX; # LOOP INDEX #
  193. ITEM CRNT$ORD; # CURRENT TABLE ORDINAL #
  194. ITEM CRNT$STATE; # CURRENT STATE #
  195. ITEM PRUDIFF; # DIFFERENCE IN PRU NUMBER #
  196. ITEM CTEMP C(10); # CHARACTER TEMPORARY #
  197. ITEM SAVE$WORD; # COPY OF DATAWORD 1 #
  198.  
  199. CONTROL EJECT;
  200. PROC NET$SENDL7(NETLV7PFC,NETL7DD);
  201. BEGIN
  202. #
  203. **
  204. * 1. FUNCTIONAL DESCRIPTION.
  205. * NET$SENDL7 TRANSMITS A LEVEL 7 MESSAGE TO A CERTAIN
  206. * CONNECTION NUMBER.
  207. *
  208. * 2. METHOD USED.
  209. * NET$SENDL7 BLOCKS THE APPLICATION BLOCK HEADER WITH
  210. * THE CONNECTION NUMBER FROM FTT TABLE. IT THEN BUFFERS
  211. * THE PFC FIELD OF THE LEVEVL 7 TEXT AREA WITH THE
  212. * NETLV7PFC WHICH IS PASSED AS A PARAMETER AND THE DD
  213. * (CHECK MARK OR ERROR CODE ) FIELD OF THE LEVEL 7 TEXT
  214. * WITH NETL7DD PASSED AS A PARAMETER.
  215. *
  216. * 3. ENTRY CONDITIONS -
  217. * NETLV7PFC - LEVEL 7 PFC.
  218. * NETL7DD - LEVEL 7 D1-D4.
  219. *
  220. * 4. EXIT CONDITIONS.
  221. *
  222. * NETLV7PFC - UNCHANGED.
  223. * NETL7DD - UNCHANGED.
  224. * NP$PUT CALLED TO SEND LEVEL 7 MESSAGE.
  225. *
  226. #
  227.  
  228. ITEM NETLV7PFC; # LEVEL 7 PFC #
  229. ITEM NETL7DD; # LEVEL 7 D1-D4 #
  230.  
  231. CONTROL EJECT;
  232. # #
  233. # PROC NET$SENDL7 CODE BEGINS HERE #
  234. # #
  235. ABH$L7ADR = FTTACN[FTTINDEX]; # SET CONNECTION NUMBER IN #
  236. # APPLICATIONS BLOCK HEADER #
  237. L7$PFC = NETLV7PFC; # UPDATE PFC IN TEXT AREA #
  238. L7$DD = B<STARTBIT,DDLEN>NETL7DD; # UPDATE ERROR CODE OR #
  239. # CHECK MARK #
  240. OPCODE = OP$PUT; # UPDATE OPCODE #
  241. LOC$HA = LOC(ABH$LEV7); # UPDATE HEADER ADDRESS #
  242. LOC$TA = LOC(LV7$MSG); # UPDATE TEXT AREA ADDRESS #
  243. *IF DEF,STAT,1
  244. IAM = TYPE"PUT"; # UPDATE EXECUTING ROUTING #
  245. # TYPE #
  246. *IF DEF,DEBUG,1
  247. DB$CALL = LOC(NETPUT);
  248. NP$PUT; # SEND LEVEL 7 MESSAGE #
  249. RETURN; # RETURN TO CALLER #
  250. END # END OF PROC NET$SENDL7 #
  251.  
  252. CONTROL EJECT;
  253. #**********************************************************************#
  254. # #
  255. # NP$STPR CODE BEGINS HERE #
  256. # #
  257. #**********************************************************************#
  258.  
  259. NBACKTRIG = NIL; # SET BACKTRIG TO NULL #
  260. P<TABRESP> = LOC(RESP); # PULL TEMPLATE OVER RESPONSE WORD #
  261. P<STATUSWORD> = FTTSTATUS[FTTINDEX]; # GET ADDRESS OF STATUS #
  262. P<CHK> = FTTCKTBL[FTTINDEX]; # PULL CHECKMARK TEMPLATE TO THE #
  263. # THE ADDRESS STORED IN FTT #
  264. P<SUPMSG> = LOC(DATA$BUF); # PULL SUPERVISORY MSG TEMPLATE #
  265. # OVER TO DATA$BUF #
  266. P<FET$CIO> = FTTFETADR[FTTINDEX]; # SET DISK FET ADDRESS #
  267. P<CMB> = FTTCMV$BLK[FTTINDEX];
  268. SAVE$WORD = DATA$WORD[1]; # SAVE DATAWORD IN CASE OF TBN CHECK#
  269. DATA$WORD[0] = 0; # CLEAR DATA$WORD AT OFFSET 0 #
  270. DATA$WORD[1] = 0; # CLEAR DATA$WORD AT OFFSET 1 #
  271. CRNT$ORD = FTTSTORD[FTTINDEX]; # UPDATE CURRENT TABLE ORDINAL #
  272. CRNT$STATE = FTTSTATE[FTTINDEX]; # UPDATE CURRENT STATE OF FTT #
  273. FTTPRETRIG[FTTINDEX] = NTRIGGER; # SAVE CURRENT TRIGGER #
  274. NP$RTIM(TIME$WORD); # GENERATE TIMESTAMP #
  275. FTTTIME[FTTINDEX] = TIME$SEC[0]; # UPDATE FTTTIME #
  276. NP$STTP(CRNT$ORD,CRNT$STATE,NTRIGGER,RESP); # CALL STATE TABLE #
  277. IF LEGB NQ ONE # IF ILLEGAL ENTRY #
  278. THEN
  279. BEGIN
  280. FTTSTRC[FTTINDEX] = NAM$ERR; # UPDATE REASON CODE #
  281. NP$XCMP; # COMPLETE FILE TRANSFER #
  282. END
  283. ELSE
  284. BEGIN
  285. IF REASON NQ NOCHG # IF REASON NOT EQUAL TO NO CHANGE #
  286. THEN
  287. BEGIN
  288. FTTSTRC[FTTINDEX] = REASON; # UPDATE FTT REASON CODE #
  289. END
  290. CRNT$ACTION = ACTION1; # UPDATE CURRENT ACTION #
  291. ACTIONC = ONE; # INITIALIZE ACTION COUNT TO 1 #
  292. FOR I = 0 WHILE (CRNT$ACTION NQ NOCHG AND ACTIONC LQ TWO)
  293. DO
  294. BEGIN
  295. ACTIONC = ACTIONC + 1; # INCREMENT ACTION COUNT #
  296. GOTO ORDLST[CRNT$ORD]; # GOTO ORDINAL LABEL #
  297.  
  298. ORD0: GOTO PJUMP[CRNT$ACTION]; # JUMP TO PRU ACTION TABLE #
  299.  
  300. ORD1: GOTO PJUMP[CRNT$ACTION]; # JUMP TO PRU ACTION TABLE #
  301.  
  302. ORD2: GOTO CJUMP[CRNT$ACTION]; # JUMP TO CHARACTER ACTION TABLE #
  303.  
  304. ORD3: GOTO CJUMP[CRNT$ACTION]; # JUMP TO CHARACTER ACTION TABLE #
  305.  
  306. PLACT0: # **** STATUS = -1 **** #
  307. STATUSWD = -1; # STATUS = -1 #
  308. GOTO NEXTAT;
  309.  
  310. PLACT1: # **** SS(CKPT) **** #
  311. NP$BTO8(FTTICKVAL[FTTINDEX],ITEMP); # GET ASCII VALUE OF #
  312. # CHECK MARK VALUE #
  313. NET$SENDL7(LEV7$SS,ITEMP); # SEND SS(CHECKMARK) #
  314. GOTO NEXTAT;
  315.  
  316. PLACT2: # **** RETURN **** #
  317. IF IDLEDOWN # IF IDLEDOWN FLAG SET #
  318. THEN
  319. BEGIN
  320. IF REASON EQ RC1 # IF COMPLETE WITHOUT ERROR #
  321. THEN
  322. BEGIN
  323. REASON = RC12; # SET REASON CODE TO 12 #
  324. FTTSTRC[FTTINDEX] = RC12; # ALSO SET THE REASON CODE IN #
  325. END
  326. ELSE
  327. BEGIN
  328. REASON = RC13; # ELSE SET TO RC13 IF COMPLETE#
  329. # WITH ERROR #
  330. FTTSTRC[FTTINDEX] = RC13; # ALSO UPDATE THE REASON CODE #
  331. # IN THE FTT TABLE #
  332. END
  333. END
  334. NP$XCMP; # COMPLETE FILE TRANSFER #
  335. GOTO NEXTAT;
  336.  
  337. PLACT3: # **** PRU ON **** #
  338. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  339. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  340. OUT$ABHTLC[0] = ENTY2; # TLC = 2 #
  341. PFCSFC[0] = PRUON; # PFCSFC = PRUON #
  342. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT #
  343. IF FTTOPCODE[FTTINDEX] EQ 0 # IF RECEIVING SIDE #
  344. THEN
  345. BEGIN
  346. SPMUBZ[0]= FTTBSIZE[FTTINDEX]/ONE$PRU; # UBZ FOR RECVER#
  347. SPMDBZ[0] = 0; # ZERO OUT DBZ #
  348. END
  349. ELSE
  350. BEGIN # ELSE IF SENDER SIDE #
  351. SPMUBZ[0] = 0; # ZERO OUT UBZ FOR SENDER #
  352. SPMDBZ[0]= FTTBSIZE[FTTINDEX]/ONE$PRU; # DBZ FOR SENDER#
  353. END
  354. IF FTTMFACIL[FTTINDEX] # M-FACIL SPECIFIED #
  355. THEN
  356. BEGIN
  357. SPMCWS[0] = FTTCWS[FTTINDEX]; # SET WINDOW SIZE #
  358. END
  359. ELSE
  360. BEGIN
  361. SPMCWS[0] = 0; # NO CHECKMARKS SENT BY PIP #
  362. END
  363. SPMICK[0] = FTTICKVAL[FTTINDEX]; # SET CHECK MARK VALUE #
  364. SPMDD[0] = FTTUDD[FTTINDEX]; # SET DATA DECLARATION FLAG #
  365. SPMFL1[0] = TRUE; # IN DATA TRANSFER MODE #
  366. OPCODE = OP$PUT; # SET OPCODE #
  367. *IF DEF,STAT,1
  368. IAM = TYPE"PUT"; # SET EXECUTING ROUTINE TYPE #
  369. NP$PUT; # NETPUT PRUON #
  370. GOTO NEXTAT;
  371.  
  372. PLACT4: # **** STATUS = 0 **** #
  373. STATUSWD = 0; # STATUS = 0 #
  374. GOTO NEXTAT;
  375.  
  376. PLACT5: # **** OFT/START **** #
  377. LOC$HA = LOC(OUT$ABH); # UPDAT HEADER ADDRESS #
  378. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  379. OUT$ABHTLC[0] = ENTY2; # TWO WORD MSG #
  380. PFCSFC[0] = OFTSTRT; # COMMAND IS OFT/START #
  381. SPACN[0] = FTTACN[FTTINDEX]; # GET ACN FROM FTT TABLE #
  382. P<FET$CIO> = FTTFETADR[FTTINDEX]; # PULL FET CIO TEMPLATE TO #
  383. # FET ADDRESS FROM THE FTT #
  384. # TABLE #
  385. SPCURPR[0] = FTTCURPRU[FTTINDEX]; # GET START ADDRESS OF PRU#
  386. SPLFN[0] = FETLFN[0]; # GET FILE NAME FROM FET #
  387. SPFNT[0] = FETFNT[0]; # GET FNT POINTER FROM FET #
  388. OPCODE = OP$PUT; # SET OPCODE FOR NETPUTTING #
  389. *IF DEF,STAT,1
  390. IAM = TYPE"PUT"; # SET EXECUTING ROUTINE #
  391. NP$PUT; # NETPUT COMMAND #
  392. GOTO NEXTAT;
  393.  
  394. PLACT6: # **** OFT/OFF **** #
  395. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  396. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  397. OUT$ABHTLC[0] = ENTY1; # ONE WORD MSG #
  398. SPACN[0] = FTTACN[FTTINDEX]; # GET ACN FROM FTT TABLE #
  399. PFCSFC[0] = OFTOFF; # SUPERVISORY MSF IS OFT/OFF #
  400. OPCODE = OP$PUT; # SET OPCODE #
  401. *IF DEF,STAT,1
  402. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  403. NP$PUT; # NETPUT MESSAGE #
  404. GOTO NEXTAT;
  405.  
  406. PLACT7: # **** STATUS = -2 **** #
  407. STATUSWD = MINUS2; # SET STATUS = -2 #
  408. GOTO NEXTAT;
  409.  
  410. PLACT8: # **** ES(OK) **** #
  411. NET$SENDL7(LEV7$ES,PRDER1); # SEND ES(OK) #
  412. GOTO NEXTAT;
  413.  
  414. PLACT9: # **** FCRST **** #
  415. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  416. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  417. OUT$ABHTLC[0] = ENTY1; # ENTRY SIZE OF MESSAGE #
  418. PFCSFC[0] = FCRST; # MESSAGE IS FCRST #
  419. SPACN[0] = FTTACN[FTTINDEX]; # GET ACN FROM FTT TABLE #
  420. OPCODE = OP$PUT; # SET OPCODE #
  421. *IF DEF,STAT,1
  422. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  423. NP$PUT; # NETPUT NMESSAGE #
  424. GOTO NEXTAT;
  425.  
  426.  
  427. PLACT10: # **** ES(E) **** #
  428. IF FTTOPCODE[FTTINDEX] EQ 0 # IF RECEIVER #
  429. THEN
  430. BEGIN
  431. NET$SENDL7(LEV7$ES,PRDER3); # NON-RETRYABLE RECEIVE ERROR #
  432. END
  433. ELSE
  434. BEGIN
  435. NET$SENDL7(LEV7$ES,PRDER7); # NON-RETRYABLE SEND ERROR #
  436. END
  437. GOTO NEXTAT;
  438.  
  439. PLACT11: # **** IFTSTART **** #
  440. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  441. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  442. OUT$ABHTLC[0] = ENTY2; # WORD SIZE OF MESSAGE #
  443. PFCSFC[0] = IFTSTRT; # MESSAGE IS IFT/START #
  444. SPACN[0] = FTTACN[FTTINDEX]; # GET ACN FROM FTT TABLE #
  445. P<FET$CIO> = FTTFETADR[FTTINDEX]; # PULL CIO TEMPLATE OVER #
  446. # FET ADDRESS #
  447. SPCURPR[0] = FTTCURPRU[FTTINDEX]; # GET CURRENT PRU #
  448. # POSITION WITHIN THE FILE #
  449. SPLFN[0] = FETLFN[0]; # GET FILE NAME FROM FET #
  450. SPFNT[0] = FETFNT[0]; # FET FNT POINTER FROM FET #
  451. OPCODE = OP$PUT; # SET OPCODE #
  452. *IF DEF,STAT,1
  453. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  454. NP$PUT; # SEND MESSAGE #
  455. GOTO NEXTAT;
  456.  
  457. PLACT12: # **** IFT/OFF **** #
  458. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  459. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  460. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  461. PFCSFC[0] = IFTOFF; # MESSAGE IS OFT/OFF #
  462. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  463. OPCODE = OP$PUT; # SET OPCODE #
  464. *IF DEF,STAT,1
  465. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  466. NP$PUT; # NETPUT MESSAGE #
  467. GOTO NEXTAT;
  468.  
  469. PLACT13: # **** ER(OK) **** #
  470. NET$SENDL7(LEV7$ER,PRDER1); # ER(OK) SENT #
  471. GOTO NEXTAT;
  472.  
  473. PLACT14: # **** FCBRK **** #
  474. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  475. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  476. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  477. PFCSFC[0] = FCBRK; # SEND FCBRK #
  478. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  479. OPCODE = OP$PUT; # SET OPCODE #
  480. *IF DEF,STAT,1
  481. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  482. NP$PUT; # SEND MESSAGE #
  483. GOTO NEXTAT;
  484.  
  485. PLACT15: # **** RR(CKPT) **** #
  486. IF FTTRFACIL[FTTINDEX] # IF RFACIL SPECIFIED #
  487. THEN
  488. BEGIN
  489. IF FTTNRETRY[FTTINDEX ] NQ 0 # IF RETRY COUNT NOT 0 #
  490. THEN
  491. BEGIN
  492. FTTNRETRY[FTTINDEX] = FTTNRETRY[FTTINDEX] - 1;
  493. NP$BTO8(FTTICKVAL[FTTINDEX],ITEMP); # CONVERT TO ASCII #
  494. NET$SENDL7(LEV7$RR,ITEMP); # SEND RR #
  495. END
  496. ELSE
  497. BEGIN
  498. FTTSTRC[FTTINDEX] = MAX$RTY; # MAXIMUM RETRY REACHED #
  499. NP$XCMP; # END FILE TRANSFER #
  500. END
  501. END
  502. ELSE
  503. BEGIN
  504. NP$XCMP; # END FILE TRANSFER IF R NOT #
  505. END # SEPECIFIED #
  506. GOTO NEXTAT;
  507.  
  508.  
  509. PLACT16: # **** ER(E) **** #
  510. IF FTTOPCODE[FTTINDEX] EQ 0 # IF RECEIVER #
  511. THEN
  512. BEGIN
  513. NET$SENDL7(LEV7$ER,PRDER4); # NON-RETRYABLE RECEIVE ERROR #
  514. END
  515. ELSE
  516. BEGIN
  517. NET$SENDL7(LEV7$ER,PRDER7); # NON-RETRYABLE SEND ERROR #
  518. END
  519. GOTO NEXTAT;
  520.  
  521. PLACT17: # **** QR(E) **** #
  522. NET$SENDL7(LEV7$QR,PRDER4); # NON-RETRYABLE RECEIVE ERROR #
  523. GOTO NEXTAT;
  524.  
  525. PLACT18: # **** INTRRSP **** #
  526. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  527. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  528. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  529. PFCSFC[0] = INTRRSP; # SEND INTRRSP #
  530. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  531. OPCODE = OP$PUT; # SET OPCODE #
  532. *IF DEF,STAT,1
  533. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  534. NP$PUT; # SEND MESSAGE #
  535. GOTO NEXTAT;
  536.  
  537. PLACT19: # **** IDLE = TRUE **** #
  538. IDLEDOWN = TRUE; # SET IDLEDOWN TO TRUE #
  539. GOTO NEXTAT;
  540. PLACT20: # *** PRUONA RECEIVED *** #
  541. IF PRERC EQ RETRY$PRA # IF REASON CODE FROM PRUONA #
  542. THEN # IS 5 #
  543. BEGIN # CHANGE STATE TO STATE 15 #
  544. NEWSTATE = NSPWACK; # SO THAT IT CAN RETRY PRUON #
  545. # WHEN IT RECEIVES A FCACK #
  546. END
  547. ELSE
  548. BEGIN
  549. IF PRERC EQ INTRA$PRA # REASON CODE 4 #
  550. THEN # SWITCH TO INTRAHOST BINARY #
  551. BEGIN # FILE XFR #
  552. NP$RLOC; # CALL BUFFER REALLOCATION #
  553. # PROCEDURE #
  554. FTTSTORD[FTTINDEX] = NETSCOD; # SET TABLE ORDINAL #
  555. # TO CHARACTER MODE SENDER #
  556. FTTSTATE[FTTINDEX] = NSCDATA; # STATE IS DATA PHASE #
  557. END
  558. ELSE
  559. BEGIN
  560. IF IDLEDOWN # IF IDLEDOWN FLAG SET #
  561. THEN
  562. BEGIN
  563. IF REASON EQ RC1 # IF COMPLETE WITHOUT ERROR #
  564. THEN
  565. BEGIN
  566. REASON = RC12; # SET REASON CODE TO 12 #
  567. FTTSTRC[FTTINDEX] = RC12;# SET REASON CODE TO 12 #
  568. END
  569. ELSE
  570. BEGIN
  571. REASON = RC13; # ELSE SET TO RC13 IF COMPLETE#
  572. # WITH ERROR #
  573. FTTSTRC[FTTINDEX] = RC13;# UPDATE THE REASON CODE #
  574. # IN THE FTT TABLE #
  575. END
  576. END
  577. NP$XCMP; # EXIT FILE TRANSFER #
  578. END
  579. END
  580. GOTO NEXTAT;
  581. PLACT21: # *** PRUONA RECEIVED *** #
  582. # *** FOR RECEIVER *** #
  583. IF PRERC EQ INTRA$PRA # REASON CODE 4 FROM PRUONA #
  584. THEN # SWITCH TO INTRAHOST BINARY #
  585. BEGIN # FILE XFR #
  586. NP$RLOC; # CALL BUFFER REALLOCATION #
  587. # PROCEDURE #
  588. FTTSTORD[FTTINDEX] = NETRCOD; # SET TABLE ORDINAL #
  589. # TO CHARACTER MODE SENDER #
  590. FTTSTATE[FTTINDEX] = NRCDATA; # STATE IS DATA PHASE #
  591. NP$BTO8(FTTICKVAL[FTTINDEX],ITEMP); # FAKE SR #
  592. NET$SENDL7(LEV7$SR,ITEMP);
  593. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1;
  594. END
  595. ELSE
  596. BEGIN
  597. IF IDLEDOWN # IF IDLEDOWN FLAG SET #
  598. THEN
  599. BEGIN
  600. IF REASON EQ RC1 # IF COMPLETE WITHOUT ERROR #
  601. THEN
  602. BEGIN
  603. REASON = RC12;
  604. FTTSTRC[FTTINDEX] = RC12;# SET REASON CODE TO 12 #
  605. END
  606. ELSE
  607. BEGIN
  608. REASON = RC13; # ELSE SET TO RC13 IF COMPLETE#
  609. # WITH ERROR #
  610. FTTSTRC[FTTINDEX] = RC13;# UPDATE THE REASON CODE #
  611. # IN THE FTT TABLE #
  612. END
  613. END
  614. NP$XCMP; # EXIT FILE TRANSFER #
  615. END
  616. GOTO NEXTAT;
  617. PLACT22: # **** LSTOFF **** #
  618. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  619. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  620. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  621. PFCSFC[0] = LSTOFF; # SEND LSTOFF #
  622. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  623. OPCODE = OP$PUT; # SET OPCODE #
  624. *IF DEF,STAT,1
  625. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  626. NP$PUT; # SEND MESSAGE #
  627. GOTO NEXTAT;
  628. PLACT23: # **** LSTON **** #
  629. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  630. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  631. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  632. PFCSFC[0] = LSTON; # SEND LSTON #
  633. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  634. OPCODE = OP$PUT; # SET OPCODE #
  635. *IF DEF,STAT,1
  636. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  637. NP$PUT; # SEND MESSAGE #
  638. GOTO NEXTAT;
  639. CLACT0: # **** STATUS = -1 **** #
  640. STATUSWD = -1;
  641. GOTO NEXTAT;
  642.  
  643. CLACT1: # **** SS(CHECKMARK) **** #
  644. NP$BTO8(FTTICKVAL[FTTINDEX],ITEMP); # CONVERT TO ASCII #
  645. NET$SENDL7(LEV7$SS,ITEMP); # SEND SS #
  646. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1; # DECREASE #
  647. # WINDOW SIZE #
  648. GOTO NEXTAT;
  649.  
  650. CLACT2: # **** STATUS = 0 **** #
  651. STATUSWD = 0; # SET STATUS TO 0 #
  652. GOTO NEXTAT;
  653. CLACT3: # **** ES(E) **** #
  654. IF FTTOPCODE[FTTINDEX] EQ 0 # NON-RETRYABLE RECEIVE ERROR #
  655. THEN
  656. BEGIN
  657. NET$SENDL7(LEV7$ES,PRDER3); # SEND ES(E) #
  658. END
  659. ELSE
  660. BEGIN
  661. NET$SENDL7(LEV7$ES,PRDER7); # SEND ES(E) #
  662. END
  663. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1; # DECREASE #
  664. # WINDOW SIZE #
  665. GOTO NEXTAT;
  666.  
  667. CLACT4: # **** ADVANCE ABL WINDOW *** #
  668. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] + 1;
  669. GOTO NEXTAT;
  670.  
  671. CLACT5: # **** RETURN **** #
  672. IF IDLEDOWN # IF IDLEDOWN FLAG SET #
  673. THEN
  674. BEGIN
  675. IF REASON EQ RC1 # IF COMPLETE WITHOUT ERROR #
  676. THEN
  677. BEGIN
  678. REASON = RC12; # SET REASON CODE TO 12 #
  679. FTTSTRC[FTTINDEX] = RC12; # ALSO SET THE REASON CODE IN #
  680. END
  681. ELSE
  682. BEGIN
  683. REASON = RC13; # ELSE SET TO RC13 IF COMPLETE#
  684. # WITH ERROR #
  685. FTTSTRC[FTTINDEX] = RC13; # ALSO UPDATE THE REASON CODE #
  686. # IN THE FTT TABLE #
  687. END
  688. END
  689. IF FTTOPCODE[FTTINDEX] EQ 0 OR # RECEIVER OR ABL WINDOW #
  690. FTTABL[FTTINDEX] EQ FTTCURBLK[FTTINDEX] OR# FULLY OPEN #
  691. REASON EQ RC2 OR REASON EQ RC3 OR # OR REAOSN CODE = 2,3,5#
  692. REASON EQ RC5
  693. THEN
  694. BEGIN
  695. NP$XCMP; # COMPLETE FILE TRANSFER #
  696. END
  697. ELSE
  698. BEGIN
  699. FTTSTATE[FTTINDEX] = NSCWACK;# INTERNALLY CHANGE STATE TO #
  700. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  701. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  702. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  703. PFCSFC[0] = LSTOFF; # SEND LSTOFF #
  704. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  705. OPCODE = OP$PUT; # SET OPCODE #
  706. *IF DEF,STAT,1
  707. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  708. NP$PUT; # SEND MESSAGE #
  709. GOTO NEXTAT;
  710. END # WAIT FOR ALL FCACKS PENDING #
  711. GOTO NEXTAT;
  712. CLACT6: # **** RESET ABL WINDOW **** #
  713. # **** SEND FCRST **** #
  714. # **** FCBRK IS RECEIVED **** #
  715. FTTOUTCWS[FTTINDEX] = 0; # RESET OUTSTANDING CHECKMARK #
  716. FTTBLK$MS[FTTINDEX] = MSWINDOWSZ; # RESET CHECKMARK WINDOW #
  717. FTTCURBLK[FTTINDEX] = FTTABL[FTTINDEX];
  718. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  719. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  720. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  721. PFCSFC[0] = FCRST; # SEND FCRST #
  722. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  723. OPCODE = OP$PUT; # SET OPCODE #
  724. *IF DEF,STAT,1
  725. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  726. NP$PUT; # SEND MESSAGE #
  727. GOTO NEXTAT;
  728.  
  729. CLACT7: # **** INTRRSP **** #
  730. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  731. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  732. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  733. PFCSFC[0] = INTRRSP; # SEND INTRRSP #
  734. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  735. OPCODE = OP$PUT; # SET OPCODE #
  736. *IF DEF,STAT,1
  737. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  738. NP$PUT; # SEND MESSAGE #
  739. GOTO NEXTAT;
  740.  
  741. CLACT8: # **** IDLEDOWN = TRUE **** #
  742. IDLEDOWN = TRUE;
  743. GOTO NEXTAT;
  744.  
  745. CLACT9: # ** STATUS = -1 AND RESET ** #
  746. STATUSWD = -1; # STATUS = -1 #
  747. FTTOUTCWS[FTTINDEX] = 0; # RESET OUTSTANDING CHECKMARK #
  748. FTTBLK$MS[FTTINDEX] = MSWINDOWSZ; # RESET CHECKMARK WINDOW #
  749. NP$8TIN(DATA$WORD[2],ITEMP); # GET CHECKMARK NUMBER #
  750. IF ITEMP LS FTTLCKACK[FTTINDEX]
  751. OR ITEMP GR FTTLCKSNT[FTTINDEX] # IF CHECKMARK OUT OF #
  752. THEN # RANGE #
  753. BEGIN
  754. FTTSTRC[FTTINDEX] = BAD$CHK; # SET REASON CODE TO 22 #
  755. NP$XCMP; # EXIT WITH REASON CODE #
  756. END
  757. ELSE
  758. BEGIN # OTHERWISE READY TO RESTART #
  759. IF FTTRFACIL[FTTINDEX] # IF RESTART ALLOWED #
  760. THEN
  761. BEGIN
  762. IF FTTNRETRY[FTTINDEX] NQ 0 # MAXRETRY NOT REACHED #
  763. THEN
  764. BEGIN
  765. FTTNRETRY[FTTINDEX] = FTTNRETRY[FTTINDEX] - 1;
  766. FTTRPND[FTTINDEX] = TRUE; # SET RESTART PENDING FLAG #
  767. IF ITEMP NQ 0 # IF NON-ZERO CHECKMARK #
  768. THEN
  769. BEGIN
  770. NP$XLCH(ITEMP,ITEMP2); # LOCATE CHECK MARK ENTRY #
  771. IF ITEMP2 GR CHK$START # IF ENTRY IS OTHER THAN #
  772. THEN
  773. BEGIN # THE DEFAULT ENTRY #
  774. CHK$IDX[0] = CHK$START; # RESET CHK$IDX #
  775. CHK$WRD1[CHK$START] = CHK$WRD1[ITEMP2];
  776. CHK$WRD2[CHK$START] = CHK$WRD2[ITEMP2];
  777. END # COLLAPSE TABLE TO DEFAULT #
  778. # ENTRY + THE ENTRY OF RR #
  779. ITEMP2 = FETIN[0] - FETOUT[0]; # COMPUTE PRU #
  780. IF ITEMP2 LS 0 # GET DIFFERENCE IN WORD NUMBER #
  781. THEN
  782. BEGIN
  783. ITEMP2 = ITEMP2 + FETLIM[0] - FETFIR[0];
  784. END
  785. ITEMP2 = ITEMP2 + FTTWORD[FTTINDEX];
  786. FTTCURPRU[FTTINDEX] = FTTCURPRU[FTTINDEX] +
  787. ITEMP2/64;
  788. IF FTTEOR[FTTINDEX] # IF EOR #
  789. THEN
  790. BEGIN
  791. IF FTTEOI[FTTINDEX] # IF EOI #
  792. THEN
  793. BEGIN
  794. IF ( FETIN[0] NQ FETOUT[0]) OR
  795. (CMB$DBIT[0] NQ CMB$STEP[0])
  796. THEN
  797. BEGIN
  798. FTTCURPRU[FTTINDEX] = FTTCURPRU[FTTINDEX] + 1;
  799. END
  800. END # END OF EOI #
  801. ELSE # NOT EOI BUT EOR/EOF #
  802. BEGIN
  803. FTTCURPRU[FTTINDEX] = FTTCURPRU[FTTINDEX] + 1;
  804. END
  805. FTTTBC[FTTINDEX] = 0;# CLEAR LEVEL NO + EORI FLAGS #
  806. END # END OF EOR #
  807. PRUDIFF = FTTCURPRU[FTTINDEX]- CHK$PRUNO[CHK$START];
  808. CIOSKIP[0] = PRUDIFF; # SET NUMBER OF PRU BACKSPACED#
  809. # BACKSPACED #
  810. NP$CIO(CIO$BKSPRU); # BACKSPACE PRU #
  811. CIOSKIP[0] = 0; # CLEAR SKIP COUNT #
  812. FETIN[0] = FETFIR[0]; # RESET DISK IN POINTER #
  813. FETOUT[0] = FETFIR[0] ;
  814. CMB$STATE[0] = CHK$STATE[CHK$START];
  815. CMB$DBIT[0] = CHK$DBIT[CHK$START];
  816. FTTWORD[FTTINDEX] = CHK$WORD[CHK$START];
  817. FTTCURPRU[FTTINDEX] = CHK$PRUNO[CHK$START];
  818. FTTDBIT[FTTINDEX] = CHK$DBIT[CHK$START];
  819. FTTMSTATE[FTTINDEX] = CHK$STATE[CHK$START];
  820. FTTTBN[FTTINDEX] = 0; # CRUDGE FOR RVL #
  821. END # COPY CHECKMARK INFO TO FTT #
  822. ELSE
  823. BEGIN
  824. NP$CIO(CIO$REWIND); # REWIND DISK FILE #
  825. CMB$STATE[0] = CHK$STATE[1];
  826. CMB$DBIT[0] = CHK$DBIT[1];
  827. CHK$IDX[0] = 1; # COLLAPSE TABLE TO DEFAULT #
  828. FTTWORD[FTTINDEX] = CHK$WORD[1]; # ENTRY #
  829. FTTCURPRU[FTTINDEX] = CHK$PRUNO[1];
  830. FTTDBIT[FTTINDEX] = CHK$DBIT[1];
  831. FTTMSTATE[FTTINDEX] = CHK$STATE[1];
  832. FTTTBN[FTTINDEX] = 0;
  833. END
  834. FTTLCKACK[FTTINDEX] = ITEMP; # SET LAST CHEKMARK ACKED#
  835. FTTLCKSNT[FTTINDEX] = ITEMP; # TO CHECKMARK OF RR #
  836. FTTICKVAL[FTTINDEX] = ITEMP; # UPDATE INITIAL CHECK #
  837. END # MARK NUMBER #
  838. ELSE
  839. BEGIN
  840. FTTSTRC[FTTINDEX] = MAX$RTY; # SET REASON CODE TO #
  841. # MAXRETRY COUNT REACHED #
  842. NP$XCMP; # QUIT NETXFR #
  843. END
  844. END
  845. ELSE
  846. BEGIN
  847. FTTSTRC[FTTINDEX] = BSN$ERR; # ERROR EXIT NO RESTART #
  848. NP$XCMP;
  849. END
  850. END
  851. GOTO NEXTAT;
  852.  
  853. CLACT10: # **** ES(OK) **** #
  854. NET$SENDL7(LEV7$ES,PRDER1); # SEND ES(OK) #
  855. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1;
  856. # DECREASE ABL WINDOW VALUE #
  857. IF FTTCURBLK[FTTINDEX] EQ 0 # IF ABL WINDOW CLOSED #
  858. THEN
  859. BEGIN
  860. NBACKTRIG = NSCTABE; # ABL CLOSED AFTER ES(OK) SENT#
  861. END
  862. GOTO NEXTAT;
  863.  
  864. CLACT11: # ** ADVANCE CHECHMARK WINDOW #
  865. NP$8TIN(DATA$WORD[2],ITEMP); # EXTRACT CHECKMARK NUMBER #
  866. IF ITEMP LS FTTLCKACK[FTTINDEX] OR
  867. ITEMP GR FTTLCKSNT[FTTINDEX] # CHECKMARK OUT OF RANGE #
  868. THEN
  869. BEGIN
  870. FTTSTRC[FTTINDEX] = BAD$CHK;# SET REASON CODE TO 22 #
  871. NP$XCMP; # QUIT NETXFR #
  872. END
  873. ELSE
  874. BEGIN
  875. FTTOUTCWS[FTTINDEX] = FTTOUTCWS[FTTINDEX] - 1;
  876. FTTLCKACK[FTTINDEX] = ITEMP;# UPDATE LAST CHECKMARK ACKED #
  877. NP$XLCH(ITEMP,ITEMP2); # LOCATE CHECK MARK ENTRY #
  878. IF ITEMP2 GR CHK$START # IF ENTRY IS NOT THE DEFAULT #
  879. THEN
  880. BEGIN # ENTRY #
  881. NP$SHRK(ITEMP2); # SHRINK CHECKMARK TABLE UP TO#
  882. END # THIS ENTRY #
  883. END
  884. GOTO NEXTAT;
  885.  
  886. CLACT12: # **** SEND DATA **** #
  887. NP$SENF(NBACKTRIG); # CALL SEND DATA #
  888. GOTO NEXTAT;
  889.  
  890. CLACT13: # **** SR **** #
  891. P<LV7$BASE> = LOC(DATA$WORD[1]);# SET LEVEL 7 BASE TO DATAWOR#
  892. ITEMP = LV7$ERROR[0]; # EXTRACT CHECKMARK NUMBER #
  893. NET$SENDL7(LEV7$SR,ITEMP);
  894. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1;
  895. # DECREASE ABL WINDOW BY 1 #
  896. GOTO NEXTAT;
  897.  
  898. CLACT14: # **** ER(E) **** #
  899. IF FTTOPCODE[FTTINDEX] EQ 0 # IF RECEIVER #
  900. THEN
  901. BEGIN
  902. NET$SENDL7(LEV7$ER,PRDER4); # NON-RETRYABLE RECEIVE ERROR #
  903. END
  904. ELSE
  905. BEGIN
  906. NET$SENDL7(LEV7$ER,PRDER7); # NON-RETRYABLE SEND ERROR #
  907. END
  908. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1;
  909. # DECREASE ABL WINDOW BY 1 #
  910. GOTO NEXTAT;
  911.  
  912. CLACT15: # ** STATUS = -1 AND RWL ** #
  913. STATUSWD = -1; # STATUS = -1 #
  914. FTTCURBLK[FTTINDEX] = FTTABL[FTTINDEX];
  915. GOTO NEXTAT;
  916.  
  917. CLACT16: # **** SS(CHECKMARK)**** #
  918. P<LV7$BASE> = LOC(DATA$WORD[1]);# SET LEVEL 7 BASE TO DATAWOR#
  919. ITEMP = LV7$ERROR[0]; # EXTRACT CHECKMARK NUMBER #
  920. NET$SENDL7(LEV7$SS,ITEMP); # SEND SS THE CHECKMAR USED #
  921. # IS THE SAME AS RR AS A #
  922. # CONFIRMATION #
  923. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1;
  924. # DECREASE ABL WINDOW #
  925. GOTO NEXTAT;
  926.  
  927. CLACT17: # **** STATUS = -2 **** #
  928. STATUSWD = MINUS2; # SET STATUS = -2 #
  929. GOTO NEXTAT;
  930.  
  931. CLACT18: # **** QR(E) **** #
  932. NET$SENDL7(LEV7$QR,PRDER3); # NON-RETRYABLE RECEIVE ERROR #
  933. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1;
  934. # DECREASE ABL WINDOW BY 1 #
  935. GOTO NEXTAT;
  936.  
  937. CLACT19: # **** CLOSE **** #
  938. NP$CIO(CIO$CLOSE); # CLOSE FILE #
  939. IF FETEC[0] NQ 0 # IF ERROR EXISTS IN CLOSE #
  940. THEN
  941. BEGIN
  942. NBACKTRIG = NRCTITR; # SET BACK TRIGGER TO INTERNAL#
  943. END # ERROR #
  944. ELSE
  945. BEGIN
  946. NBACKTRIG = NRCTEOK; # SET BACK TRIGGER TO ENDOK #
  947. END
  948. GOTO NEXTAT;
  949.  
  950. CLACT20: # **** SAVE CHECKMARK **** #
  951. NP$8TIN(DATA$WORD[2],ITEMP); # GET CHECKMARK VALUE #
  952. CHK$IDX[0] = CHK$START; # SET ENTRY POINTER TO SECOND #
  953. # ENTRY #
  954. CHK$MARK[CHK$START] = ITEMP; # COPY CHECKMARK NUMBER #
  955. CHK$PRUNO[CHK$START] = FTTCURPRU[FTTINDEX];# UPDATE CHECKMARK#
  956. CHK$WORD[CHK$START] = FTTWORD[FTTINDEX]; # TABLE #
  957. CHK$DBIT[CHK$START] = FTTDBIT[FTTINDEX];
  958. CHK$STATE[CHK$START] = FTTMSTATE[FTTINDEX];
  959. CHK$TBN[CHK$START] = FTTTBN[FTTINDEX];
  960. FTTLCKACK[FTTINDEX] = ITEMP; # SAVE LAST MS RECEIVED #
  961. NBACKTRIG = NRCTCHM; # SET BACKTRIG TO SEND MR #
  962. GOTO NEXTAT;
  963.  
  964. CLACT21:
  965. DATA$WORD[1] = SAVE$WORD; # RESTORE DATA$WORD 1 #
  966. NP$RECV(NBACKTRIG); # RECEIVER #
  967. DATA$WORD[1] = 0; # CLEAR DATA$WORD 1 #
  968. GOTO NEXTAT;
  969.  
  970. CLACT22: # **** FCBRK **** #
  971. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  972. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  973. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  974. PFCSFC[0] = FCBRK; # SEND FCBRK #
  975. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  976. OPCODE = OP$PUT; # SET OPCODE #
  977. *IF DEF,STAT,1
  978. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  979. NP$PUT; # SEND MESSAGE #
  980. GOTO NEXTAT;
  981.  
  982. CLACT23: # **** MR **** #
  983. NP$BTO8(FTTLCKACK[FTTINDEX],ITEMP); # CONVERTS TO ASCII #
  984. NET$SENDL7(LEV7$MR,ITEMP); # SEND MR #
  985. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1;
  986. # DECREASE ABL WINDOW BY 1 #
  987. GOTO NEXTAT;
  988.  
  989. CLACT24: # **** RR(CHECKMARK) **** #
  990. IF FTTRFACIL[FTTINDEX] # IF RFACIL SPECIFIED #
  991. THEN
  992. BEGIN
  993. IF FTTNRETRY[FTTINDEX] GR 0# IF MAXRETRY COUNT NOT EXCEED#
  994. THEN
  995. BEGIN
  996. FTTNRETRY[FTTINDEX] = FTTNRETRY[FTTINDEX] - 1;
  997. IF CHK$IDX GQ CHK$START # NON-ZERO CHECKMARK #
  998. THEN
  999. BEGIN
  1000. NP$BTO8(CHK$MARK[CHK$START],ITEMP);# GET ASCII VALUE #
  1001. PRUDIFF = FTTCURPRU[FTTINDEX] - CHK$PRUNO[CHK$START];
  1002. # COMPUTE PRU DIFFERENCE #
  1003. IF PRUDIFF GR 0 # HAVE TO BACKSPACE AND READ #
  1004. THEN
  1005. BEGIN
  1006. CIOSKIP[0] = PRUDIFF; # SET PRU TO BE BACKSPACED #
  1007. NP$CIO(CIO$BKSPRU); # BACKSPACE PRU'S #
  1008. CIOSKIP[0] = 0; # CLEAR SKIP COUNT #
  1009. FETOUT[0] = FETFIR[0];
  1010. FETIN[0] = FETFIR[0];
  1011. NP$CIO(CIO$RPHR); # READ IN THAT PRU #
  1012. CIOSKIP[0] = 1;
  1013. NP$CIO(CIO$BKSPRU);
  1014. CIOSKIP[0] = 0;
  1015. FETIN[0] = CHK$WORD[CHK$START] + FETFIR[0];
  1016. END
  1017. ELSE
  1018. BEGIN # NO NEED TO BACKSPACE #
  1019. FETIN[0] = FETOUT[0] + CHK$WORD[CHK$START];
  1020. IF FETIN[0] GQ FETLIM[0]#WRAP AROUND HAS OCCURRED #
  1021. THEN
  1022. BEGIN
  1023. FETIN[0] = FETFIR[0] + (FETIN[0] - FETLIM[0]);
  1024. END
  1025. END
  1026. CMB$DBIT[0] = CHK$DBIT[CHK$START]; # SET DBIT #
  1027. CMB$STATE[0] = CHK$STATE[CHK$START];
  1028. FTTMSTATE[FTTINDEX] = CHK$STATE[CHK$START];
  1029. FTTCURPRU[FTTINDEX] = CHK$PRUNO[CHK$START];
  1030. FTTWORD[FTTINDEX] = CHK$WORD[CHK$START];
  1031. FTTDBIT[FTTINDEX] = CHK$DBIT[CHK$START];
  1032. FTTTBN[FTTINDEX] = 0; # CRUDGE FOR RVL #
  1033. P<COPYAREA> = FETIN[0];
  1034. ITEMP2 = WORDLENGTH - CMB$DBIT[0];
  1035. B<ITEMP2,CMB$DBIT[0]>WORD[0] = 0; # CLEAR WORD #
  1036. END
  1037. ELSE
  1038. BEGIN
  1039. NP$CIO(CIO$REWIND); # REWIND FILE #
  1040. P<COPYAREA> = 0;
  1041. WORD[FETIN[0]] = 0; # CLEAR FIRST WORD OF DBUF #
  1042. CMB$DBIT[0] = CHK$DBIT[1]; # SET DBIT #
  1043. CMB$STATE[0] = 0;
  1044. FTTMSTATE[FTTINDEX] = 0;
  1045. FTTCURPRU[FTTINDEX] = 0; # START FROM PRU 0 #
  1046. FTTWORD[FTTINDEX] = 0;
  1047. FTTTBN[FTTINDEX] = 0;
  1048. FTTDBIT[FTTINDEX] = CMB$DBIT[0];
  1049. ITEMP = PRDER1; # SET ASCII 0 CHECKMARK #
  1050. END
  1051. NET$SENDL7(LEV7$RR,ITEMP); # SEND RR AS LEVEL 7 MESSAGE#
  1052. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1;
  1053. END
  1054. ELSE
  1055. BEGIN
  1056. FTTSTRC[FTTINDEX] = MAX$RTY; # SET REASON CODE #
  1057. NP$XCMP; # QUIT NETXFR #
  1058. END
  1059. END
  1060. ELSE
  1061. BEGIN
  1062. NP$XCMP;
  1063. END
  1064. GOTO NEXTAT;
  1065.  
  1066. CLACT25: # **** ER(OK) **** #
  1067. NET$SENDL7(LEV7$ER,PRDER1); # SEND ER(OK) #
  1068. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] - 1;
  1069. # DECREASE ABL WINDOW BY 1 #
  1070. GOTO NEXTAT;
  1071. CLACT26: # **** LSTOFF **** #
  1072. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  1073. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  1074. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  1075. PFCSFC[0] = LSTOFF; # SEND LSTOFF #
  1076. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  1077. OPCODE = OP$PUT; # SET OPCODE #
  1078. *IF DEF,STAT,1
  1079. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  1080. NP$PUT; # SEND MESSAGE #
  1081. GOTO NEXTAT;
  1082. CLACT27: # **** LSTON **** #
  1083. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  1084. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  1085. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  1086. PFCSFC[0] = LSTON; # SEND LSTON #
  1087. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  1088. OPCODE = OP$PUT; # SET OPCODE #
  1089. *IF DEF,STAT,1
  1090. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  1091. NP$PUT; # SEND MESSAGE #
  1092. GOTO NEXTAT;
  1093. CLACT28: # *** ADV WINDOW + LSTON #
  1094. FTTCURBLK[FTTINDEX] = FTTCURBLK[FTTINDEX] + 1;
  1095. LOC$HA = LOC(OUT$ABH); # UPDATE HEADER ADDRESS #
  1096. LOC$TA = LOC(DATA$BUF); # UPDATE TEXT AREA ADDRESS #
  1097. OUT$ABHTLC[0] = ENTY1; # WORD COUNT OF MESSAGE #
  1098. PFCSFC[0] = LSTON; # SEND LSTON #
  1099. SPACN[0] = FTTACN[FTTINDEX]; # PICK UP ACN FROM FTT TABLE #
  1100. OPCODE = OP$PUT; # SET OPCODE #
  1101. *IF DEF,STAT,1
  1102. IAM = TYPE"PUT"; # SET TYPE OF ROUTINE #
  1103. NP$PUT; # SEND MESSAGE #
  1104. GOTO NEXTAT;
  1105.  
  1106. NEXTAT: CRNT$ACTION = ACTION2; # GET ACTION2 #
  1107. END # END WHILE #
  1108. IF NEWSTATE NQ NOCHG # IF NOT SAME STATE #
  1109. THEN
  1110. BEGIN
  1111. *IF DEF,DEBUG,1
  1112. FTTPREST[NETCON]= FTTSTATE[NETCON]; # UPDATE FILE TABLE#
  1113. *IF DEF,DEBUG,1
  1114. FTTPREST[NETCON ] = FTTSTATE[NETCON ]; # UPDATE FILE TABLE#
  1115. FTTSTATE[NETCON] = NEWSTATE;
  1116. END
  1117. END # END IF #
  1118. EXITT: RETURN; # RETURN TO CALLER #
  1119. END # END OF NP$STPR #
  1120. TERM
  1121. *ENDIF
cdc/nos2.source/nam5871/np_stpr.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator