Proper abstraction of virtualPacketConn. It now supports other transport protocol encodings.

This commit is contained in:
Kleissner
2021-12-04 02:56:14 +01:00
parent 68d8c11872
commit 50ec1c804e
4 changed files with 23 additions and 17 deletions

View File

@@ -8,6 +8,14 @@ Offset Size Info
0 1 Control
1 1 Transfer Protocol
2 32 File Hash
Control = 0: Request Start
34 8 Offset to start reading in the file
42 8 Limit of bytes to read at the offset
Offset + limit must not exceed the file size.
Control = 3: Active
34 ? Embedded protocol data
*/
@@ -40,6 +48,8 @@ const (
TransferControlTerminate = 3 // Terminate
)
const TransferProtocolUDT = 0 // Indicates that UDT is used as embedded transfer protocol.
const transferPayloadHeaderSize = 34
// DecodeTransfer decodes a transfer message