From d464f63284fef47b71442d4c2bb93c699a6e4e44 Mon Sep 17 00:00:00 2001 From: bt Date: Sun, 29 Mar 2026 21:18:03 +0200 Subject: [docs] Use tables for payload types description --- docs/rfc.txt | 109 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 46 deletions(-) (limited to 'docs/rfc.txt') diff --git a/docs/rfc.txt b/docs/rfc.txt index 8d889df..02ad60a 100644 --- a/docs/rfc.txt +++ b/docs/rfc.txt @@ -117,6 +117,9 @@ Table of Contents * uint32 * uint64 + Number in numeric type name is number of bits used to encode this + type. + 2.3.2. Timestamp Uint64 containing Unix timestamp in UTC timezone. @@ -176,11 +179,13 @@ Table of Contents 2.4.2. Error - 0 - 0 1 2 3 4 5 6 7 - +-+-+-+-+-+-+-+-+ - | Error Type | - +-+-+-+-+-+-+-+-+ + +=======+============+ + | Type | Name | + +=======+============+ + | uint8 | error_type | + +-------+------------+ + + Table 2 2.4.2.1. Error types @@ -190,62 +195,74 @@ Table of Contents | 0x01 | Auth failed. Invalid username or password. | +------+---------------------------------------------+ - Table 2 + Table 3 2.4.3. Handshake - 0 1 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | ver_major | ver_minor | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +=======+===========+ + | Type | Name | + +=======+===========+ + | uint8 | ver_major | + +-------+-----------+ + | uint8 | ver_minor | + +-------+-----------+ + + Table 4 2.4.4. Auth - 0 1 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | username (string) ... - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | password (string) ... - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +========+==========+ + | Type | Name | + +========+==========+ + | string | username | + +--------+----------+ + | string | password | + +--------+----------+ + + Table 5 2.4.5. Message - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | source_address (string) ... - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | target_address (string) ... - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | timestamp | - | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | message_content (string) ... - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +===========+=================+ + | Type | Name | + +===========+=================+ + | string | source_address | + +-----------+-----------------+ + | string | target_address | + +-----------+-----------------+ + | timestamp | send_time | + +-----------+-----------------+ + | string | message_content | + +-----------+-----------------+ + + Table 6 2.4.6. Test Test payload is used for encoder and decoders testing. Clients and servers should ignore this kind of payload. - 0 1 2 3 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | num1 (uint8) | time1 (timestamp) | - | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-| - | | str1 (string) ... - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | num2 (uint16) | str2 (string) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | num3 (uint32) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | str3 (string) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | num4 (uint64) | - | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +===========+=======+ + | Type | Name | + +===========+=======+ + | uint8 | num1 | + +-----------+-------+ + | timestamp | time1 | + +-----------+-------+ + | string | str1 | + +-----------+-------+ + | uint16 | num2 | + +-----------+-------+ + | string | str2 | + +-----------+-------+ + | uint32 | num3 | + +-----------+-------+ + | string | str3 | + +-----------+-------+ + | uint64 | num4 | + +-----------+-------+ + + Table 7 2.5. Sequential operations -- cgit v1.2.3