Structs§
- Fragment
Header - Parsed representation of the 10-byte fragment metadata header.
- Frame
Constants§
- COMPRESS_
THRESHOLD - Payloads at or above this size are candidates for zstd compression.
- FLAG_
COMPRESSED - Payload is zstd-compressed. Decompressed by framing layer before delivery. CRC32 is computed over the compressed bytes (what is on the wire).
- FLAG_
FRAGMENTED - Frame is one fragment of a larger message. The first
FRAG_HEADER_SIZEbytes of the payload contain fragment metadata; the remainder is the chunk. - FLAG_
MAC_ PRESENT flagsbit indicating a 32-byte HMAC tag is appended after the payload.- FLAG_
RAW_ BINARY - Payload is raw binary (PCM/Opus audio). Router skips Protobuf decode.
- FRAG_
HEADER_ SIZE - Byte length of the fragment metadata header embedded at the start of a
fragmented frame’s payload when
FLAG_FRAGMENTEDis set. - MAX_
PAYLOAD_ SIZE
Functions§
- parse_
frag_ header - Parses the
FragmentHeaderfrom the start of a frame payload. ReturnsNoneif the payload is shorter thanFRAG_HEADER_SIZE. - read_
frame - read_
frame_ with_ timeout - serialize_
header - Serialize the 44-byte frame header exactly as it goes on the wire. Used by
both
write_frame_rawand MAC computation so the tag covers the real bytes. - target_
as_ str - Returns
Noneif the target bytes are not valid UTF-8. Callers must log the raw hex and return an error frame in that case (VULN-022). - write_
frame - write_
frame_ raw