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.html | 188 +++++++++++++++++++++++++++++++++++++++------------------- docs/rfc.md | 86 +++++++++------------------ docs/rfc.txt | 109 ++++++++++++++++++++-------------- 3 files changed, 218 insertions(+), 165 deletions(-) diff --git a/docs/rfc.html b/docs/rfc.html index 796825f..62a6738 100644 --- a/docs/rfc.html +++ b/docs/rfc.html @@ -1494,6 +1494,7 @@ spec. Following types are in use:
  • uint64
  • +

    Number in numeric type name is number of bits used to encode this type.

    @@ -1609,21 +1610,28 @@ Text is encoded using UTF-8.

    2.4.2. Error -
    -
      0
    -  0 1 2 3 4 5 6 7
    - +-+-+-+-+-+-+-+-+
    - |  Error Type   |
    - +-+-+-+-+-+-+-+-+
    -
    -
    + + + + + + + + + + + + + + +
    Table 2
    TypeName
    uint8error_type
    2.4.2.1. Error types
    - - +
    Table 2
    + @@ -1646,14 +1654,25 @@ Text is encoded using UTF-8.

    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   |
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -
    -
    +
    Table 3
    Type
    + + + + + + + + + + + + + + + + + +
    Table 4
    TypeName
    uint8ver_major
    uint8ver_minor
    @@ -1661,16 +1680,25 @@ Text is encoded using UTF-8.

    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)         ...
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -
    -
    + + + + + + + + + + + + + + + + + + +
    Table 5
    TypeName
    stringusername
    stringpassword
    @@ -1678,21 +1706,33 @@ Text is encoded using UTF-8.

    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)             ...
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 6
    TypeName
    stringsource_address
    stringtarget_address
    timestampsend_time
    stringmessage_content
    @@ -1702,25 +1742,49 @@ Text is encoded using UTF-8.

    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)                          |
    - |                                                               |
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 7
    TypeName
    uint8num1
    timestamptime1
    stringstr1
    uint16num2
    stringstr2
    uint32num3
    stringstr3
    uint64num4
    diff --git a/docs/rfc.md b/docs/rfc.md index db79839..3bed7fc 100644 --- a/docs/rfc.md +++ b/docs/rfc.md @@ -113,6 +113,8 @@ spec](https://go.dev/ref/spec#Numeric_types). Following types are in use: * uint32 * uint64 +Number in numeric type name is number of bits used to encode this type. + ### Timestamp Uint64 containing Unix timestamp in UTC timezone. @@ -167,13 +169,9 @@ Payload is always empty for this type. ### Error -~~~ ascii-art - 0 - 0 1 2 3 4 5 6 7 - +-+-+-+-+-+-+-+-+ - | Error Type | - +-+-+-+-+-+-+-+-+ - ~~~ +| Type | Name | +|-------|------------| +| uint8 | error_type | #### Error types @@ -183,68 +181,42 @@ Payload is always empty for this type. ### Handshake -~~~ ascii-art - 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 | ### Auth -~~~ ascii-art - 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 | ### Message -~~~ ascii-art - 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 | ### Test Test payload is used for encoder and decoders testing. Clients and servers should ignore this kind of payload. -~~~ ascii-art - 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 | ## Sequential operations 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