add poc ft packetids
This commit is contained in:
parent
edd2401244
commit
64d5a6be18
@ -85,6 +85,43 @@ enum _PacketType : uint8_t {
|
|||||||
// - ]
|
// - ]
|
||||||
HS1_RESPONSE_LAST_IDS,
|
HS1_RESPONSE_LAST_IDS,
|
||||||
|
|
||||||
|
// request the other side to initiate a FT
|
||||||
|
// - 1 byte (file_kind)
|
||||||
|
// - X bytes (file_kind dependent id, differnt sizes)
|
||||||
|
FT1_REQUEST,
|
||||||
|
|
||||||
|
// tell the other side you want to start a FT
|
||||||
|
// - 1 byte (file_kind)
|
||||||
|
// - X bytes (file_kind dependent id, differnt sizes)
|
||||||
|
// - 8 bytes (data size) // TODO: do all file kinds have a size at init?
|
||||||
|
// - 1 byte (temporary_file_tf_id, for this peer only, technically just a prefix to distinguish between simultainious fts)
|
||||||
|
FT1_INIT,
|
||||||
|
|
||||||
|
// acknowlage init (like an accept)
|
||||||
|
// - 1 byte (temporary_file_tf_id)
|
||||||
|
FT1_INIT_ACK,
|
||||||
|
|
||||||
|
// data fragment
|
||||||
|
// - 1 byte (temporary_file_tf_id)
|
||||||
|
// - 2 bytes (sequece id)
|
||||||
|
// - X bytes (the data fragment)
|
||||||
|
FT1_DATA,
|
||||||
|
|
||||||
|
// acknowlage data fragments
|
||||||
|
// - 1 byte (temporary_file_tf_id)
|
||||||
|
// - 1 byte (number of sequence ids to ack, this kind of depends on window size)
|
||||||
|
// - array [ (of sequece ids)
|
||||||
|
// - 2 bytes (sequece id)
|
||||||
|
// - ]
|
||||||
|
FT1_DATA_ACK,
|
||||||
|
|
||||||
|
// sender has gotten every data fragment acked, so we signal finish
|
||||||
|
// - 1 byte (temporary_file_tf_id)
|
||||||
|
FT1_DATA_FIN,
|
||||||
|
|
||||||
|
// and we ack that, we need this, so file_id is not reused earlier
|
||||||
|
// - 1 byte (temporary_file_tf_id)
|
||||||
|
FT1_DATA_FIN_ACK,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* _pkgid2str(_PacketType type) {
|
static const char* _pkgid2str(_PacketType type) {
|
||||||
|
Reference in New Issue
Block a user