home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
459.lha
/
XPRGate_v1.0
/
XPRGate.Doc
< prev
next >
Wrap
Text File
|
1990-12-06
|
11KB
|
277 lines
XPRGate v1.0
------------
Copyright © 1990 by Timothy J. Aston.
All Rights Reserved.
******************************** IMPORTANT *********************************
XPRGate is freely distributable provided the following conditions are met:
1) No profit is realized from it
2) All files included with this distribution are distributed with it.
If you wish to include XPRGate with a commercial or shareware product,
please contact the author me to make arrangements.
I make no guarantees as to the performance of the included files. The user
takes all responsability for any damages or losses incurred do to the direct
or indirect use or misuse of these files.
I hereby give permission to Fred Fish to include the full contents of this
archive in his public domain software library.
****************************************************************************
* What is XPRGate?:
XPRGate is a programme used for transfering files over the modem using the
XPR standard for external file transfer libraries. It provides the frontend
and all the necessary I/O routines to use the XPR libraries. XPRGate is
intended primarily for use with TransAmiga BBS, but maybe of interest to
other people too.
* What are XPR Libraries?:
The XPR specification provides a standard for writing file transfer
protocols in Amiga shared libraries, which can then be used by any
communications programme supporting the specification. The communication
need have no protocol specific code, so new protocols can be easily added as
they become available without a need to upgrade the communications programme.
* Using XPRGate:
XPRGate must be run from the CLI, it cannot be run from the Workbench. The
command line arguments for it are:
XPRGate <device> <unit> <baud> <xpr library> <init string> <R|S> <files>
Where:
<device> is the serial device for XPRGate to use. Usually this will be
"serial.device" as long as you're using the internal Amiga serial port.
Users of Supra 2400ZI internal modems would use "modem0.device". Multi-port
serial cards will have their own serial device, so consult the manual if you
have one of these. It must be in lower-case.
<unit> is the unit number to use. If you're using the serial.device for
the internal serial port, the unit number is 0. For others, it depends,
consult your serial card's user manual.
<baud> is the baud rate at which to do the transfer. Valid rates range
from 110 to 19200 baud.
<xpr library> is the name of the XPR external file transfer library to use
for the transfer. This file must resided in your LIBS: directory. The
.library suffix must be entered, and it must be in all lower-case.
<init string> is the initialization string to send to the library. This
depends entirely on the XPR library being used. Each will have its own
paramaters that it accepts here, so consult the XPR's documentation for more
info.
<R|S> tells XPRGate whether you are [R]eceiving (downloading) or [S]ending
(uploading) a file.
<files> is a listing of up to 20 files to send or receive. This also
depends slightly on the individual protocol and whether it can handle batch
transfers or not.
XPRGate will create a file called t:Xfers.Temp. It will append the name of
any file received to this file, followed by a carriage return. This is so
that you can easily tell what files have been received during a batch
receive (using non-batch protocols it is quite useless to you).
Included in this archive are the xprxmodem.library and the
xprzmodem.library which you should put in your Libs: directory. I have not
included the docs, so to find out more about those libraries, get ahold of
the complete archives. There is also an xprascii.library, but that was
merely intended as a model for XPR programmers. I have heard there also
exists an xprkermit.library and an XPR for Compuserve's B+ protocol.
Since I do not have access to any system which uses either protocol, I
wouldn't be able to test them out even if I could get my hands on them.
* Examples of Using XPRGate:
To send the file df0:File.Lzh using Xmodem-CRC at 1200 baud, you would
enter the following:
XPRGate serial.device 0 1200 xprxmodem.library T0,C0,K0 s df0:File.Lzh
To do a Zmodem send of three files at 2400 baud, you might enter:
XPRGate serial.device 0 % xprzmodem.library T?,OY,B1,AN,DN,SN s
df0:File1.Lzh ram:File2.Lzh df1:File3.lzh [all one line]
To do a Zmodem batch receive to a floppy drive, you could use:
XPRGate serial.device 0 % xprzmodem.library r
T?,OY,B8,F8192,AN,DN,KN,SN,RN,Pdf1: r ram: [all one line]
The above Zmodem example is kind of special. First of all, the buffer size
is set to only 8k (B8) and it is set to require an ACK every time the
buffer needs to be written (that is, every 8k). This is because on floppy
drives, the time it takes to write the buffer to disk seems to cause
XPRGate to crash (there is no such problem with hard drives or RAM drives).
The second thing to note is that the receive filename (ram:) is actually
ignored by the xprzmodem.library, it uses the P parameter to set the path
recieved files should go in (in the above example, df1:).
* Using XPRGate With TransAmiga:
The primary reason for developping XPRGate was so that TransAmiga BBS (a
FidoNet capable BBS written by ME!) could use XPR protocol libraries for its
file transfers. TransAmiga runs external programmes to take care of file
transfers. In the beginning, I was hoping to rely on Rz and Sz for this, but
it quickly became evident that this would not do at all, so I started work on
XPRGate.
To setup TransAmiga to use XPRGate, start up TransConfig and select the
option to edit your file area settings. Using the currently available
xprzmodem.library and xprxmodem.library, you will be able to implement
Xmodem-Checksum, Xmodem-CRC, Xmodem-1k, and Zmodem batch. You can implement
as many of those as you like, but since all the Xmodem derivatives use the
same library, you might as well use them all since it will requires no extra
memory or disk space. So here are the send and receive commands that you
could use for each of these protocols:
Xmodem-Checkum
send command: XPRGate serial.device 0 % xprxmodem.library T0,C0,K0 s $
receive command: XPRGate serial.device 0 % xprxmodem.library T0,C0,K0 r $
Xmodem-CRC
send command: XPRGate serial.device 0 % xprxmodem.library T0,C1,K0 s $
receive command: XPRGate serial.device 0 % xprxmodem.library T0,C1,K0 r $
Xmodem-1k
send command: XPRGate serial.device 0 % xprxmodem.library T0,C1,K1 s $
receive command: XPRGate serial.device 0 % xprxmodem.library T0,C1,K1 r $
Zmodem *
send command: XPRGate serial.device 0 % xprzmodem.library
T?,OR,B1,AN,DN,SN s $ [all one line]
receive command: XPRGate serial.device 0 % xprzmodem.library r
T?,OR,B1,AN,DN,KN,SN,RN,P$ r ram: [all one line]
floppy receive: XPRGate serial.device 0 % xprzmodem.library r
T?,OR,B8,F8192,AN,DN,KN,SN,RN,P$ r ram: [all one line]
Note the asterisk after Zmodem to indicate to TransAmiga that it is a batch
protocol, and that the Zmodem commands should not be split over two lines.
These are just suggestions, consult the documentation for each library to
find more out about their options.
* Compatability:
XPRGate does not currently support all of the call-back routines as defined
in the XPR 2.0 spec. The call-backs that are implemented are:
xpr_fopen()
xpr_fclose()
xpr_fread()
xpr_fwrite()
xpr_sflush()
xpr_sread()
xpr_swrite()
xpr_update()
xpr_chkabort()
xpr_chkmisc() [1]
xpr_gets() [2]
xpr_ffirst()
xpr_fnext()
xpr_finfo()
xpr_fseek()
xpr_unlink()
xpr_squery()
[1] In XPRGate, xpr_chkmisc() doesn't actually do anything.
[2] xpr_gets() returns 0 always. This shouldn't normally be called since
XPRgate will always supply an init string. The function had to be
included because most XPRs won't work al all without it being
present.
The call-backs not supported by XPRGate are:
xpr_setserial()
xpr_options()
xpr_getptr()
XPRGate provides all the necessary call-backs to make sufficient use the
xprxmodem.library and xprzmodem.library. As protocols become developped that
require some of the non-implemented call-backs, I will try to add them to
XPRGate so it can use all available XPR protocols.
* Acknowledgements:
I can't take all that much credit for XPRGate, because a good part of it
uses source that other people wrote. I just adjusted it a bit and glued all
the parts together. Specifically, I used:
- xprfuncs.c and vltface.asm by Willie Langeveld as distributed with the
XPR 2.0 spec.
- protsupp.c by Kenneth Osterberg as distributed with the source to his
Amiga Jmodem implementation.
I'd also like to thank:
- Rick Huebner for his XPR Zmodem implementation and Marc Boucher for
his XPR Xmodem implementation.
Keep 'em coming!
* An Editorial About XPRs:
If you are writing any kind of telecommunications programme that is to do
file transfers, I strongly reccommend that you look into implementing
support for the XPR libraries. The specification is very powerful and
flexible, and is also very easy to implement. The benefits of using
external protocols are obvious, it cuts down on code size, allows the user
to only keep around the protocols he/she wants to use, and allows new
protocols to be instantaneously added as they become available. Looking at
the various alternatives, I think that Amiga shared libraries is the best
way to do this. It's very clean, requires minimal memory, and yields the
greatest flexibility.
Source is readily available for various XPRs, to help you out with your
protocol. You've got a full range, from the simple ASCII protocol, to the
more advanced Xmodem, all the way up to state-of-the-art Zmodem.
Remember, there are still many file transfer protocols that have not yet
been implemented as XPRs. I'd like to see a Ymodem XPR, and Jmodem XPR,
and perhaps even a bi-directional XPR (so Amiga could users could FINALLY
have a standard bi-directional protocol). The potential of XPRs is
tremendous.
If you have written an XPR library, I would greatly appreciate it if you
would let me know, and preferably send me a copy of it on disk. If your
library requires any of the call-backs that XPRGate does not yet support, I
will certainly look into adding them.
* Contacting Me:
If you have any questions, suggestions, or whatever, I can be reached as
Tim Aston, 1:247/102.4 @ FidoNet, and:
Tim Aston
128 Riverview Blvd.
St. Catharines, Ont.
CANADA
L2T 3M2
I also frequent several FidoNet echoes such AMIGA, AMIGA_PROG, AMY_POINT and
AMIGA_NET_DEV. I'm always good for a chat.
-Tim