Skip to main content

Module kermit

Module kermit 

Source
Expand description

Kermit file transfers, as C-Kermit, G-Kermit and Kermit-95 speak them, in both directions.

Packets are SOH LEN SEQ TYPE DATA CHECK CR, every field but the mark made printable (tochar(x) = x + 32). The two sides trade their parameters in the Send-Init (S) packet and its acknowledgement; this side offers long packets (up to MAX_LONG bytes), CRC-16 block checks (type 3), ~ run-length compression, file attributes (for the size) and sliding windows of up to WINDOW packets, and takes whatever the other side can do.

With a window, a sender keeps sending data packets while earlier ones wait for their ACKs, which keeps a slow or distant link busy. The receiver acknowledges each packet as it comes, keeps ones that arrive after a damaged one until it is sent again, and writes them in order. Packets other than data go one at a time, as without a window.

A download starts by itself when the BBS’s Kermit sends its S packet (see find_send_init); an upload is started by the user once the BBS’s Kermit is receiving.

Structs§

Kermit
A Kermit transfer, either way.

Constants§

MAX_LONG
The longest packet offered (its data and check).
WINDOW
The most packets offered in flight at once (Kermit allows 31).

Functions§

crc16_kermit
CRC-16/KERMIT: CCITT, reflected (0x8408), starting at 0.
find_send_init
Where a Send-Init packet starts in data, if there is one: what a BBS’s Kermit sends when told to send a file.