Submitted-by: michaeli@stout.atd.ucar.edu Archive-name: xmodem/part01 #!/bin/sh # This is xmodem, a shell archive (produced by shar 3.52.3) # To extract the files from this archive, save it to a file, remove # everything above the "!/bin/sh" line above, and type "sh file_name". # # made 08/22/1994 17:03 UTC by michaeli@stout.atd.ucar.edu # Source directory /thor/dt/tmp # # existing files will NOT be overwritten unless -c is specified # # This is part 1 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 22100 -rw-r--r-- xmodem/README # 14880 -rw-r--r-- xmodem/update.doc # 1680 -rw-r--r-- xmodem/Makefile # 11512 -rw-r--r-- xmodem/xmodem.1 # 4750 -rw-r--r-- xmodem/xmodem.h # 50 -rw-r--r-- xmodem/version.h # 9660 -rw-r--r-- xmodem/xmodem.c # 11162 -rw-r--r-- xmodem/getput.c # 18033 -rw-r--r-- xmodem/receive.c # 4810 -rw-r--r-- xmodem/misc.c # 5027 -rw-r--r-- xmodem/batch.c # 12532 -rw-r--r-- xmodem/send.c # 67550 -rw-r--r-- xmodem/ymodem.doc # 2924 -rw-r--r-- xmodem/README.vxWorks # 4328 -rw-r--r-- xmodem/rtcTime.fixme.c # touch -am 1231235999 $$.touch >/dev/null 2>&1 if test ! -f 1231235999 && test -f $$.touch; then shar_touch=touch else shar_touch=: echo 'WARNING: not restoring timestamps' fi rm -f 1231235999 $$.touch # if test -r _sharseq.tmp; then echo 'Must unpack archives in sequence!' echo Please unpack part `cat _sharseq.tmp` next exit 1 fi # ============= xmodem/README ============== if test ! -d 'xmodem'; then echo 'x - creating directory xmodem' mkdir 'xmodem' fi if test -f 'xmodem/README' && test X"$1" != X"-c"; then echo 'x - skipping xmodem/README (File already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting xmodem/README (Text)' sed 's/^X//' << 'SHAR_EOF' > 'xmodem/README' && This is version 3.10.vxW.02 (circa 4/94) This version has been ported to vxWorks 5.1.1. To get more info on compiling and running this on your board, see the README.vxWorks file. X -------------------------------------------------------------------------------- This is version 3.10. X -------------------------------------------------------------------------------- X This is version 3.9 (circa 11/90) of the xmodem program which incorporates a few bugfixes (one important!) and some enhancements: 1) status messages when running xmodem through Sun's tip program ("p" flag); 2) delayed startup (via the "w" flag); 3) ability to turn off EOT verification (via "e" flag); 4) ability to allow CAN-CAN abort in the midst of a file transfer (via "n" flag); 5) some help for MODEM-7 transfers (via the "cm" flag combination and 6) YMODEM-G support (via the "g" flag). See update.doc for details. X -------------------------------------------------------------------------------- X This is version 3.8 (circa 11/88) of the xmodem program which incorporates minor enhancements over version 3.7 which incoporates minor enhancements over version 3.6. See update.doc. X -------------------------------------------------------------------------------- X This is version 3.6 (finished 4/88) of the xmodem program which includes a few bugfixes and some enhancements (requested by Macintosh users) stimulated by the xmodem release through comp.sources.unix. See the file update.doc for details. X -------------------------------------------------------------------------------- X This is version 3.4 (finished 10/87) of the xmodem program, a full-featured XXMODEM implementation for 4.3BSD. Since the previous release (version 3.2, see volume 7 of the archives), substantial improvements have been made. See the file update.doc for details. Also, some attempt has been made to support SysV Unix systems; see below. X As far as I am concerned, this program has reached the end of its evolution. Newer protocols (such as ZMODEM) will not be incorporated into xmodem. Check out Chuck Forsberg's rz/sz programs if you are interested in ZMODEM. X -------------------------------------------------------------------------------- X The xmodem program implements the Christensen (XMODEM) file transfer protocol for moving files between 4.2/4.3BSD Unix systems and microcomputers. The XMODEM/CRC protocol, the MODEM7 batch protocol, the XMODEM-1K block protocol and the YMODEM batch protocol are all supported by xmodem. For details of the protocols, see the document edited by Chuck Forsberg titled XXMODEM/YMODEM Protocol Reference (the latest version is dated 6-18-88). X This program runs on 4.2/4.3BSD systems ONLY. It has been tested on VAXes and Suns against the MEX-PC program from Niteowl Software and the ZCOMM and DSZ programs from Omen Technology. X I have tried to keep the 4.2isms (select system call, 4.2BSD/v7 tty structures, gettimeofday system call, etc.) confined to the source file getput.c; but I make no guarantees. Also, I have made no attempt to keep variable names under 7 characters. A version of getput.c that MAY work on Sys V Unix systems is included. X -------------------------------------------------------------------------------- X Thanks to Emmet Gray (ihnp4!uiucuxc!fthood!egray) and John Rupley (arizona!rupley!root) for the following notes about converting xmodem to Sys V. Since I don't have a Sys V system to test a Sys V version, I won't even try. X 1) Change the includes in xmodem.h from to X and from to X 2) Convert the occurrences of rindex to strrchr in batch.c X 3) Substitute getput.sysv.c for getput.c X A further "gotcha" regarding Sys V is contained in the following message : X XFrom: Bill Stubblebine Date: Sat, 25 Jun 88 13:36:20 mdt To: grandi@noao.arizona.edu Subject: xmodem3.6 bug, fix and THANKS!! X X 1:30 PM MDT X June 25, 1988 X First, thanks for posting a really useful program, xmodem 3.6. X I installed the xmodem program on an HP 9000 Series 350 workstation, running HP-UX version 6.01 (AT&T System V compatible) to talk to my CP/M system at home. MODEM7 batch is particularly useful. X I'd like to report a bug I found and the fix I developed in the source file getput.sysv.c so that you can include it in future releases. X I've reproduced the relevant portion of getput.sysv.c, modified to fix the bug, at the end of this file. See the routine getspeed() starting at line 382. Getspeed() derives the serial port speed from the c_cflag ioctl parameter, for use in estimating transmission times. X I suspected something was wrong when xmodem kept reporting 1200 baud modem connections as 1800 baud in the log file, but the transfers still worked OK at 1200 baud. However, I also have a Courier HST 9600 baud modem at home, and when I tried 9600 baud xmodem transfers, xmodem would core dump on the UNIX host. X On line 386 of getput.sysv.c, in the procedure getspeed(), an array is declared containing numerical constants representing the various baud rates supported by the host terminal interface. The appropriate baud rate constant is selected by the statements in lines 392-394, which mask the c_cflag baud rate bitfield to index into the speedtbl[] array. X There are two problems here. The first problem is that speedtbl[] is missing some valid baud rate entries, as the modified declaration shows. I got the entries for the modified declaration from the termio(7) manpage in my System V user's manual. The missing entries throw off the indexing arithmetic. Notice, for example, that the missing entry 900 was responsible for mapping the c_cflag bits for 1200 baud to the 1800 baud constant. X Original declaration: X static int speedtbl[] = {0, 50, 75, 110, 134, 150, 200, 300, 600, X 1200, 1800, 2400, 4800, 9600, 19200, 0}; X Modified declaration: X static int speedtbl[] = {0, 50, 75, 110, 134, 150, 200, 300, 600, X 900, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200, 38400, 0}; X ^^^ ^^^^ ^^^^ ^^^^^ ^^^^^ X The second problem didn't show up until I used 9600 baud. The c_cflag bitfield value for 9600 baud is 16 decimal (020 octal). The masking constant in lines 392-394 was originally 017 octal, which masked the 9600 baud bitfield to 0, indexing to the speedtbl[] value of 0. Speed calculations using a baudrate of 0 caused floating point exceptions leading to the host core dumps at 9600 baud. X I changed the mask value from 017 octal to 037 octal (which is actually the size of the c_cflag baudrate field), and changed the limit test in line 392 from 14 to 18, the new correct number of elements in the speedtbl[] array. X I'm not familiar with 4.2BSD, but I noticed that getput.c, the 4.2BSD version of the I/O routines, contains virtually the same code for determining the baudrate as that in getput.sysv.c. It may be OK for 4.2BSD, but definitely not for System V. X The modified code now works great at all baud rates! Thanks again for posting the program. X X Bill Stubblebine X Hewlett-Packard Logic Systems Div. X 8245 N. Union Blvd. X Colorado Springs, Co. 80918 X ARPA: was%hp-lsd@hplabs.hp.com X UUCP: {hplabs,hpfcla}!{hpldola,hp-lsd}!was X -------------------------------------------------------------------------------- X A common request to me concerns running xmodem through tip in order to do XXMODEM or YMODEM transfers. I have discovered that SunOS has a nice feature in tip (accessed through ~C) that connects a named program to a remote machine. It turns out that 4.3BSD tip has a similar (but undocumented) feature, but far less convenient: SunOS tip connects file descriptor 0 of the program to the remote line input and file descriptor 1 to remote line output while 4.3BSD connects up file descriptors 3 and 4! X If you would like to use xmodem through 4.3BSD tip, the following message should be of interest (note that the patches given below are against an old version of the source): X To: grandi@noao.edu (Steve Grandi CCS) Subject: Re: xmodem Date: Tue, 02 Jan 90 12:34:58 -0500 XFrom: Benson I. Margulies X X X Yes, I would like to receive the changes! X X Steve, grandi@noao.edu X OK, here are the diffs. I've tested them in receive mode, but I haven't been able to verify that they work for sending. The reason why is a long sob story. X It would be good to do two additional things: X 1) add some \r's to the messages printed. 2) when in tip mode, print more messages on stdout to report progress, like a . every 100 blocks. X RCS file: RCS/xmodem.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** /tmp/,RCSt1a02154 Tue Jan 2 12:33:12 1990 --- /tmp/,RCSt2a02154 Tue Jan 2 12:33:12 1990 *************** *** 52,57 **** --- 52,60 ---- X MDM7BAT = FALSE; /* no MODEM7 batch mode */ X YMDMBAT = FALSE; /* no YMODEM batch mode */ X TOOBUSY = FALSE; /* not too busy for sleeping in packet read */ + INFD = 0; + OUTFD = 1; + FDS_DISTINCT = 0; X X fprintf(stderr, "XMODEM Version %d.%d", VERSION/10, VERSION%10); X fprintf(stderr, " -- UNIX-Microcomputer Remote File Transfer Facility\n"); *************** *** 101,106 **** --- 104,115 ---- X case 's' : SENDFLAG = TRUE; /* send file */ X XMITTYPE = gettype(argv[1][index++]); X break; + case 'p': /* TIP */ + case 'P': + INFD = 3; + OUTFD = 4; + FDS_DISTINCT = TRUE; + break; X default : fprintf(stderr, "Invalid Flag %c ignored\n", flag); X break; X } *************** *** 120,133 **** X LOGFP = fopen(fname, "w"); /* new LOG file */ X if (!LOGFP) X error("Fatal - Can't Open Log File", FALSE); X X fprintf(LOGFP,"\n++++++++ %s", stamptime()); X fprintf(LOGFP,"XMODEM Version %d.%d\n", VERSION/10, VERSION%10); X fprintf(LOGFP,"Command line: %s %s", argv[0], argv[1]); ! for (index=2; index X X /* X * *************** *** 103,113 **** X /* get a byte from data stream -- timeout if "seconds" elapses */ X /* This routine is VERY 4.2 specific */ X X int X readbyte(seconds) X int seconds; X { - int readfd; X char c; X struct timeval tmout; X --- 104,122 ---- X /* get a byte from data stream -- timeout if "seconds" elapses */ X /* This routine is VERY 4.2 specific */ X + int select_input (tmout) + struct timeval * tmout; + { + fd_set readfd; /* mask for select call */ + FD_ZERO(&readfd); + FD_SET(INFD, &readfd); + return select(getdtablesize(), &readfd, (int *)0, (int *)0, tmout); + } + X int X readbyte(seconds) X int seconds; X { X char c; X struct timeval tmout; X *************** *** 114,125 **** X tmout.tv_sec = seconds; X tmout.tv_usec = 0; X - readfd = 1<<0; X ! if ((select(1, &readfd, (int *)0, (int *)0, &tmout)) == 0) ! return(TIMEOUT); X ! read(0, &c, 1); X X if (DEBUG) X fprintf(LOGFP, "DEBUG: readbyte %02xh\n", c & 0xff); --- 123,133 ---- X tmout.tv_sec = seconds; X tmout.tv_usec = 0; X X ! if (select_input(&tmout) == 0) ! return(TIMEOUT); X ! read(INFD, &c, 1); X X if (DEBUG) X fprintf(LOGFP, "DEBUG: readbyte %02xh\n", c & 0xff); *************** *** 138,151 **** X /* set up a usec timeout on stdin */ X tmout.tv_sec = 0; X tmout.tv_usec = 1; ! readfd = 1<<0; X X /* any characters pending?; return if none */ ! if ((select(1, &readfd, (int *)0, (int *)0, &tmout)) == 0) ! return; X X /* read the characters to flush them (assume there are fewer than BBUFSIZ */ ! (void) read(0, inbuf, BBUFSIZ); X } --- 146,159 ---- X /* set up a usec timeout on stdin */ X tmout.tv_sec = 0; X tmout.tv_usec = 1; ! readfd = 1<= 0 && ttys.sg_ispeed <= 14) --- 427,433 ---- X { X static int speedtbl[] = {0, 50, 75, 110, 134, 150, 200, 300, 600, X 1200, 1800, 2400, 4800, 9600, 19200, 0}; ! if (ioctl(INFD,TIOCGETP,&ttys) < 0) /* get tty structure */ X error("Can't get TTY parameters", FALSE); X X if (ttys.sg_ispeed >= 0 && ttys.sg_ispeed <= 14) X -------------------------------------------------------------------------------- X xmodem Program history: X Descended from UMODEM 3.5 by Lauren Weinstein, Richard Conn, and others. X Based on XMODEM Version 1.0 by Brian Kantor, UCSD (3/84) (Don't blame him X in any way for what follows....) X Version 2.0 (CRC-16 and Modem7 batch file transfer) (5/85) (Thanks to D'Anne X Thompson for the batch transfer code). X Version 2.1 (1K packets) (7/85) X Version 2.2 (general clean-ups and multi-character read speed-ups) (9/85) X Version 2.3 (nap while reading packets; split into several source files) (1/86) X Version 3.0 (Ymodem batch receive; associated changes) (2/86) X Version 3.1 (Ymodem batch send; associated changes) (8/86) X Version 3.2 (general cleanups) (9/86) X (Released to the world (comp.sources) 1/87) X Version 3.3 (general fixes and cleanups; see update.doc) (5/87) X Version 3.4 (general fixes and cleanups; see update.doc) (10/87) X (Released to the world 3/88) X Version 3.5 (general fixes and cleanups; see update.doc) (3/88) X Version 3.6 (general fixes and cleanups; text file translation for Mac; X see update.doc) (4/88) X (Released to the world (comp.sources.unix) 4/88) X Version 3.7 (general fixes and cleanups; see update.doc) (5/88) X Version 3.8 (general fixes and cleanups; see update.doc) (11/88) X Version 3.9 (general fixes and cleanups; Sun tip support; YMODEM-G; X see update.doc) (11/90) X (Released to the world (comp.sources.unix) 11/90) X Version 3.10 (general fixes and cleanups; see update.doc) (in progress) X -------------------------------------------------------------------------------- X Please send bug fixes, additions and comments to: Steve Grandi, National Optical Astronomy Observatories (Tucson, Arizona, USA) X grandi@noao.edu SHAR_EOF $shar_touch -am 0815110594 'xmodem/README' && chmod 0644 'xmodem/README' || echo 'restore of xmodem/README failed' shar_count="`wc -c < 'xmodem/README'`" test 22100 -eq "$shar_count" || echo "xmodem/README: original size 22100, current size $shar_count" rm -f _sharnew.tmp fi # ============= xmodem/update.doc ============== if test -f 'xmodem/update.doc' && test X"$1" != X"-c"; then echo 'x - skipping xmodem/update.doc (File already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting xmodem/update.doc (Text)' sed 's/^X//' << 'SHAR_EOF' > 'xmodem/update.doc' && Changes leading to version 3.3 X 1) "Better" handshaking for MODEM7 batch transfers (5/19/87). X 2) If reception of a file is aborted due to errors, delete incomplete file (5/19/87). X 3) If an "impossible" tty speed is detected, assume 1200 bps (5/19/87). X 4) Disallow CAN-CAN abort during file send or receive except at beginning of file transfer (during batch transfers, CAN-CAN abort is allowed at beginning of each file transfer) (5/19/87). X 5) Uncouple total allowed errors during the reception of a single packet (ERRORMAX, now made 10) and errors allowed when starting transfer (STERRORMAX, set to 10) (5/19/87). X 6) Fix some bugs when receiving an empty file and when a phase error occurs during a file reception (5/19/87). X 7) Portability fix in prtime and projtime; they also handle pathological cases better (5/19/87). X 8) During file reception an EOT is not believed unless it is sent again in response to a NAK (5/25/87). X 9) Modified cpm_unix and unixify so a filename without an extension will not have a trailing dot in its filename after being received in a MODEM7 or YMODEM batch transfer (5/25/87). X 10) Allowable errors during transmission of a single packet now set to ERRORMAX (5/27/87). X 11) When transferring a binary file, the YMODEM file length field is filled in on transmit and (if present) used to truncate the file on reception. A new truncate function (truncfile) added to getput.c to do the deed (5/28/87). The file mode field is also set but is ignored on file reception. X 12) In a batch receive (xmodem -rt), program can be forced into checksum mode by specifying the "M" flag indicating a MODEM7 transfer (5/30/87). X 13) Changed the "B" option to "M" to indicate MODEM7 batch. Made all option flags case insensitive. Command line is now recorded in the log file (5/30/87). X 14) The "KND/IMP" convention of using "CK" to invoke 1K packets during YMODEM batch transfers was installed. This code will be sent during a batch receive if "K" is included on the command line unless "M" is also present. This code will be recognized when sending under all circumstances (5/30/87). X ------------------------------------------------------------------------------ X Changes leading to version 3.4 X 1) Fix usage message (10/2/87). X 2) Sender will now try up to 10 times (EOTMAX) to send an EOT to terminate a transmission. Used to be 5 times, but Chuck Forsberg's "official" minimum requirements for YMODEM mandate 10 (10/2/87). X 3) Handle YMODEM file modification times if present in header on reception of both binary and text files (10/2/87). Retracted when can't seem to get proper times when playing with dsz (10/3/87). Found bug and reinstalled feature (10/16/87). Found REAL bug (10/21/87). X 4) Null bytes are now stripped out of files when received as text files (MEX doesn't seem to want to put in the terminating control-Z) (10/3/87). X 5) Slightly modified terminal parameter setting to explicitly turn off CRMOD and to flush read queue; ideas stolen from Kermit. Will it fly on Pyramid? (10/3/87). X 6) Decreased time between "startup" characters sent when starting a file receive operation. This should increase perceived response. Now waits WAITFIRST seconds (set to 1) instead of 6 (waits for 5 seconds for subsequent packets. STERRORMAX now 60, CRCSWMAX now 30. Timeouts on 1st sector no longer reported in log (10/5/87). X 7) Once again played with kernel sleeps in readbuf() (packet reading routine). On busy system could cause real problems. Now supply flag (t) to suppress sleeping on Too Busy systems. No longer suppress sleep when speeds are over 4800 bps. Sleep kludge DOES help: on an empty 750 running 4.3BSD, a file reception at 2400 bps used 6% of the CPU with the sleep kludge and 24% without it (data transfer rates were the the same) (10/5/87). X 8) Actually count characters as they are being read for a file reception. When YMODEM file length is set, stop writing characters when reach length. This will allow YMODEM file lengths to work for text files and the elimination of truncfile() in getput.c (which was impossible for SYS V) (10/5/87). X 9) Another attempt at tty modes. Now do nothing but set speeds, set mode to raw, and turn off echoing and tandem (10/6/87). X ------------------------------------------------------------------------------ X Changes leading to version 3.5 X 1) Following the suggestion of Bill Carpenter (ho5cad!wjc), I changed every printf("") to fprintf(stderr, "") so one can use xmodem on either end of unix to unix link. (3/24/88). X 2) Again, thanks to Bill Carpenter, corrected typo in stamptime() in getput.sysv.c (3/24/88). X 3) Thanks to Steve Lebowitz (prcpto!pdvshl), fixed a && that should have been a & in getput.sysv.c (3/25/88). X 4) Thanks to Leo Pilachowski, who managed to fool xmodem by "preplacing" ACKS in the VAX's input queue (improves throughput by 20%, says Leo, but makes error recovery a tad dicey...!). Implemented a flushin() function in getput.c to flush any pending characters. flushin is called in send.c just after sending a packet to make sure a proper ACK or NAK is received (I hope fast machines don't beat me to it and get their ACKS flushed!). In receive.c, flushin is called prior to the "startup" characters, prior to sending the packet acknowledgment ACK and prior to the NAK prompting for confirming EOT. Now how does one implement flushin() on Sys V? (3/25/88). X 5) Fixed pair of bugs in send.c: YMODEM test enforcing CRC was testing number of attempts against STERRORMAX instead of ERRORMAX (also shortened timeout interval on this read) and a "timeout" during packet send was not noticed (due to a > instead of a >=) thus program started sending EOTs which further delayed abort (3/28/88). X 6) Modified send.c and cpmify function in batch.c to strip path names on file names transmitted as part of YMODEM batch (3/28/88). X 7) Hacked receive.c to make end of loop processing clearer and improve garbage flushing when errors are detected (3/28/88). X 8) Pulled out of decision restricting YMODEM batch send to use CRC only. Will now gladly use checksum if told to and will respond to NAK as well as the proper C when starting up data transfer (3/28/88). Turns out this patch fixes problem with Red Ryder (4/10/88). X 9) Tested MODEM7 batch against MEX-PC. Confirmation of EOT during filename transmission was not working, so xmodem wasn't shutting down a MODEM7 batch receive. Removed code to NAK first EOT and wait for second EOT in MODEM7 filename transfers (3/28/88). X 10) Added code to count number of newlines in a text file to get an accurate file size. I thought it would take too long; but seems to be quite nimble (see countnl in getput.c). We now transmit YMODEM file length and mode information for text as well as binary files (3/29/88). X 11) After a YMODEM file name packet was received, forgot to reset "wait" time for receiving first character of data packet which definitely slowed perceived performance. (See note 6 for v. 3.4). Fixed (4/7/88). X ------------------------------------------------------------------------------ X Changes leading to version 3.6 X 1) Added two new major commands (sa and ra) to send and receive text files for Apple Macintoshs which use CR as EOL character instead of the MS/DOS CR LF pair. Thanks to Dave Nowak (djnowak@iseesun.DPL.SCG.HAC.COM) for the inspiration (4/11/88). X 2) Experiences with Red Ryder 10.3. Fixed botch in receive.c that led to an infinite loop when a checksum failed on YMODEM file name packet. Now have seperate variables for packet errors and "startup" errors. Prevent CRC to checksum switch during receive startup if YMDMBAT flag is true. This insures that no such transition will ever take place on second or subsequent file transfer; can be set on first file by including Y option on command line. No longer print "0" expected sectors if both YMODEM file length and KMD file length are both 0 (4/12/88). X 3) Cleaned up ifs in readbuf. Removed void declaration on flushin (will break 4.2BSD compiler?). Corrected "number of sent sectors" on YMODEM transfer (was counting filename packet) (4/12/88). X 4) More experiences with Red Ryder. Removed line flush before every CRCCHR or NAK trying to start a receive (RR YMODEM batch send to the VAX now seems to work). Fixed KMD "1K reception flag" to work properly on a receive. Added a flushin just before program exits in a futile effort to eliminate RR's nasty habit of sending a final EOT down the line. Rearranged variables in send.c so longpackets requested by the KMD flag are not "sticky" from file to file in a batch. RR is a real DOG: only gets about 133 cps when downloading to a Mac over a 9600 bps line! (4/14/88). X ------------------------------------------------------------------------------ X Changes leading to version 3.7 X 1) More strange and wonderful PC xmodem programs! Dave Jaksha's program won't send send another EOT when first EOT is NAKed. Raised timeout threshold from 3 to 5 seconds and fixed silly bug in receive.c that prevented any more NAKs from being sent in this situation (5/10/88). X ------------------------------------------------------------------------------ X Changes leading to version 3.8 X 1) Added some fields to YMODEM filename record as per Forsberg's revised spec. Correct some nits in the way the filename record is handled (11/1/88). X ------------------------------------------------------------------------------ X Changes leading to version 3.9 X 1) Better debug message about "packet starting" (10/17/90). X 2) Added debug error message when readbyte times out (10/17/90). X 3) Now flush input before ACK of received YMODEM filename packet. (Will this break Red Ryder? Tough.) (10/17/90). X 4) Now explicitly, after receiving YMODEM filename packet, send NAK or CRCCHR. Also, check that output file can be opened before ACKING receipt of YMODEM file name packet. Both these are required by "True" YMODEM spec. Also, I think this may cure some of the problems seen with various programs trying YMODEM batch transfers. (10/17/90). X 5) Added some status messages to be printed to stderr under control of the -P flag so we can tell the progress of a transfer when invoked with the "~C" command of SunOS tip. Also added -W flag to slow startup handshake so funny characters don't trash input while one is typing the "~C" command string (via TIPDELAY define, set to 15 seconds). Utilizes new tlogit and tlogitarg macros. (10/18/90). X 6) Made a failure to change the mode bits of the tty a non-fatal error since, in some systems, uucp owns the device. Also allows someone who has su'd to run Xmodem (10/24/90). X 7) Changed error messages about transmissions being canceled "at user's request" to "by CAN-CAN" (10/26/90). X 8) Go hog-wild with options! Added "e" option to suppress EOT verification when receiving files (should make some brain-damaged PC programs work with xmodem). Added "n" option to allow CAN-CAN aborts any time during a file transfer and not just at the beginning. (10/29/90). X 9) Added a one-liner function (stopsig) to getput.c to ignore keyboard stop signals so stray ^X characters absorbed during an abort don't put xmodem into background! (10/31/90). X 10) Added support for YMODEM-G variant of YMODEM via the "g" flag. (11/1/90). X 11) Made the "cm" option combination on a receive command force checksum "handshaking" during file-name negotiations and CRC-16 use during file transfer. Why am I still worried about MODEM7? (11/1/90). X 12) Revised some status messages to indicate that the option (CRC, 1K packets, YMODEM-G) were invoked from the command line rather than through "protocol negotiation." (11/1/90) X 13) Don't send "start-up handshake" character when you get a fatal error in a data block! (11/2/90) X 14) Try to REALLY flush input when die with fatal error in data block. Trying YMODEM-G receptions on a very busy VAX 750 shows up some problems! (11/2/90). X 15) Include a date in the version banner: Version 3.9 (November 1990). (11/5/90). X ------------------------------------------------------------------------------ X Changes leading to version 3.10 X 1) New Makefile courtesy Vikas Aggarwal (aggarwal@nisc.jvnc.net). His version used mkdep to determine dependencies, I explicitly put in the dependencies to avoid use of mkdep and cluttering up Makefile with /usr/include/whatever. (11/13/90). X 2) Added version.h with VERSION definition so I don't have to change xmodem.h and hence recompile everything when I change the version date. (12/10/90). X 3) Added reallyflush() function to misc.c to wait for all activity on line to clear (replaces flushin + a while loop). Added reallyflush call in receive.c to case of invalid packet number checksum. (12/12/90). X 4) Added timeout time to TIMEOUT debug message in readbyte. (12/12/90). X 5) Made "Can't flush terminal queue" in getput.c a non-fatal error (12/14/90). X 6) Made note in manual page about needed "/bin/stty -istrip" on MIPS systems running RISC/os. Why does "istrip" affect even raw mode? (12/14/90). X 7) Mask checksum values read from datastream to 8-bits so TIMEOUTS won't look even funnier than they have to. (12/20/90). X 8) Added new MOREDEBUG category of error logging (invoked by two x's in the option string). First use of MOREDEBUG in getput.c to list EVERY character read in a data packet. (12/20/90). X 9) Made another note in manual page about MIPS systems. The really need "/bin/stty -istrip -ixon" so 8-th bit is stripped and X-OFF characters aren't eaten (even in raw mode!). (12/20/90). X 10) Kit Bingham was having trouble with Versaterm uploads. Apparently, Versaterm couldn't respond fast enough to the initial handshake characters XXmodem was sending down the line. I modified receive.c to increment the amount of time between sending the handshake characters (variable firstwait) by one second each timeout. I also properly parameterized the timeout period allowed between data packets (as PACKWAIT = 5) and reset the startup error count after a YMODEM filename packet. (1/4/91). X ------------------------------------------------------------------------------ X Thanks to Keith Peterson (w8sdz@simtel20.arpa), John Rupley (arizona!rupley!root), Emmet Gray (ihnp4!uiucuxc!fthood!egray), Bob Bickford (lll-crg!well!rab), Doug Moore (moore@svax.cs.cornell.edu), David Brown (jdb@ncsc.arpa), Bill Carpenter (ho5cad!wjc), Steve Lebowitz (prcpto!pdvshl), Leo Pilachowski, Dave Nowak (djnowak@iseesun.DPL.SCG.HAC.COM), David Elliott (pyramid!boulder!stan!dce), Benson Margulis (benson@odi.com), Kit Bingham (kb@umnstat.stat.umn.edu), Bob Bownes (beowulf!bownes), Bill Stubblebine (hplabs!hp-lsd!was), Chert Pellett (spdyne!root), Vikas Aggarwal (aggarwal@nisc.jvnc.net) and Chuck Forsberg's documents and ZCOMM/DSZ/rz/sz programs for ideas, suggestions and comments. Thanks to D'Anne Thompson for some nice code. SHAR_EOF $shar_touch -am 0812084894 'xmodem/update.doc' && chmod 0644 'xmodem/update.doc' || echo 'restore of xmodem/update.doc failed' shar_count="`wc -c < 'xmodem/update.doc'`" test 14880 -eq "$shar_count" || echo "xmodem/update.doc: original size 14880, current size $shar_count" rm -f _sharnew.tmp fi # ============= xmodem/Makefile ============== if test -f 'xmodem/Makefile' && test X"$1" != X"-c"; then echo 'x - skipping xmodem/Makefile (File already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting xmodem/Makefile (Text)' sed 's/^X//' << 'SHAR_EOF' > 'xmodem/Makefile' && # Makefile for vxWorks version of XMODEM/YMODEM SHAR_EOF : || echo 'restore of xmodem/Makefile failed' fi echo 'End of xmodem part 1' echo 'File xmodem/Makefile is continued in part 2' echo 2 > _sharseq.tmp exit 0