User Tools

Site Tools


cdc:nos2.source:nam5871:netxfr

NETXFR

Table Of Contents

  • [00012] PROC NETXFR(ACN,FILENAME,CODE,STATIS,NOWAIT,DATADEC,TIMEOUT,ABL,FACIL,
  • [00014] NETXFR - INITIATE TRANSFER OF A FILE.
  • [00019] INITIATE TRANSFER OF A FILE.
  • [00139] PROC NP$STPR
  • [00140] PROC NP$GET
  • [00141] PROC NP$GJO
  • [00143] PROC NP$SN
  • [00144] PROC NP$PUT
  • [00145] PROC NETWTQ
  • [00146] PROC NP$ERR
  • [00147] PROC NP$MSG
  • [00148] PROC NP$RCL
  • [00149] PROC NP$RTIM
  • [00150] PROC NP$S63
  • [00151] PROC NP$VALF
  • [00152] PROC NP$XFR
  • [00153] PROC NP$INIT
  • [00154] FUNC NP$CS63 B
  • [00155] FUNC NP$CDD C(10)

Source Code

NETXFR.txt
  1. *DECK NETXFR
  2. *IF DEF,XFR
  3. USETEXT AIPDEF
  4. USETEXT NP$NWL
  5. USETEXT NP$GETS
  6. USETEXT NP$STAT
  7. USETEXT NP$DB
  8. USETEXT NP$TAA
  9. USETEXT NX$ACBF
  10. USETEXT NX$ACBX
  11. USETEXT NX$MSG
  12. PROC NETXFR(ACN,FILENAME,CODE,STATIS,NOWAIT,DATADEC,TIMEOUT,ABL,FACIL,
  13. BSIZE,CWS,ICKVAL);
  14. # TITLE NETXFR - INITIATE TRANSFER OF A FILE. #
  15.  
  16. BEGIN # NETXFR #
  17.  
  18. #
  19. ** NETXFR - INITIATE TRANSFER OF A FILE.
  20. *
  21. * NETXFR INITIATES DATA-TRANSFERS TO A REMOTE APPLICATION AND
  22. * UNLESS IMMEDIATE RETURN IS REQUESTED, CALLS NETXFRC UNTIL THE
  23. * TRANSFER IS COMPLETE.
  24. *
  25. * PROC NETXFR(ACN,FILENAME,CODE,STATIS,NOWAIT,DATADEC,TIMEOUT,
  26. * ABL,FACIL,BSIZE,CWS,ICKVAL
  27. *
  28. * ENTRY ACN - APPLICATION CONNECTION NUMBER.
  29. * FILENAME - FILE NAME TO BE TRANSFERRED, IN DISPLAY
  30. * CODE, 7 CHARACTERS MAXIMUM.
  31. * CODE = 0, FILE TO BE RECEIVED FROM THE NETWORK
  32. * = 1, FILE TO BE SENT TO THE NETWORK.
  33. * STATIS - CALLING PROGRAM REPLY STATUS WORD
  34. * NOWAIT = 0, RETURN FROM NETXFR CALL WHEN THE FILE
  35. * TRANSFER IS COMPLETED.
  36. * = 1, RETURN FROM NETXFR CALL IMMEDIATELY.
  37. * DATADEC - FORMAT OF THE DATA THAT IS TO BE
  38. * TRANSFERRED.
  39. * = 0, UH - THE FILE CONTAINS BINARY DATA
  40. * WITH EMBEDDED CONTROL WORDS.
  41. * 1, UU - THE FILE CONTAINS BINARY DATA IN
  42. * AN UNSTRUCTURED (NO EOR/EOFS)
  43. * FORMAT.
  44. * 2, US - THE FILE CONTAINS BINARY DATA IN
  45. * A STRUCTURED FORMAT.
  46. * 3, C6 - THE FILE CONTAINS 6-BIT DISPLAY
  47. * CODE DATA WITH Z-BYTE RECORDS AND
  48. * PHYSICAL BOUNDARIES (EOR/EOFS).
  49. * 4, C8 - THE FILE CONTAINS 8-BIT ASCII IN
  50. * 12-BIT BYTES, 5 CHARACTERS TO A
  51. * WORD. LINES ARE TERMINATED BY
  52. * Z-BYTES. PHYSICAL BOUNDAARIES MAY
  53. * EXIST.
  54. * NOTE: CODED FILES (C6 AND C8) ARE CON-
  55. * VERTED TO A FILE STRUCTURE KNOWN
  56. * INTERNALLY BY FIP AS CN. CN
  57. * FILES ARE 8-BIT ASCII IN 12-BIT
  58. * BYTES USING UNIT SEPARATOR
  59. * CHARACTERS FOR END OF LINES. THE
  60. * CN FORMAT IS HOW ALL CODED FILES
  61. * ARE TRANSMITTED/RECEIVED BY FIP
  62. * TO/FROM THE NETWORK DRIVER (NDR).
  63. * CN MUST NOT BE SPECIFIED BY AN
  64. * APPLICATION.
  65. * TIMEOUT - TIME IN SECONDS TO WAIT FOR A FUNCTION
  66. * RESPONSE BEFORE TIMING OUT.
  67. * ABL - APPLICATION BLOCK LIMIT.
  68. *
  69. * FACIL - OPTIONS AVAILABLE DURING DATA TRANSFER.
  70. *
  71. * CWS - CHECKMARKING WINDOW SIZE
  72. *
  73. * ICKVAL - INITIAL CHECK MARK WINDOW.
  74. *
  75. * EXIT STATIS -2 = TERMINATING.
  76. * -1 = INITIATING.
  77. * 00 = IN PROCESS.
  78. * 01 = COMPLETE, NO ERROR.
  79. * 02 = UNDEFINED ERROR.
  80. * 03 = CONNECTION BROKEN DETECTED. (APPLICATION
  81. * IS EXPECTED TO SEND CON/END/R RESPONSE.)
  82. * 04 = PROTOCOL ERROR.
  83. * 05 = TIMED OUT WAITING FOR RESPONSE FROM
  84. * NETWORK.
  85. * 06 = OUTPUT BLOCK NOT DELIVERED AFTER THREE
  86. * RETRIES.
  87. * 07 = TOO MANY FILE TRANSFERS HAVE BEEN INITIATED.
  88. * 08 = ACN NOT WITHIN ALLOWABLE RANGE.
  89. * 09 = SECOND FILE TRANSFER ATTEMPTED ON ACN.
  90. * 10 = CIO ERROR DETECTED.
  91. * 11 = PREMATURE TERMINATION RECEIVED FROM
  92. * REMOTE APPLICATION.
  93. * 12 = CONTROL WORD FORMAT ERROR.
  94. * 13 = INVALID DEVICE TYPE.
  95. * 14 = EMPTY FILE.
  96. * 15 = BLOCK SEQUENCE NUMBERS ARE NON-CONSECUTIVE
  97. * AND NOT RECOVERABLE IN N RETRIES (DEFAULT 3)
  98. * 16 = BLOCK LEADER NOT RECOGNIZABLE OR PRU
  99. * BOUNDARY VIOLATION AND NOT RECOVERABLE IN
  100. * N RETRIES ( DEFAULT 3 ).
  101. * 17 = BINARY FILE TRANSFER ON PRU CONNECTION.
  102. *
  103. *
  104. * PROCESS
  105. * VALIDATE DATA DECLARATION.
  106. * VALIDATE CODE.
  107. * VALIDATE CONNECTION NUMBER.
  108. * IF NUMFILEXFR LQ 4
  109. * THEN
  110. * SWITCH CONNECTION TO LIST NUMBER 1.
  111. * INITIALIZE THE FTT AND OPEN FILE.
  112. * IF NOT WAIT
  113. * THEN (* COMPLETE THEN RETURN *)
  114. * LOOP UNTIL STATUS IS COMPLETE OR ERROR OCURRED
  115. * IF STATE[FTTINDEX] IS STATEX (* CIO NOTOCOMP *)
  116. * AND STORD[FTTINDEX] IS NOT FOR PRU
  117. * THEN
  118. * RECALL (NP$RCL).
  119. * REVALIDATE THE FILE.
  120. * ELSE
  121. * IF S BIT IS ON
  122. * GET THIS SM.
  123. * ELSE
  124. * CALL NETWAIT FOR CONTINUING FILE TRANSFER.
  125. * END OF LOOP
  126. *
  127. * ELSE (* RETURN TO APPLICATION *)
  128. * RETURN.
  129. *
  130. *
  131. * RETURN.
  132. *
  133. * NOTE - AN OVERLAY WHICH REFERENECES THIS MODULE MUST REMAIN
  134. * IN CM UNTIL ALL FILE TRANSFERS ARE COMPLETE.
  135. *
  136. #
  137. XREF
  138. BEGIN
  139. PROC NP$STPR ; # STATE TABLE PROCESSOR #
  140. PROC NP$GET; # GET SUPERVISORY MESSAGE #
  141. PROC NP$GJO ; # GET ORIGIN OF JOB #
  142. *IF DEF,STAT,1
  143. PROC NP$SN ; # STATISTIC PROCESSOR #
  144. PROC NP$PUT; # NETPUT SWH/LST/R MESSAGE #
  145. PROC NETWTQ; # TRANSFER FILE THR. QUICK NETWAIT#
  146. PROC NP$ERR ;
  147. PROC NP$MSG; # SEND MESSAGE TO DAYFILE #
  148. PROC NP$RCL ; # TO DO RECALL #
  149. PROC NP$RTIM ;
  150. PROC NP$S63 ;
  151. PROC NP$VALF ;
  152. PROC NP$XFR ;
  153. PROC NP$INIT;
  154. FUNC NP$CS63 B;
  155. FUNC NP$CDD C(10) ; # CONVERT INTEGER TO DISPLAY CODE #
  156. END
  157. LABEL RETURNX ;
  158. LABEL SENDMSG ;
  159. ITEM ACN I; # APPLICATION CONNECTION NUMBER #
  160. ITEM FILENAME C(7); # FILE NAME #
  161. ITEM CODE I; # OPERATION CODE #
  162. ITEM STATIS I; # CALLER-S STATUS WORD #
  163. ITEM NOWAIT B; # RETURN ASAP FLAG #
  164. ITEM DATADEC I; # DATA DECLARATION #
  165. ITEM TIMEOUT I; # TIME TO WAIT FOR RESPONSE #
  166. ITEM ABL I; # APPLICATION BLOCK LIMIT #
  167. ITEM FACIL C(10) ;
  168. ITEM BSIZE U; # BLOCK SIZE FOR TRANSMITTING #
  169. ITEM CWS U; # CHECK MARK WINDOW SIZE #
  170. ITEM ICKVAL U; # INITIAL CHECKMARK VALUE #
  171. ITEM I ;
  172. ITEM SCRATCH ;
  173. ITEM LOOPI; # LOOP INDEX #
  174. ITEM FACODE; # FACILITY CODE #
  175. ITEM INDEX I ; # LOCAL INDEX OF THE FTT ENTRY #
  176.  
  177. CONTROL EJECT;
  178. *IF DEF,STAT,1
  179. NP$SN(TYPE"XFR"); # KEEP STATISTIC COUNT #
  180. #
  181. * IF THIS IS THE FIRST TIME APPLICATION CALL NETXFR ( TIME$UP
  182. * IS ZERO ), THEN CHECK FOR THE CHARACTER SET OF APPLICATION.
  183. * FUNCTION NP$CS63 IS BOOLEAN FUNCTION, VALUE IS SET AT ASSEMBLY
  184. * TIME. IF CHARACTER SET 63 IS USED FOR APPLICATION, NP$CS63 IS
  185. * TRUE.
  186. #
  187.  
  188. IF TIME$UP EQ 0
  189. THEN
  190. BEGIN # FIRST TIME XFR INITIATED #
  191. NP$RTIM(TIME$WORD) ; # TAKE CURRENT TIME #
  192. TIME$UP = TIME$SEC[0] ;
  193. IF NP$CS63
  194. THEN
  195. NP$S63 ; # RESET THE CHARACTER SET FOR TRANSLATION #
  196. END # FIRST TIME XFR INITIATED #
  197.  
  198. P<STATUSWORD> = LOC (STATIS);
  199. NET$AWL$XFR = 0 ; # CLEAR THE FLAG #
  200.  
  201. NP$XFR ; # SEND XFR WORKLIST FOR VALIDA#
  202.  
  203. IF NET$AWL$XFR EQ 0
  204. THEN
  205. BEGIN # APPL. IS NOT VALIDATED TO CALL #
  206. STATUSWD = XFRNOTALLOW ; # NETXFR #
  207. GOTO SENDMSG ;
  208. END
  209. IF IDLEDOWN
  210. THEN
  211. BEGIN # GRADUALLY IDLE-DOWN #
  212. STATUSWD = DISABLE ; # ALLOW NO MORE TRANSFERRING #
  213. GOTO SENDMSG ;
  214. END # RETURN TO APPLICATION #
  215.  
  216. STATUSWD = INITIAT ; # ASSUMING EVERYTHING IS O.K. #
  217.  
  218. IF DATADEC LS MINDD OR
  219. DATADEC GR MAXDD
  220. THEN
  221. BEGIN # INVALID DATA DECLARATION #
  222. NP$ERR("46") ; # WRITE DAYFILE MSG, ABORT THE C.P. #
  223. END
  224.  
  225. IF CODE LS RECEIVE OR
  226. CODE GR SEND
  227. THEN
  228. BEGIN # INVALID CODE #
  229. NP$ERR("47") ; # WRITE DAYFILE MSG, ABORT THE C.P. #
  230. END
  231. NP$GJO(I) ; # GET THE ORIGIN OF JOB #
  232. IF I EQ JOT$TXOT # INTERACTIVE JOB TYPE #
  233. AND FILENAME EQ "INPUT" # FILE NAME IS INPUT #
  234. THEN
  235. BEGIN # JOB TYPE AND FILE NAME CAN NOT #
  236. STATUSWD = ILL$JOT ; # BE TRANSFERRED #
  237. GOTO RETURNX ;
  238. END
  239.  
  240. IF ACN LS MINIACN
  241. OR ACN GR MAXIACN
  242. THEN
  243. BEGIN # ACN OUT OF RANGE #
  244. STATUSWD = ACN$NWR ; # REYURN STATUS BACK TO APPL. #
  245. GOTO RETURNX;
  246. END
  247. IF ABL LQ 0
  248. OR ABL GR ABLLIMIT
  249. THEN
  250. BEGIN # ABL NOT IN THE RANGE #
  251. STATUSWD = ABL$ERR ;
  252. GOTO RETURNX;
  253. END
  254.  
  255. P<FACILTEST> = LOC(FACIL); # PULL TEMPLATE TO FACIL WORD #
  256. FACODE = B<0,6>FACILITY; # GET FIRST FACILITY CODE #
  257. FOR LOOPI = 6 STEP 6 WHILE ((FACODE NQ BLANK) AND (FACODE NQ 0))
  258. DO
  259. BEGIN
  260. IF FACODE NQ SFACIL AND # NOT -S- FACILITY #
  261. FACODE NQ RFACIL AND # NOT -R- FACILITY #
  262. FACODE NQ MFACIL # NOT -M- FACILITY #
  263. THEN
  264. BEGIN
  265. STATUSWD = BAD$FAC; # BAD FACILITY CODE USED #
  266. FACILWD[0] = 0; # CLEAR BIT MASK #
  267. GOTO RETURNX; # EXIT #
  268. END
  269. ELSE
  270. BEGIN
  271. B<FACODE,1>FACILWD[0] = 1; # SET FLAG FOR FACILITY CODE #
  272. FACODE = B<LOOPI,6>FACILITY; # EXTRACT NEXT FACILITY CODE #
  273. END
  274. END
  275. IF DATADEC GQ C6
  276. THEN
  277. BEGIN
  278. IF BSIZE LQ 0
  279. OR BSIZE GR IVT$MAX$BSZ
  280. THEN
  281. BEGIN # ERROR IN BLOCK SIZE #
  282. STATUSWD = BSXALOW ; # BLOCKSIZE NOT IN RANGE #
  283. GOTO RETURNX;
  284. END # ERROR IN BLOCK SIZE #
  285. END # IVT MODE #
  286. ELSE
  287. BEGIN # PRU MODE #
  288. IF BSIZE NQ ONE$PRU
  289. AND BSIZE NQ TWO$PRU
  290. AND BSIZE NQ THREE$PRU
  291. THEN
  292. BEGIN # BSIZE IS NOT 1,2 OR 3 PRU #
  293. STATUSWD = BSXALOW ;
  294. GOTO RETURNX;
  295. END
  296. END # PRU MODE #
  297.  
  298. IF CWS LS 1 OR CWS GR MXCWS # IF CWS OUT OF RANGE #
  299. THEN
  300. BEGIN
  301. STATUSWD = ILL$CWSZ;
  302. GOTO RETURNX;
  303. END
  304.  
  305. IF ICKVAL LS 0 OR ICKVAL GR MXICKVAL # IF ICKVAL OUT OF RANGE #
  306. THEN
  307. BEGIN
  308. STATUSWD = ILL$ICKZ;
  309. GOTO RETURNX;
  310. END
  311.  
  312. IF NUMFILEXFR LS MAXFILEXFR
  313. THEN
  314. BEGIN # INITIATE A FILE TRANSFER #
  315. NUMFILEXFR = NUMFILEXFR + 1 ;
  316. LASTXFRACN = ACN ;
  317.  
  318. #
  319. * INITIATE THE FILE TRANSFER.
  320. #
  321.  
  322. IDFM$LFN[INITIAT] = FILENAME ;
  323. NP$MSG(IDFM$MSG[INITIAT],XFRDTYPE);
  324. NP$INIT(ACN,FILENAME,CODE,STATUSWORD,DATADEC,TIMEOUT,ABL,
  325. BSIZE,CWS,ICKVAL) ;
  326.  
  327. INDEX = FTTINDEX ; # LOCAL INDEX FOR THIS FTT ENTRY #
  328. IF STATUSWD NQ INITIAT
  329. THEN
  330. GOTO RETURNX; # ERROR FOUND DURING INITIALIZATION #
  331. #
  332. * SWITCH THIS CONNECTION ONTO LIST 1.
  333. #
  334.  
  335. LST$ACN[0] = ACN;
  336. LST$NLIST[0] = XFR$LIST ;
  337. OUT$ABHTLC[0] = 1 ;
  338. LOC$HA = LOC(OUT$ABH) ;
  339. LOC$TA = LOC(LST$SWH) ;
  340. OPCODE = OP$PUT ;
  341. *IF DEF,STAT,1
  342. IAM = TYPE"PUT" ;
  343. NP$PUT ; # NETPUT LST/SHW TO SWITCH TO LIST 1 #
  344. #
  345.   SWITCHING ICT OF THIS CONN. TO CHARACTER TYPE 2.
  346. #
  347. DC$ACN[0] = ACN ;
  348. DC$ACT[0] = CT8ASCII ;
  349. LOC$HA = LOC(OUT$ABH) ;
  350. LOC$TA = LOC(DC$CICT) ;
  351. NP$PUT ;
  352.  
  353. #
  354.   CALL STATE TABLE PROCESSOR FOR APPROPRIATE INITIAL ACTION
  355.   ( EFFECTED PRU MODE ONLY )
  356. #
  357. NP$STPR(FTTINDEX,NSPTOCM,0) ;
  358.  
  359. IF NOT NOWAIT
  360. THEN
  361. BEGIN # COMPLETE THIS FILE TRANSFER AND CONTINUE ALL OTHERS #
  362. FOR I = I WHILE STATIS LQ IN$PROG
  363. DO
  364. BEGIN
  365. FTTINDEX = INDEX ; # RESET THE LOCAL INDEX OF FTT #
  366. IF FTTSTATE[FTTINDEX] EQ STATX
  367. THEN
  368.  
  369. BEGIN # CIO OUTSTANDING #
  370. NP$RCL(CIOCALL);
  371. NP$VALF ; # RE-VALIDATE THE FILE #
  372. END # CIO OUTSTANDING #
  373. ELSE
  374. BEGIN # OK, PROCEED XFR #
  375. IF (SD$FLAG NQ 0) OR # SUP MSGS QUEUED IN NIP #
  376. (HEAD NQ FOOT) # SUP MSGS QUEUED IN AIP #
  377. THEN
  378. BEGIN # GET SUPERVISORY MESSAGE #
  379. ACLN = 0 ; # ACN = 0 #
  380. LOC$HA = LOC(DATA$WORD[0]);# HEADER LOCATION #
  381. LOC$TA = LOC(DATA$WORD[1]);# TEXT LOCATION #
  382. TLMX = MXIVT$SIZE ; # TEXT LENGTH #
  383. OPCODE = OP$GET ; # OPCODE IS GET #
  384. NWL[NEXT] = 0 ; # CLEAR THE NWL OPCODE #
  385. NWL$TA[NEXT] = LOC$TA ;
  386. BS = OPABHSIZ ;
  387.  
  388. NP$GET ;
  389.  
  390. END # GET SUPERVISORY MESSAGE #
  391. IF XFR$COM # IF FILE XFR COMPLETED #
  392. THEN
  393. BEGIN
  394. XFR$COM = FALSE; # RESET FLAG TO FASLE #
  395. END
  396. ELSE
  397. BEGIN
  398. NETWTQ(TIMEOUT,0); # QUICK NETWAIT OTHERWISE #
  399. END
  400. END
  401. END
  402.  
  403. END
  404.  
  405. ELSE
  406. BEGIN # RETURN CONTROL TO APPLICATION #
  407. STATUSWD = IN$PROG ;
  408. GOTO RETURNX ;
  409. END # CONTINUE FILE TRANSFER LATER #
  410. END
  411.  
  412. ELSE
  413. BEGIN
  414. STATUSWD = GTMAXFR ;
  415.  
  416. RETURNX:
  417. IDFM$LFN[STATUSWD] = FILENAME ;
  418. SENDMSG:
  419. NP$MSG(IDFM$MSG[STATUSWD],XFRDTYPE); # DAYFILE MESSAGE #
  420. END
  421.  
  422. RETURN;
  423.  
  424.  
  425. END # NETXFR #
  426.  
  427. TERM
  428. *ENDIF
cdc/nos2.source/nam5871/netxfr.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator