Expand description
File transfers: ZMODEM here, XMODEM and YMODEM in crate::xmodem, and
Kermit in crate::kermit.
ZMODEM transfers drive the caller-owned state machines of the
zmodem2 crate with file I/O, progress tracking and timeouts.
A Transfer is fed raw (post-telnet) bytes from the remote and appends
the bytes it wants sent to an output buffer, so it works the same over
telnet, raw TCP and SSH.
Re-exports§
pub use crate::kermit::Kermit;pub use crate::xmodem::XyProtocol;pub use crate::xmodem::XyReceive;pub use crate::xmodem::XySend;
Structs§
- Download
- Progress
- Trailer
Filter - Strips the tail end of a ZMODEM session from data that follows it: the
CR LF (often with the high bit set) and XON closing the last hex header,
and the “OO” (“over and out”) that
szsends after its final ZFIN. These can arrive in later packets than the end of the session, so the filter stays armed across calls until real data shows up or it expires. - Upload
Enums§
Constants§
- CANCEL
- Ten CANs then ten backspaces: makes the other end abandon a session.
- PARTIAL_
SUFFIX - Downloads are written under this suffix until they are complete, so an interrupted one can be resumed when the BBS sends the file again.
- ZRINIT
ZPAD ZPAD ZDLE 'B' "01": the hex ZRINIT header a waiting receiver (rz) sends.- ZRQINIT
ZPAD ZPAD ZDLE 'B' "00": the hex ZRQINIT header a sender (sz) opens with.
Functions§
- find
- Find the first occurrence of
needleinhay. - sanitize_
file_ name - Reduce a file name from the wire to a safe base name: no directories, no control characters, never empty, “.” or “..”.