Change the protocol definition for tape to conform to #2

This commit is contained in:
Sasha Koshka 2025-05-15 17:49:29 -04:00
parent 83443b8c88
commit 835d623087

View File

@ -35,25 +35,17 @@ fucking with you.
## Table Pair Encoding (TAPE) ## Table Pair Encoding (TAPE)
The Table Pair Encoding (TAPE) scheme is a method for encoding structured data The Table Pair Encoding (TAPE) scheme is a method for encoding structured data
within HOPP messages. It defines standard binary encoding methods for common within HOPP messages. It defines standard binary encoding methods for common
data types, as well as a corruption-resistant table structure that maps numeric data types, as well as aggregate data types such as tables and arrays. It is
IDs to values. It is designed to allow applications to be presented with data designed to allow applications to be presented with data they are not equipped
they are not equipped to handle while continuing to function normally. This to handle while continuing to function normally. This enables backwards
enables backwards compatibile application protocol changes. compatibile application protocol changes.
### Table Structure The length of a TAPE structure is assumed to be given by the surrounding
A table is divided into two sections: the header, and the values. The header protocol, which is usually METADAPT-A or B. The root of a TAPE structure can be
begins with the number (U16) of pairs in the table, which is then followed by any data value, but is usually a table, which can contain several values that
that many tag-offset pairs. A tag-offset pair consists of a numerical (U16) tag, each have a numeric key. Values can also be nested. Both sides of the connection
followed the position (U16) of the value relative to the start of the values must agree on what data type should be the root value, the data type of each
section. The values section contains the value data for each pair, where the known table value, etc.
start of each value is determined by its offset, and the end is determined by
the offset of the next value, or the end of the message if there is no value
after it.
Both sections must be in the same order, and because of this, each value offset
must be greater than or equal to the last. If a message has erratic structure
(such as unordered or out-of-bounds offsets), implementations may opt to discard
only the erratic pairs, as well as the pairs directly before those.
### Data Value Types ### Data Value Types
The table below lists all data value types supported by TAPE. The table below lists all data value types supported by TAPE.