/* * Z M O D E M . H Manifest constants for ZMODEM * application to application file transfer protocol * 05-23-87 Chuck Forsberg Omen Technology Inc */ #define ZPAD '*' // ZPAD starts every header #define ZDLE 24 // The general purpose escape code #define ZBIN 'A' // Starts a binary CRC-16 frame #define ZHEX 'B' // Starts a hex CRC-16 frame #define ZBIN32 'C' // Starts a binary CRC-32 frame #define ZMAXSPLEN 1024 // Max subpacket length // These constants define all the various frame types #define ZRQINIT 0 // Request for receiver init frame #define ZRINIT 1 // A receiver init frame #define ZSINIT 2 // A sender init frame #define ZACK 3 // General purpose Acknowledge frame #define ZFILE 4 // File name and data #define ZSKIP 5 // Skip the incoming file #define ZNAK 6 // General purpose Not Acknowledge #define ZABORT 7 // Abort session #define ZFIN 8 // Session is complete #define ZRPOS 9 // Request to start sending from a // specific address #define ZDATA 10 // Start of a data frame #define ZEOF 11 // End of file #define ZFERR 12 // Fatal Read or Write error D #define ZCRC 13 // Request for CRC value of a file #define ZCHALLENGE 14 // Challenge frame #define ZCOMPL 15 // Request is complete #define ZCAN 16 // Remote end canceled #define ZFREECNT 17 // Request for free bytes // available on the target filesystem #define ZCOMMAND 18 // Command from sending program #define ZSTDERR 19 // Output to stderr data follows // Escape sequences in binary data #define ZCRCE 'h' // CRC next, frame ends, header // follows #define ZCRCG 'i' // CRC next, frame continues nonstop #define ZCRCQ 'j' // CRC next, frame conts., expect ZACK #define ZCRCW 'k' // CRC next, ZACK expected, // end of frame #define ZRUB0 'l' // Translate to rubout, 0x7f #define ZRUB1 'm' // Translate to rubout, 0xff // ReadDataFrame() return values #define GOTFLAG 0x100 #define GOTCRCE (ZCRCE | GOTFLAG) // ZDLE-ZCRCE received #define GOTCRCG (ZCRCG | GOTFLAG) // ZDLE-ZCRCG received #define GOTCRCQ (ZCRCQ | GOTFLAG) // ZDLE-ZCRCQ received #define GOTCRCW (ZCRCW | GOTFLAG) // ZDLE-ZCRCW received #define GOTCAN (CAN | GOTFLAG) // CAN*5 seen // Byte positions within header array #define ZF0 3 // Position 0 in the flags array #define ZF1 2 #define ZF2 1 #define ZF3 0 #define ZP0 0 // Low order 8 bits of position #define ZP1 1 #define ZP2 2 #define ZP3 3 // Bit Masks for ZRINIT flags byte ZF0 #define CANFDX 0x01 // Rx can send and receive true // full duplex #define CANOVIO 0x02 // Rx can receive data during disk I/O #define CANBRK 0x04 // Rx can send a break signal #define CANRLE 0x08 // Receiver can decode RLE #define CANLZW 0x10 // Receiver can uncompress #define CANFC32 0x20 // Receiver can use 32 bit CRC #define ESCCTL 0x40 // Receiver expects ctl chars // to be escaped #define ESC8 0x80 // Receiver expects 8th bit // to be escaped // Miscellaneous constants const int OK = 0; #define ZERROR -1 #define TIMEOUT -2 #define GARBAGE_COUNT -3 #define BS 8 #define LF 10 #define CR 13 #define DLE 16 #define XON 17 #define XOFF 19 #define CAN 24 #define ESC 27