Expand description
Typed decoding of TCP control-channel messages.
decode_control maps a framed message (type code plus payload) to a typed
ControlMessage. Every type prost-decodes its payload except one:
REF: references/vendored/Mumble.proto : message UDPTunnel — “Not used”.
REF: references/vendored/protocol/Connection.cpp / ServerHandler.cpp : a TCP
frame of type UDPTunnel (1) carries a raw UDP audio packet at offset 6,
NOT an encoded UDPTunnel protobuf message. ControlMessage::UdpTunnel
therefore holds the raw bytes verbatim. udp_tunnel_* tests below fail if
this special case is ever “fixed” into a protobuf decode.
Enums§
- Control
Message - A decoded TCP control-channel message.
- Decode
Error - Errors from decoding a control-channel message.
Functions§
- decode_
control - Decode a control-channel message from a raw type code and payload.
- decode_
frame - Decode a control-channel message directly from a parsed
Frame. - encode_
control - Encode a control message to its wire type code and payload — the inverse of
decode_control, sodecode_control(encode_control(m)) == m. - encode_
frame - Encode a control message as a complete TCP frame (6-byte header plus payload)
appended to
out. Composesencode_controlwithwrite_frame, sodecode_frame(parse_frame(encode_frame(m))) == m.