mirror of
https://github.com/PDP-10/its.git
synced 2026-01-13 15:27:28 +00:00
115 lines
4.0 KiB
Plaintext
115 lines
4.0 KiB
Plaintext
'<PCODE "NETFTP">
|
||
|
||
<PACKAGE "NETFTP">
|
||
|
||
<ENTRY CONNECT ACC ICP WAITRESP LAST-RESP SOAK UNSOAK>
|
||
|
||
<USE "CLOCK">
|
||
|
||
"SOAK and UNSOAK -- enable and disable scripting of ftp transactions"
|
||
|
||
<SETG SOAK %<RSUBR!- '[ %<PCODE!- "NETFTP" 0> SOAK #DECL ("VALUE" <OR ATOM
|
||
FALSE>) ALARM-OFF ALARM T %<RGLOC SOAK? T> (300) "USER " (230 200 330) "PASS " (
|
||
230 200 331) "ACCT " (230 200) "TYPE " (200) "BYTE " "MODE " CHANNEL-CLOSED
|
||
RESPONSE-LINE OUTCHAN "FTP: " %<TYPE-W CINT VECTOR> "0123456789" %<RGLOC
|
||
LAST-RESP T> WAIT-ACT (ACTIVATION) "CHAR" SL "NET" "PRINT" "SOCK " %<RGLOC WATCH
|
||
T> #FALSE ("Datachannel timed-out") %<RGLOC SOC T> "READB" #FALSE (
|
||
"BAD ICP STATE") #FALSE ("Read of socket number failed") "READ" #FALSE (
|
||
"No Network Channels Available") ICP-WAIT %<RGLOC ICP-NETINT T> #FALSE (
|
||
"ICP timed out")]>>
|
||
<AND <ASSIGNED? GLUE> .GLUE <PUT ,SOAK PGLUE ![738197503 -1 -4194304!]>>
|
||
|
||
|
||
<SETG UNSOAK %<RSUBR-ENTRY '[SOAK UNSOAK #DECL ("VALUE" <OR ATOM FALSE>)] 12>>
|
||
|
||
<SETG SOAK? T>
|
||
|
||
<GDECL (SOAK?) <OR 'T FALSE>>
|
||
|
||
"CONNECT -- connect to ftp server at a specified host
|
||
arg1 -- host (fix)
|
||
arg2 -- access instructions, or false. if true, must be list
|
||
of items, as follows:
|
||
1/ string, arg for user command
|
||
2/ string, to be used as arg to password command, if empty
|
||
or false, none will be issued
|
||
3/ string, to be used as arg to account command
|
||
arg3 -- type of transfer (string) false--none
|
||
arg4 -- byte size (fix) false--none
|
||
arg5 -- mode of transfer (string) false--none
|
||
|
||
-- returns list of input and output channels, or #false(reason.string)"
|
||
|
||
<SETG CONNECT %<RSUBR-ENTRY '[SOAK CONNECT #DECL ("VALUE" <OR FALSE <LIST
|
||
CHANNEL CHANNEL>> FIX <LIST [3 STRING]> <OR STRING FALSE> <OR FIX FALSE> <OR
|
||
STRING FALSE>)] 24>>
|
||
|
||
"GETLINE -- get a response from ftp connection, including continuation lines"
|
||
|
||
<SETG GETLINE %<RSUBR-ENTRY '[SOAK GETLINE #DECL ("VALUE" STRING CHANNEL)] 250>>
|
||
|
||
<SETG RESPONSE-LINE %<RSUBR-ENTRY '[SOAK RESPONSE-LINE #DECL ("VALUE" STRING
|
||
CHANNEL)] 333>>
|
||
|
||
"NETCHR -- kludge to handle new telnet protocol without
|
||
lossage waiting for response... returns a character, like
|
||
readchr, but if sees rubout or 377, reads next char and throws
|
||
it away."
|
||
|
||
<SETG NETCHR %<RSUBR-ENTRY '[SOAK NETCHR #DECL ("VALUE" <OR CHARACTER FALSE>
|
||
CHANNEL)] 417>>
|
||
|
||
"WAITRESP -- given a channel, read until one of a supplied set of response
|
||
codes is received
|
||
--returns code received (fix), or #false(reason)
|
||
-- arg1/ channel
|
||
-- arg2/ list of fixes, codes to watch for. in all cases,
|
||
responses beginning with 0 as a code are ignored"
|
||
|
||
<SETG WAITRESP %<RSUBR-ENTRY '[SOAK WAITRESP #DECL ("VALUE" <OR FALSE FIX>
|
||
CHANNEL LIST)] 447>>
|
||
|
||
"WATCH -- error/interrupt handler for net channels
|
||
-- returns from an activation (sl) if we are in it (sleeping)
|
||
"
|
||
|
||
<SETG WATCH %<RSUBR-ENTRY '[SOAK WATCH #DECL ("VALUE" ANY <UVECTOR FIX FIX FIX>
|
||
CHANNEL)] 625>>
|
||
|
||
"ACC -- function to issue a ftp command to transfer data
|
||
-- opens another socket in direction indicated, and issues a 'sock xxx'
|
||
command over ftp telnet channels. waits for channel connection to
|
||
be established, and returns the channel. if trouble, returns
|
||
#false(reason)
|
||
-- arg1/ telnet channel pair
|
||
arg2/ command line to issue after 'sock' command
|
||
arg3/ direction -- usually read or print
|
||
arg4/ byte size for channel opening"
|
||
|
||
<SETG ACC %<RSUBR-ENTRY '[SOAK ACC #DECL ("VALUE" ANY <LIST CHANNEL CHANNEL>
|
||
STRING STRING FIX)] 666>>
|
||
|
||
"ICP -- icp function, returns false or list of input and output channels
|
||
-- arg1/ host number
|
||
arg2/ socket to issue icp to
|
||
val/ list of input and output channel"
|
||
|
||
<SETG SOC <UVECTOR 0>>
|
||
|
||
<SETG ICP %<RSUBR-ENTRY '[SOAK ICP #DECL ("VALUE" <OR FALSE <LIST CHANNEL
|
||
CHANNEL>> FIX FIX "OPTIONAL" FIX)] 833>>
|
||
|
||
"WAIT-FOR-IT -- wait for interrupt that indicates channel ready"
|
||
|
||
<SETG WAIT-FOR-IT %<RSUBR-ENTRY '[SOAK WAIT-FOR-IT #DECL ("VALUE" <OR FALSE
|
||
UVECTOR> CHANNEL FIX)] 1059>>
|
||
|
||
\
|
||
|
||
"ICP-NETINT -- interrupt handler for icp channels"
|
||
|
||
<SETG ICP-NETINT %<RSUBR-ENTRY '[SOAK ICP-NETINT #DECL ("VALUE" <OR FALSE
|
||
UVECTOR> UVECTOR CHANNEL)] 1143>>
|
||
|
||
<ENDPACKAGE>
|