Expand description
RedWire — RedDB’s binary TCP / TLS wire protocol with auth handshake, multiplex, compression, and version negotiation.
See .red/adr/0001-redwire-tcp-protocol.md. The protocol is
gated on a 0xFE startup magic byte so the listener can share
a port with HTTP and gRPC behind the service router.
Layered API:
frame— frame struct + MessageKind + flagscodec— encode/decode (16-byte header + payload)auth— handshake state machinesession— per-connection dispatch looplistener— TCP / TLS / Unix accept
Modules§
- auth
- Handshake state machine + auth method dispatch.
- input_
stream - RedWire input-stream dispatch (issue #764, PRD #759 S5).
- listener
- TCP / TLS / Unix listeners for the RedWire protocol.
- output_
stream - RedWire output-stream dispatch (issue #762, PRD #759 S3).
- queue_
wait - RedWire live queue-wait dispatch (issue #917, PRD #915).
- session
- Per-connection RedWire session: handshake → frame loop → bye.
Structs§
- Flags
- Frame
- Frame
Builder - Builder for RedWire
Frames. - RedWire
Config
Enums§
- Build
Error - Errors surfaced at
build()time so they fail at construction rather than at encode time, where the call site has already lost the context to recover. - Frame
Error - Message
Kind - Single-byte message-kind discriminator. Numeric values are part of the wire spec — never repurpose a value once shipped.
Constants§
- DEFAULT_
REDWIRE_ PORT - Default port for the RedWire listener.
- FRAME_
HEADER_ SIZE - MAX_
FRAME_ SIZE - MAX_
KNOWN_ MINOR_ VERSION - Highest minor version the server supports. Wire-bumped as we
add features that change the handshake; data-plane additions
flow through
Hello.featuresinstead. - REDWIRE_
MAGIC - Discriminator byte every RedWire client sends as the very first byte off the wire. The service-router detector keys off this (and so does the standalone listener path).
Functions§
- decode_
frame - encode_
frame - start_
redwire_ listener - Start a plain-TCP RedWire listener on the configured bind addr.
- start_
redwire_ listener_ on - Start a RedWire listener on an already-bound TCP listener (used by
the server bootstrap when binding the user-facing wire
port directly; the shared-port demux instead dispatches per connection
through
handle_router_connection). - start_
redwire_ tls_ listener - Start a RedWire listener wrapped in TLS.
- start_
redwire_ tls_ listener_ on - Start a TLS RedWire listener on an already-bound TCP listener. Mirror
of
start_redwire_listener_onfor the TLS edge — lets a caller pick the bound address (e.g. an ephemeral127.0.0.1:0port) before serving. - start_
redwire_ unix_ listener - Start a RedWire listener on a Unix domain socket.
- validate_
minor_ version - validate_
startup_ magic