The protocol description

Binkp works via a bidirectional character channel committing no errors during data transfer. Any data each of the partners write into the channel has the following common format:

   binkp's frames:

    +---------------------- 0=data block, 1=message(command)
    |                +---- data block size / msg's argument size
    |                |
    7 6543210 76543210
   +-+-------+--------+--- ..... ---+
   | |   HI      LO   |             | -- data block / msg's argument
   +-+-------+--------+--- ..... ---+
   |<-    2 bytes   ->|<- 32K max ->|

The frame header contains two bytes defining the type and the length (in bytes) of the data that follows the header. If the most significant bit of the header is reset, then all the data received with the frame should be appended to the current file being received if the file has been opened, otherwise the data should be discarded. If the bit is set, the data should be considered as a command changing the protocol state. The first data byte in the frame is the command number. The rest of the bytes form an argument. A command argument is an arbitrary character set not required to be bounded with a '\0'. A command without arguments (for example M_OK) may look roughly this way:

    7 6543210 76543210 76543210
   |1|      0        1|       4|
    |                |        +----- the command number (no arguments)
    |                +-------- length of the frame without the header - 1 byte
    +- this is a command

The commands which binkd/0.8 understands and their arguments:

A typical session between two binkd mailers:

The calling partner sends The answering partner sends
M_NUL "SYS ..." M_NUL "SYS ..."
M_NUL "ZYZ ..." M_NUL "ZYZ ..."
M_NUL "LOC ..." M_NUL "LOC ..."
M_NUL "VER ..." M_NUL "VER ..."
M_ADR "2:2/2.2@fidonet" M_ADR "3:3/3.3@fidonet"
M_PWD "password" (Waiting for a password from the remote system.)
M_OK "" or M_ERR "Bad password"
(Waiting for M_OK) M_FILE "file2 200 42342434 0"
M_FILE "file1 100 423424244 0" data
data data
data data
M_EOB (file1 is received, acknowledging it)
(file2 is received, acknowledging it) M_GOT "file1 100 423424244"
M_GOT "file2 200 42342434" data

© Copyright 1996-97 by Dima Maloff
$Id: binkp.html,v 1.5 1998/10/08 07:31:48 maloff Exp $
Translated from Russian by Michael Dukelsky