Path: msuinfo!netnews.upenn.edu!widener!iggy.GW.Vitalink.COM!pacbell.com!att!linac!uwm.edu!wupost!uunet!nowhere!caf From: caf@omen.COM (Chuck Forsberg WA7KGX) Newsgroups: alt.sources Subject: Unix rz/sz repost^3 Message-ID: <1991Oct31.121550.25711@omen.COM> Date: 31 Oct 91 12:15:50 GMT Organization: Omen Technology INC Lines: 1391 Archive-Name: rzsz/part03 Submitted-By: ...!reed!omen!caf ---- Cut Here and feed the following to sh ---- #!/bin/sh # This is part 03 of rzsz # ============= crctab.c ============== if test -f 'crctab.c' -a X"$1" != X"-c"; then echo 'x - skipping crctab.c (File already exists)' else echo 'x - extracting crctab.c (Text)' sed 's/^X//' << 'SHAR_EOF' > 'crctab.c' && /* X * Crc calculation stuff X */ X /* crctab calculated by Mark G. Mendel, Network Systems Corporation */ static unsigned short crctab[256] = { X 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, X 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, X 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, X 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, X 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, X 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, X 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, X 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, X 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, X 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, X 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, X 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, X 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, X 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, X 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, X 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, X 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, X 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, X 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, X 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, X 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, X 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, X 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, X 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, X 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, X 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, X 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, X 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, X 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, X 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, X 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, X 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; X /* X * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell. X * NOTE: First srgument must be in range 0 to 255. X * Second argument is referenced twice. X * X * Programmers may incorporate any or all code into their programs, X * giving proper credit within the source. Publication of the X * source routines is permitted so long as proper credit is given X * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, X * Omen Technology. X */ X #define updcrc(cp, crc) ( crctab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp) X /* X * Copyright (C) 1986 Gary S. Brown. You may use this program, or X * code or tables extracted from it, as desired without restriction. X */ X /* First, the polynomial itself and its table of feedback terms. The */ /* polynomial is */ /* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */ /* Note that we take it "backwards" and put the highest-order term in */ /* the lowest-order bit. The X^32 term is "implied"; the LSB is the */ /* X^31 term, etc. The X^0 term (usually shown as "+1") results in */ /* the MSB being 1. */ X /* Note that the usual hardware shift register implementation, which */ /* is what we're using (we're merely optimizing it by doing eight-bit */ /* chunks at a time) shifts bits into the lowest-order term. In our */ /* implementation, that means shifting towards the right. Why do we */ /* do it this way? Because the calculated CRC must be transmitted in */ /* order from highest-order term to lowest-order term. UARTs transmit */ /* characters in order from LSB to MSB. By storing the CRC this way, */ /* we hand it to the UART in the order low-byte to high-byte; the UART */ /* sends each low-bit to hight-bit; and the result is transmission bit */ /* by bit from highest- to lowest-order term without requiring any bit */ /* shuffling on our part. Reception works similarly. */ X /* The feedback terms table consists of 256, 32-bit entries. Notes: */ /* */ /* The table can be generated at runtime if desired; code to do so */ /* is shown later. It might not be obvious, but the feedback */ /* terms simply represent the results of eight shift/xor opera- */ /* tions for all combinations of data and CRC register values. */ /* */ /* The values must be right-shifted by eight bits by the "updcrc" */ /* logic; the shift must be unsigned (bring in zeroes). On some */ /* hardware you could probably optimize the shift in assembler by */ /* using byte-swap instructions. */ X static long cr3tab[] = { /* CRC polynomial 0xedb88320 */ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; X #ifdef NFGM long UPDC32(b, c) long c; { X return (cr3tab[((int)c ^ b) & 0xff] ^ ((c >> 8) & 0x00FFFFFF)); } X #else X #define UPDC32(b, c) (cr3tab[((int)c ^ b) & 0xff] ^ ((c >> 8) & 0x00FFFFFF)) #endif X /* End of crctab.c */ SHAR_EOF chmod 0644 crctab.c || echo 'restore of crctab.c failed' Wc_c="`wc -c < 'crctab.c'`" test 8737 -eq "$Wc_c" || echo 'crctab.c: original size 8737, current size' "$Wc_c" fi # ============= minirb.c ============== if test -f 'minirb.c' -a X"$1" != X"-c"; then echo 'x - skipping minirb.c (File already exists)' else echo 'x - extracting minirb.c (Text)' sed 's/^X//' << 'SHAR_EOF' > 'minirb.c' && /* X * minirb.c By Chuck Forsberg Omen Technology INC X * "The High Reliability Communications Software" X * X * A bootstrap program for Unix to receive files from computers running X * YMODEM Batch (Professional-YAM, PowerCom, ZCOMM, etc.). X * X * Minirb uses system(3) to call stty, avoiding system dependent code. X * program strips CR and CPMEOF (^Z) characters (see putsec()). X * Please refer to rz.c for comments, etc. X */ char * Version = "minirb 2.00 05-25-87"; X #include #include #include X #define OK 0 #define FALSE 0 #define TRUE 1 #define ERROR (-1) #define CAN ('X'&037) #define SOH 1 #define STX 2 #define EOT 4 #define ACK 6 #define NAK 025 #define TIMEOUT (-2) #define RETRYMAX 9 #define WCEOT (-10) X FILE *fout; long Bytesleft; int Blklen; char secbuf[1024]; char linbuf[1024]; int Lleft=0; jmp_buf tohere; X alrm() { longjmp(tohere, -1); } X bibi(n) { X canit(); mode(0); X fprintf(stderr, "minirb: caught signal %d; exiting", n); X exit(128+n); } X mode(n) { X if (n) system("stty raw -echo"); X else system("stty echo -raw"); } X main() { X mode(1); X if (signal(SIGINT, bibi) == SIG_IGN) { X signal(SIGINT, SIG_IGN); signal(SIGKILL, SIG_IGN); X } else { X signal(SIGINT, bibi); signal(SIGKILL, bibi); X } X printf("minirb: Now send file(s) with \042sb file ...\042 command\r\n"); X X if (wcreceive()==ERROR) X canit(); X mode(0); exit(0); } X wcreceive() { X for (;;) { X if (wcrxpn(secbuf) == ERROR) break; X if (secbuf[0]==0) return OK; X if (procheader(secbuf)==ERROR || wcrx()==ERROR) break; X } X canit(); return ERROR; } X X wcrxpn(rpn) char *rpn; { X register c; X X purgeline(); et_tu: X sendline(NAK); Lleft=0; X while ((c = wcgetsec(rpn, 100)) != 0) { X if (c == WCEOT) { sendline(ACK); Lleft=0; readline(1); goto et_tu; } X return ERROR; X } X sendline(ACK); return OK; } X wcrx() { X register int sectnum, sectcurr, sendchar, cblklen; X X sectnum=0; sendchar=NAK; X for (;;) { X sendline(sendchar); Lleft=0; X sectcurr=wcgetsec(secbuf, 50); X if (sectcurr==(sectnum+1 & 0377)) { X sectnum++; cblklen = Bytesleft>Blklen ? Blklen:Bytesleft; X putsec(secbuf, cblklen); X if ((Bytesleft-=cblklen) < 0) Bytesleft = 0; X sendchar=ACK; X } X else if (sectcurr==(sectnum&0377)) sendchar=ACK; X else if (sectcurr==WCEOT) { X if (fclose(fout)==ERROR) return ERROR; X sendline(ACK); Lleft=0; return OK; X } X else if (sectcurr==ERROR) return ERROR; X else return ERROR; X } } X wcgetsec(rxbuf, maxtime) char *rxbuf; int maxtime; { X register checksum, wcj, firstch; register char *p; int sectcurr, errors; X for (errors=0; errors=0; ) { X if ((firstch=readline(1)) < 0) goto bilge; X checksum += (*p++ = firstch); X } X if ((firstch=readline(1)) < 0) goto bilge; X if (((checksum-firstch)&0377)==0) return sectcurr; X } X } X else if (firstch==EOT) return WCEOT; X else if (firstch==CAN) return ERROR; bilge: X while(readline(1)!=TIMEOUT) X ; X maxtime=40; sendline(NAK); Lleft=0; X } X canit(); return ERROR; } X readline(timeout) int timeout; { X register n; static char *cdq; X X if (--Lleft >= 0) return (*cdq++ & 0377); X n = timeout/10; X if (n < 2) n = 3; X if (setjmp(tohere)) { Lleft = 0; return TIMEOUT; } X signal(SIGALRM, alrm); alarm(n); X Lleft=read(0, cdq=linbuf, 1024); alarm(0); X if (Lleft < 1) return TIMEOUT; X --Lleft; return (*cdq++ & 0377); } X purgeline() { Lleft = 0; lseek(0, 0L, 2); } X X procheader(name) char *name; { X register char *p; X X Bytesleft = 2000000000L; p = name + 1 + strlen(name); X if (*p) sscanf(p, "%ld", &Bytesleft); X if ((fout=fopen(name, "w")) == NULL) return ERROR; X return OK; } X putsec(p, n) char *p; int n; { for (; --n>=0; ++p) if (*p != 015 && *p != 032) putc(*p, fout); } X sendline(c) { char d; d = c; write(1, &d, 1); } X char canistr[] = { 24,24,24,24,24,24,24,24,0 }; X canit() { printf(canistr); Lleft=0; } X /* END of minirb.c */ X SHAR_EOF chmod 0644 minirb.c || echo 'restore of minirb.c failed' Wc_c="`wc -c < 'minirb.c'`" test 4057 -eq "$Wc_c" || echo 'minirb.c: original size 4057, current size' "$Wc_c" fi # ============= mailer.rz ============== if test -f 'mailer.rz' -a X"$1" != X"-c"; then echo 'x - skipping mailer.rz (File already exists)' else echo 'x - extracting mailer.rz (Text)' sed 's/^X//' << 'SHAR_EOF' > 'mailer.rz' && X RZ/SZ Version 3.XX License form (Worldwide) X Remit To: Omen Technology INC FAX: 503-621-3735 X POB 4681 X Portland OR 97208-4681 X Payment of This License authorizes the installation and use of the "rz/sz" programs and/or derivative products derived from this code by compilation, inclusion, decompilation, or reverse engineering on the number of computers and/or ports specified below. X This license covers current and future Version 3.XX releases of the "rz" and "sz" programs. X RZ/SZ Version 3.XX per port Quantity Discount Schedule, (per purchase). X X 1 $20.00 2-10 $18.00 11-49 $15.00 50-99 $13.00 X 100-199 $12.00 200-499 $10.00 500-999 $ 8.00 1000+ $ 5.00 X ____ RZ/SZ Version 3.XX Registrations ______ X ____ OPTIONAL: Update disk (latest source code) X 5.25 inch DOS $ 15.00 ______ X 3.5 inch DOS $ 20.00 X (Contact Omen for other formats) X X (Overseas air mailed at no extra charge) Total ______ X Purchase orders must be prepaid. X X Company Name ___________________________________________________________ X Address ___________________________________________________________________ X X ___________________________________________________________________ X X ___________________________________________________________________ X I hereby agree that the licenses paid for are equal to or greater than any number of simultaneous invocations of the Programs, and that additional licenses will be purchased prior to increasing the number of simultaneous invocations of the Programs. X I agree that these Programs are made available in the hope it will be useful, BUT WITHOUT ANY WARRANTY OF ANY KIND OR LIABILITY FOR ANY DAMAGES OF ANY KIND. I understand support is available on a consulting basis. X Name ___________________________________________________________________ X Title ___________________________________________________________________ X X Signature __________________________________________________________________ X Date ___________________ Phone (_____) ____________________ X X Payment by: Check (U.S. bank or branch) enclosed ( ) Visa/Mastercard ( ) X Card # _____________________________________________ EXPIRES _____________ X Name of Cardholder ________________________________________________________ SHAR_EOF chmod 0644 mailer.rz || echo 'restore of mailer.rz failed' Wc_c="`wc -c < 'mailer.rz'`" test 2486 -eq "$Wc_c" || echo 'mailer.rz: original size 2486, current size' "$Wc_c" fi # ============= zmr.c ============== if test -f 'zmr.c' -a X"$1" != X"-c"; then echo 'x - skipping zmr.c (File already exists)' else echo 'x - extracting zmr.c (Text)' sed 's/^X//' << 'SHAR_EOF' > 'zmr.c' && /* X * File: zmr.c 07-30-1989 X * Copyright 1988, 1989 Omen Technology Inc All Rights Reserved X * X * X * X * This module implements ZMODEM Run Length Encoding, an X * extension that was not funded by the original Telenet X * development contract. X * X * This software may be freely used for non commercial and X * educational (didactic only) purposes. This software may also X * be freely used to support file transfer operations to or from X * licensed Omen Technology products. Any programs which use X * part or all of this software must be provided in source form X * with this notice intact except by written permission from Omen X * Technology Incorporated. X * X * Use of this software for commercial or administrative purposes X * except when exclusively limited to interfacing Omen Technology X * products requires a per port license payment of $20.00 US per X * port (less in quantity). Use of this code by inclusion, X * decompilation, reverse engineering or any other means X * constitutes agreement to these conditions and acceptance of X * liability to license the materials and payment of reasonable X * legal costs necessary to enforce this license agreement. X * X * X * Omen Technology Inc FAX: 503-621-3745 X * Post Office Box 4681 X * Portland OR 97208 X * X * This code is made available in the hope it will be useful, X * BUT WITHOUT ANY WARRANTY OF ANY KIND OR LIABILITY FOR ANY X * DAMAGES OF ANY KIND. X * X * ZMODEM RLE compression and decompression functions X */ X /* Send data subpacket RLE encoded with 32 bit FCS */ zsdar32(buf, length, frameend) char *buf; { X register int c, l, n; X register UNSL long crc; X X crc = 0xFFFFFFFFL; l = *buf++ & 0377; X if (length == 1) { X zsendline(l); crc = UPDC32(l, crc); X if (l == ZRESC) { X zsendline(1); crc = UPDC32(1, crc); X } X } else { X for (n = 0; --length >= 0; ++buf) { X if ((c = *buf & 0377) == l && n < 126 && length>0) { X ++n; continue; X } X switch (n) { X case 0: X zsendline(l); X crc = UPDC32(l, crc); X if (l == ZRESC) { X zsendline(0100); crc = UPDC32(0100, crc); X } X l = c; break; X case 1: X if (l != ZRESC) { X zsendline(l); zsendline(l); X crc = UPDC32(l, crc); X crc = UPDC32(l, crc); X n = 0; l = c; break; X } X /* **** FALL THRU TO **** */ X default: X zsendline(ZRESC); crc = UPDC32(ZRESC, crc); X if (l == 040 && n < 34) { X n += 036; X zsendline(n); crc = UPDC32(n, crc); X } X else { X n += 0101; X zsendline(n); crc = UPDC32(n, crc); X zsendline(l); crc = UPDC32(l, crc); X } X n = 0; l = c; break; X } X } X } X xsendline(ZDLE); xsendline(frameend); X crc = UPDC32(frameend, crc); X X crc = ~crc; X for (length=4; --length >= 0;) { X zsendline((int)crc); crc >>= 8; X } } X X /* Receive data subpacket RLE encoded with 32 bit FCS */ zrdatr32(buf, length) register char *buf; { X register int c; X register UNSL long crc; X register char *end; X register int d; X X crc = 0xFFFFFFFFL; Rxcount = 0; end = buf + length; X d = 0; /* Use for RLE decoder state */ X while (buf <= end) { X if ((c = zdlread()) & ~0377) { crcfoo: X switch (c) { X case GOTCRCE: X case GOTCRCG: X case GOTCRCQ: X case GOTCRCW: X d = c; c &= 0377; X crc = UPDC32(c, crc); X if ((c = zdlread()) & ~0377) X goto crcfoo; X crc = UPDC32(c, crc); X if ((c = zdlread()) & ~0377) X goto crcfoo; X crc = UPDC32(c, crc); X if ((c = zdlread()) & ~0377) X goto crcfoo; X crc = UPDC32(c, crc); X if ((c = zdlread()) & ~0377) X goto crcfoo; X crc = UPDC32(c, crc); X if (crc != 0xDEBB20E3) { X zperr(badcrc); X return ERROR; X } X Rxcount = length - (end - buf); #ifndef DSZ X vfile("zrdatr32: %d %s", Rxcount, X Zendnames[d-GOTCRCE&3]); #endif X return d; X case GOTCAN: X zperr("Sender Canceled"); X return ZCAN; X case TIMEOUT: X zperr("TIMEOUT"); X return c; X default: X zperr("Bad data subpacket"); X return c; X } X } X crc = UPDC32(c, crc); X switch (d) { X case 0: X if (c == ZRESC) { X d = -1; continue; X } X *buf++ = c; continue; X case -1: X if (c >= 040 && c < 0100) { X d = c - 035; c = 040; goto spaces; X } X if (c == 0100) { X d = 0; X *buf++ = ZRESC; continue; X } X d = c; continue; X default: X d -= 0100; X if (d < 1) X goto badpkt; spaces: X if ((buf + d) > end) X goto badpkt; X while ( --d >= 0) X *buf++ = c; X d = 0; continue; X } X } badpkt: X zperr("Data subpacket too long"); X return ERROR; } X SHAR_EOF chmod 0644 zmr.c || echo 'restore of zmr.c failed' Wc_c="`wc -c < 'zmr.c'`" test 4424 -eq "$Wc_c" || echo 'zmr.c: original size 4424, current size' "$Wc_c" fi # ============= crc.doc ============== if test -f 'crc.doc' -a X"$1" != X"-c"; then echo 'x - skipping crc.doc (File already exists)' else echo 'x - extracting crc.doc (Text)' sed 's/^X//' << 'SHAR_EOF' > 'crc.doc' && X X X X CCCCRRRRCCCC((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) CCCCRRRRCCCC((((1111)))) X X X X NNNNAAAAMMMMEEEE X crc - checksum files X X SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS X ccccrrrrcccc file ... X X DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN X For each file, _c_r_c calculates and prints a 32-bit CRC, the X byte count, and the file name. It is typically used to X validate files transferred between different systems, and is X useful in detecting subtle disk corruption. _C_r_c uses a X checksum compatible with the DOS version of crc, the 32 bit X CRC used by PKZIP version 0.9, as well as the "crc" command X in ZCOMM and Professional-YAM (high reliability X communications programs). X X The 32-bit CRC used is the frame check sequence in ADCCP X (ANSI X3.66, also known as FIPS PUB 71 and FED-STD-1003, the X U.S. versions of CCITT's X.25 link-level protocol). X X 32 bit CRC code courtesy Gary S. Brown. X X BBBBUUUUGGGGSSSS X Although extremely unlikely, files with different data may X still produce the same crc value. X X SSSSEEEEEEEE AAAALLLLSSSSOOOO X chek(1), undos(OMEN), todos(OMEN), tocpm(OMEN), sum(1), X wc(1). X X X X X X X X X X X X X X X X X X X X X X X X X X X Page 1 (printed 9/15/91) X X X SHAR_EOF chmod 0644 crc.doc || echo 'restore of crc.doc failed' Wc_c="`wc -c < 'crc.doc'`" test 1517 -eq "$Wc_c" || echo 'crc.doc: original size 1517, current size' "$Wc_c" fi # ============= rz.doc ============== if test -f 'rz.doc' -a X"$1" != X"-c"; then echo 'x - skipping rz.doc (File already exists)' else echo 'x - extracting rz.doc (Text)' sed 's/^X//' << 'SHAR_EOF' > 'rz.doc' && X X X X RRRRZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) RRRRZZZZ((((1111)))) X X X X NNNNAAAAMMMMEEEE X rx, rc, rb, rz - Receive Files and Commands with X/Y/ZMODEM X X SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS X rrrrzzzz [- ttttvvvv] X rrrrbbbb [- ttttvvvv] X rrrrcccc [- ttttvvvv] _f_i_l_e X rrrrxxxx [- ttttvvvv] _f_i_l_e X ggggzzzz _f_i_l_e ... X [----][vvvv]rrrrzzzzCCCCOOOOMMMMMMMMAAAANNNNDDDD X X DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN X This program uses error correcting protocols to receive X files over a dial-in serial port from a variety of programs X running under PC-DOS, CP/M, Unix, and other operating X systems. It is invoked from a shell prompt manually, or X automatically as a result of an "sz file ..." command given X to the calling program. X X This is a copyrighted shareware program. Commercial use of X this program is subject to licensing conditions detailed in X the rz.c source code. "Commercial Use" includes use of this X program to receive files from commercial and/or shareware X programs not published by Omen Technology INC. X X This program is not designed to be called from _c_u(_1), X _t_i_p(_1), or other communications programs. Unix flavors of X Omen Technology's Professional-YAM communications software X are available for dial-out applications. Unix X Professional-YAM supports dial-out applications with X telephone directory, a powerful script language with learn X function, high quality multiple protocol support, and UUCP X port arbitration. X X X RRRRzzzz (Receive ZMODEM) receives one or more files with the X ZMODEM protocol. Pathnames are supplied by the sending X program, and directories are made if necessary (and X possible). Normally, the "rz" command is automatically X issued by the calling ZMODEM program, but defective ZMODEM X implementations may require starting _r_z manually. X X RRRRbbbb receives file(s) with YMODEM, accepting either standard X 128 byte sectors or 1024 byte sectors (YAM sb ----kkkk option). X The user should determine when the 1024 byte block length X actually improves throughput. X X If True YMODEM (Omen Technology trademark) file information X (file length, etc.) is received, the file length controls X the number of bytes written to the output dataset, and the X modify time and file mode (iff non zero) are set X accordingly. X X X X Page 1 (printed 10/30/91) X X X X X X X RRRRZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) RRRRZZZZ((((1111)))) X X X X If True YMODEM file information is not received, slashes in X the pathname are changed to underscore, and any trailing X period in the pathname is eliminated. This conversion is X useful for files received from CP/M and other historical X systems. X X RRRRcccc receives a single _f_i_l_e with XMODEM-CRC or XMODEM-1k-CRC X protocol. The user should determine when the 1024 byte X block length actually improves throughput without causing X problems. The user must supply the file name to both X sending and receiving programs. Up to 1023 garbage X characters may be added to the received file. X X RRRRxxxx receives a single _f_i_l_e with XMODEM or XMODEM-1k protocol. X The user should determine when the 1024 byte block length X actually improves throughput without causing problems. The X user must supply the file name to both sending and receiving X programs. Up to 1023 garbage characters may be added to the X received file. X X GGGGzzzz is a shell script which calls _s_z to command Pro-YAM or X ZCOMM to transmit the specified files. Pathnames used with X _g_z must be escaped if they have special significance to the X Unix shell. X EXAMPLE: gz "-a C:*.c D:*.h" X X RRRRzzzz may be invoked as rrrrzzzzCCCCOOOOMMMMMMMMAAAANNNNDDDD (with an optional leading - X as generated by login(1)). For each received file, _r_z will X pipe the file to ``COMMAND filename'' where filename is the X name of the transmitted file with the file contents as X standard input. X X Each file transfer is acknowledged when COMMAND exits with 0 X status. A non zero exit status terminates transfers. X X A typical use for this form is _r_z_r_m_a_i_l which calls rmail(1) X to post mail to the user specified by the transmitted file X name. For example, sending the file "caf" from a PC-DOS X system to _r_z_r_m_a_i_l on a Unix system would result in the X contents of the DOS file "caf" being mailed to user "caf". X X On some Unix systems, the login directory must contain a X link to COMMAND as login sets SHELL=rsh which disallows X absolute pathnames. If invoked with a leading ``v'', _r_z X will report progress to /tmp/rzlog. The following entry X works for Unix SYS III/V: X rzrmail::5:1::/bin:/usr/local/rzrmail X If the SHELL environment variable includes _r_s_h or _r_k_s_h X (restricted shell), _r_z will not accept absolute pathnames or X references to a parent directory, will not modify an X existing file, and removes any files received in error. X X X X X Page 2 (printed 10/30/91) X X X X X X X RRRRZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) RRRRZZZZ((((1111)))) X X X X The meanings of the available options are: X X tttt ttttiiiimmmm X Change timeout to _t_i_m tenths of seconds. X vvvv Verbose causes a list of file names to be appended to X /tmp/rzlog . More v's generate more detailed debugging X output. X (Pro-YAM command) X <_A_L_T-_2> X Pro-YAM Command: _s_z *._h *._c X (This automatically invokes _r_z on the connected system.) X X X DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS X Exit status is as follows: 0 for successful transfers. 1 if X unrecoverable errors are detected. 2 if syntax errors or X file access problems are detected. 3 if the program was X terminated by a caught interrupt. X X X SSSSEEEEEEEE AAAALLLLSSSSOOOO X Professional-YAM, ZCOMM, DSZ, crc(omen), sz(omen), X usq(omen), undos(omen) X X Compile time options required for various operating systems X are described in the source file. X X NNNNOOOOTTTTEEEESSSS X ZMODEM's support of XOFF/XON flow control allows proper X operation in many environments that do not support XMODEM X uploads. Unfortunately, not all Unix versions support input X flow control. The TTY input buffering on some systems may X not adequately buffer long blocks or streaming input at high X speed. You should suspect this problem when you can't send X data to the Unix system at high speeds using ZMODEM, X YMODEM-1k or XMODEM-1k, but YMODEM with 128 byte blocks X works properly. X X The DSZ or Pro-YAM zzzzmmmmooooddddeeeemmmm llll numeric parameter may be set to X a value between 64 and 1024 to limit the burst length X ("zmodem pl128"). Although this compromises ZMODEM's X throughput, ZMODEM's superior reliability remains intact. X X If a program that does not properly implement the specified X file transfer protocol causes _r_z to "hang" the port after a X failed transfer, either wait for _r_z to time out or keyboard X a dozen Ctrl-X characters. Every reported instance of this X problem has been corrected by using ZCOMM, Pro-YAM, DSZ, or X other program with a correct implementation of the specified X protocol. X X Many programs claiming to support YMODEM only support XMODEM X X X X Page 3 (printed 10/30/91) X X X X X X X RRRRZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) RRRRZZZZ((((1111)))) X X X X with 1k blocks, and they often don't get that quite right. X X In the case of a few poorly designed microcomputers, sending X serial data to a tty port at sustained high speeds has been X known to cause lockups, system halts, kernel panics, and X occasional antisocial behaviour. This problem is not unique X to _r_z; CRT terminals with block mode transmission and line X noise have the same effect. When experimenting with high X speed input to a system, consider rebooting the system if X the file transfers are not successful, especially if the X personality of the system appears altered. X X The Unix "ulimit" parameter must be set high enough to X permit large file transfers to Unix. X X Telebit modems must not be set to "spoof" UUCP, XMODEM, or X KERMIT. Setting one of these spoofing modes interferes with X other protoocls. X X 32 bit CRC code courtesy Gary S. Brown. Directory creation X code from John Gilmore's PD TAR program. X X BBBBUUUUGGGGSSSS X This version of _r_z does not support some ZMODEM features. X Unix flavors of Professional-YAM may be linked to "rz" to X support these features. X X The ASCII option's CR/LF to NL translation merely deletes X CR's; undos(omen) performs a more intelligent translation. X X ZZZZMMMMOOOODDDDEEEEMMMM CCCCAAAAPPPPAAAABBBBIIIILLLLIIIITTTTIIIIEEEESSSS X _R_z supports ZMODEM command execution (zcommand), incoming X ZMODEM binary (-b), ASCII (-a), newer(-n), newer+longer(-N), X protect (-p), Crash Recovery(-r), clobber (-y), X match+clobber (-Y), compression(-Z), and append (-+) X requests. Other options sent by the sender are ignored. X The default is protect (-p) and binary (-b). X X Unix Professional-YAM provides higher performance and other X features not supported by _r_z. Please contact Omen Technology X Inc for product information. X X Omen Technology INC X Post Office Box 4681 X Portland OR 97208 X 503-621-3406 X X X FFFFIIIILLLLEEEESSSS X rz.c, crctab.c, rbsb.c, zm.c, zmr.c, zmodem.h, rz.1 X X /tmp/rzlog stores debugging output generated with -vv option X X X X Page 4 (printed 10/30/91) X X X SHAR_EOF chmod 0644 rz.doc || echo 'restore of rz.doc failed' Wc_c="`wc -c < 'rz.doc'`" test 10690 -eq "$Wc_c" || echo 'rz.doc: original size 10690, current size' "$Wc_c" fi # ============= sz.doc ============== if test -f 'sz.doc' -a X"$1" != X"-c"; then echo 'x - skipping sz.doc (File already exists)' else echo 'x - extracting sz.doc (Text)' sed 's/^X//' << 'SHAR_EOF' > 'sz.doc' && X X X X SSSSZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) SSSSZZZZ((((1111)))) X X X X NNNNAAAAMMMMEEEE X sx, sb, sz - Send Files with ZMODEM, YMODEM, or XMODEM X zcommand, zcommandi - Send COmmands with ZMODEM X X SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS X sz [-++++aaaabbbbddddeeeeffffkkkkLLLLllllNNNNnnnnooooppppTTTTttttuuuuvvvvyyyyYYYYZZZZ] _f_i_l_e ... X sb [-ddddffffkkkkttttuuuuvvvv] _f_i_l_e ... X sx [-kkkkttttuuuuvvvv] _f_i_l_e X zcommand [-oooottttvvvv] CCCCOOOOMMMMMMMMAAAANNNNDDDD X zcommandi [-oooottttvvvv] CCCCOOOOMMMMMMMMAAAANNNNDDDD X sz -TT X X DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN X SSSSzzzz (send ZMODEM) uses the ZMODEM, YMODEM or XMODEM error X correcting protocol to send one or more files over a dial-in X serial port to a variety of programs running under PC-DOS, X CP/M, Unix, VMS, and other operating systems. X X This is a copyrighted shareware program. Commercial use of X this program is subject to licensing conditions detailed in X the rz.c source code. "Commercial Use" includes use of this X program to send files to commercial and/or shareware X programs not published by Omen Technology INC. X X X This program is not designed to be called from _c_u(_1) _t_i_p(_1), X or other communications programs. Unix flavors of Omen X Technology's Professional-YAM communications software are X available for dial-out applications. Unix Professional-YAM X supports dial-out applications with telephone directory, a X powerful script language with learn function, high quality X multiple protocol support, and UUCP port arbitration. X X X SSSSzzzz sends one or more files with ZMODEM protocol. X X ZMODEM greatly simplifies file transfers compared to XMODEM. X In addition to a friendly user interface, ZMODEM provides X Personal Computer and other users an efficient, accurate, X and robust file transfer method. X X ZMODEM provides complete EEEENNNNDDDD----TTTTOOOO----EEEENNNNDDDD data integrity between X application programs. ZMODEM's 32 bit CRC catches errors X that sneak into even the most advanced networks. X X Advanced file management features include AutoDownload X (Automatic file Download initiated without user X intervention), Display of individual and total file lengths X and transmission time estimates, Crash Recovery, selective X file transfers, and preservation of exact file date and X length. X X X X X Page 1 (printed 10/30/91) X X X X X X X SSSSZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) SSSSZZZZ((((1111)))) X X X X The ----yyyy option instructs the receiver to open the file for X writing unconditionally. The ----aaaa option causes the receiver X to convert Unix newlines to PC-DOS carriage returns and X linefeeds. X X X SSSSbbbb sends one or more files with YMODEM or ZMODEM protocol. X The initial ZMODEM initialization is not sent. When X requested by the receiver, ssssbbbb supports YYYYMMMMOOOODDDDEEEEMMMM----gggg with X "cbreak" tty mode, XON/XOFF flow control, and interrupt X character set to CAN (^X). YYYYMMMMOOOODDDDEEEEMMMM----gggg (Professional-YAM gggg X option) increases YMODEM throughput over error free channels X (direct connection, X.PC, etc.) by disabling error recovery. X X On Unix systems, additional information about the file is X transmitted. If the receiving program uses this X information, the transmitted file length controls the exact X number of bytes written to the output dataset, and the X modify time and file mode are set accordingly. X X X SSSSxxxx sends a single _f_i_l_e with XXXXMMMMOOOODDDDEEEEMMMM or XXXXMMMMOOOODDDDEEEEMMMM----1111kkkk protocol X (sometimes incorrectly called "ymodem"). The user must X supply the file name to both sending and receiving programs. X X Iff sssszzzz is invoked with $SHELL set and iff that variable X contains the string _r_s_h or _r_k_s_h (restricted shell), sssszzzz X operates in restricted mode. Restricted mode restricts X pathnames to the current directory and PUBDIR (usually X /usr/spool/uucppublic) and/or subdirectories thereof. X X X The fourth form sends a single COMMAND to a ZMODEM receiver X for execution. ZZZZccccoooommmmmmmmaaaannnndddd exits with the COMMAND return X value. If COMMAND includes spaces or characters special to X the shell, it must be quoted. X X X The fifth form sends a single COMMAND to a ZMODEM receiver X for execution. ZZZZccccoooommmmmmmmaaaannnnddddiiii exits as soon as the receiver has X correctly received the command, before it is executed. X X X The sixth form (sz -TT) attempts to output all 256 code X combinations to the terminal. In you are having difficulty X sending files, this command lets you see which character X codes are being eaten by the operating system. X X X X The meanings of the available options are: X X X X X Page 2 (printed 10/30/91) X X X X X X X SSSSZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) SSSSZZZZ((((1111)))) X X X X ++++ Instruct the receiver to append transmitted data to an X existing file (ZMODEM only). X aaaa Instruct the ZMODEM receiver to convert text file X format as appropriate for the receiving system. Valid X only for ZMODEM. X bbbb (ZMODEM) Binary override: transfer file without any X translation. X cccc Instruct the receiver to change the pathname if the X destination file exists. X dddd Change all instances of "." to "/" in the transmitted X pathname. Thus, C.omenB0000 (which is unacceptable to X MSDOS or CP/M) is transmitted as C/omenB0000. If the X resultant filename has more than 8 characters in the X stem, a "." is inserted to allow a total of eleven. X eeee Escape all control characters; normally only XON, XOFF, X DLE, CR-@-CR, and Ctrl-X are escaped. X ffff Send Full pathname. Normally directory prefixes are X stripped from the transmitted filename. X kkkk (XMODEM/YMODEM) Send files using 1024 byte blocks X rather than the default 128 byte blocks. 1024 byte X packets speed file transfers at high bit rates. X (ZMODEM streams the data for the best possible X throughput.) X LLLL NNNN Use ZMODEM sub-packets of length N. A larger N (32 <= X N <= 1024) gives slightly higher throughput, a smaller X N speeds error recovery. The default is 128 below 300 X baud, 256 above 300 baud, or 1024 above 2400 baud. X llll NNNN Wait for the receiver to acknowledge correct data every X NNNN (32 <= N <= 1024) characters. This may be used to X avoid network overrun when XOFF flow control is X lacking. X nnnn (ZMODEM) Send each file if destination file does not X exist. Overwrite destination file if source file is X newer than the destination file. X NNNN (ZMODEM) Send each file if destination file does not X exist. Overwrite destination file if source file is X newer or longer than the destination file. X oooo (ZMODEM) Disable automatic selection of 32 bit CRC. X pppp (ZMODEM) Protect existing destination files by skipping X transfer if the destination file exists. X rrrr (ZMODEM) Resume interrupted file transfer. If the X source file is longer than the destination file, the X transfer commences at the offset in the source file X that equals the length of the destination file. X rrrrrrrr As above, but compares the files (the portion common to X sender and reciever) before resuming the transfer. X tttt ttttiiiimmmm X Change timeout to _t_i_m tenths of seconds. X uuuu Unlink the file after successful transmission. X wwww NNNN Limit the transmit window size to N bytes (ZMODEM). X vvvv Verbose causes a list of file names to be appended to X /tmp/szlog . More v's generate more output. X X X X Page 3 (printed 10/30/91) X X X X X X X SSSSZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) SSSSZZZZ((((1111)))) X X X X yyyy Instruct a ZMODEM receiving program to overwrite any X existing file with the same name. X YYYY Instruct a ZMODEM receiving program to overwrite any X existing file with the same name, and to skip any X source files that do have a file with the same pathname X on the destination system. X ZZZZ Use ZMODEM file compression to speed file transfer. X X DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS X Exit status is as follows: 0 for successful transfers. 1 if X unrecoverable errors are detected. 2 if syntax errors or X file access problems are detected. 3 if the program was X terminated by a caught interrupt. X X EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS X ZZZZMMMMOOOODDDDEEEEMMMM FFFFiiiilllleeee TTTTrrrraaaannnnssssffffeeeerrrr (Unix to DSZ/ZCOMM/Professional-YAM) X %%%% sssszzzz ----aaaa ****....cccc X This single command transfers all .c files in the current X Unix directory with conversion (----aaaa) to end of line X conventions appropriate to the receiving environment. With X ZMODEM AutoDownload enabled, Professional-YAM and ZCOMM X will automatically recieve the files after performing a X security check. X X %%%% sssszzzz ----YYYYaaaannnn ****....cccc ****....hhhh X Send only the .c and .h files that exist on both systems, X and are newer on the sending system than the corresponding X version on the receiving system, converting Unix to DOS text X format. X X ZZZZMMMMOOOODDDDEEEEMMMM CCCCoooommmmmmmmaaaannnndddd DDDDoooowwwwnnnnllllooooaaaadddd (Unix to Professional-YAM) X cpszall:all X zcommand "c:;cd /yam/dist" X sz -ya $(YD)/*.me X sz -yb y*.exe X zcommand "cd /yam" X zcommandi "!insms" X This Makefile fragment uses zzzzccccoooommmmmmmmaaaannnndddd to issue commands to X Professional-YAM to change current disk and directory. X Next, sssszzzz transfers the ._m_e files from the $YD directory, X commanding the receiver to overwrite the old files and to X convert from Unix end of line conventions to PC-DOS X conventions. The third line transfers some ._e_x_e files. The X fourth and fifth lines command Pro-YAM to change directory X and execute a PC-DOS batch file _i_n_s_m_s . Since the batch file X takes considerable time, the zzzzccccoooommmmmmmmaaaannnnddddiiii form is used to allow X the program to exit immediately. X X XXXXMMMMOOOODDDDEEEEMMMM FFFFiiiilllleeee TTTTrrrraaaannnnssssffffeeeerrrr (Unix to Crosstalk) X % ssssxxxx ffffoooooooo....cccc X EEEESSSSCCCC X rrrrxxxx ffffoooooooo....cccc X X X X Page 4 (printed 10/30/91) X X X X X X X SSSSZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) SSSSZZZZ((((1111)))) X X X X The above three commands transfer a single file from Unix to X a PC and Crosstalk. This combination is much slower and X less reliable than ZMODEM. X X EEEERRRRRRRROOOORRRR MMMMEEEESSSSSSSSAAAAGGGGEEEESSSS X "Caught signal 99" indicates the program was not properly X compiled, refer to "bibi(99)" in rbsb.c for details. X X SSSSEEEEEEEE AAAALLLLSSSSOOOO X rz(omen), ZMODEM.DOC, YMODEM.DOC, Professional-YAM, X crc(omen), sq(omen), todos(omen), tocpm(omen), tomac(omen), X yam(omen) X X Compile time options required for various operating systems X are described in the source file. X X FFFFIIIILLLLEEEESSSS X 32 bit CRC code courtesy Gary S. Brown. X X sz.c, crctab.c, rbsb.c, zm.c, zmr.c, zmodem.h Unix source X files X X /tmp/szlog stores debugging output (sz -vv) X X TTTTEEEESSSSTTTTIIIINNNNGGGG FFFFEEEEAAAATTTTUUUURRRREEEE X The command "sz -T file" exercises the AAAAttttttttnnnn sequence error X recovery by commanding errors with unterminated packets. X The receiving program should complain five times about X binary data packets being too long. Each time sssszzzz is X interrupted, it should send a ZDATA header followed by X another defective packet. If the receiver does not detect X five long data packets, the AAAAttttttttnnnn sequence is not X interrupting the sender, and the MMMMyyyyaaaattttttttnnnn string in sssszzzz....cccc must X be modified. X X After 5 packets, sssszzzz stops the "transfer" and prints the X total number of characters "sent" (Tcount). The difference X between Tcount and 5120 represents the number of characters X stored in various buffers when the Attn sequence is X generated. X X NNNNOOOOTTTTEEEESSSS X When using TrailBlazer or other buffered modems at high X speed, particular attention must be paid to flow control. X The modem and Unix must agree on the flow control method. X Sz on USG (SYS III/V) systems uses XON/XOFF flow control. X If flow control cannot be properly set up, Try a "-w 2048" X option to enforce protocol level flow control. Experiment X with different window sizes for best results. X X Telebit modems must not be set to "spoof" UUCP, XMODEM, or X KERMIT. Setting one of these spoofing modes interferes with X X X X Page 5 (printed 10/30/91) X X X X X X X SSSSZZZZ((((1111)))) OOOOmmmmeeeennnn TTTTeeeecccchhhhnnnnoooollllooooggggyyyy IIIINNNNCCCC ((((OOOOMMMMEEEENNNN)))) SSSSZZZZ((((1111)))) X X X X other protoocls. X X If a program that does not properly implement the specified X file transfer protocol causes _s_b to "hang" the port after a X failed transfer, either wait for _s_b to time out or keyboard X a dozen Ctrl-X characters. Every reported instance of this X problem has been corrected by using ZCOMM, Pro-YAM, DSZ, or X other program with a correct implementation of the specified X protocol. X X Many programs claiming to support YMODEM only support XMODEM X with 1k blocks, and they often don't get that quite right. X XMODEM transfers add up to 127 garbage bytes per file. X XMODEM-1k and YMODEM-1k transfers use 128 byte blocks to X avoid extra padding. X X YMODEM programs use the file length transmitted at the X beginning of the transfer to prune the file to the correct X length; this may cause problems with source files that grow X during the course of the transfer. This problem does not X pertain to ZMODEM transfers, which preserve the exact file X length unconditionally. X X Most ZMODEM options are merely passed to the receiving X program; some programs do not implement all of these X options. X X Circular buffering and a ZMODEM sliding window should be X used when input is from pipes instead of acknowledging X frames each 1024 bytes. If no files can be opened, sssszzzz sends X a ZMODEM command to echo a suitable complaint; perhaps it X should check for the presence of at least one accessible X file before getting hot and bothered. X X BBBBUUUUGGGGSSSS X On at least one BSD system, sz would abend it got within a X few kilobytes of the end of file. Using the "-w 8192" flag X fixed the problem. The real cause is unknown, perhaps a bug X in the kernel TTY output routines. X X The test mode leaves a zero length file on the receiving X system. X X X X X X X X X X X X X X Page 6 (printed 10/30/91) X X X SHAR_EOF chmod 0644 sz.doc || echo 'restore of sz.doc failed' Wc_c="`wc -c < 'sz.doc'`" test 17035 -eq "$Wc_c" || echo 'sz.doc: original size 17035, current size' "$Wc_c" fi true || echo 'restore of gz failed' echo End of part 3, continue with part 4 exit 0 -- Chuck Forsberg WA7KGX ...!tektronix!reed!omen!caf Author of YMODEM, ZMODEM, Professional-YAM, ZCOMM, and DSZ Omen Technology Inc "The High Reliability Software" 17505-V NW Sauvie IS RD Portland OR 97231 503-621-3406 .