Add the framing layer that turns typed control messages into bytes for reliable QUIC streams. This keeps the codec next to the control schema while leaving the actual QUIC read/write loops for a later relay/client/gateway slice. The codec uses a four-byte big-endian length prefix followed by JSON. JSON is a phase-1 choice for inspectability during manual tunnel bring-up; the explicit length prefix keeps stream parsing deterministic and the 64 KiB cap prevents a peer from announcing unbounded control payloads. Decoding validates the message after deserialization so forged stream bytes cannot bypass constructor checks. The next networking slice can use complete_control_frame_len to split a stream buffer and decode_control_frame once a complete frame is available. Test Plan: - cargo fmt --check - cargo test --workspace - cargo clippy --workspace --all-targets -- -D warnings Refs: PLAN.md reliable QUIC control stream requirements
12 lines
269 B
TOML
12 lines
269 B
TOML
[package]
|
|
name = "lanparty-ctrl"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
|
|
[dependencies]
|
|
lanparty-obs = { path = "../lanparty-obs" }
|
|
lanparty-proto = { path = "../lanparty-proto" }
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
thiserror.workspace = true
|