Module control

Module control 

Source
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§

ControlMessage
A decoded TCP control-channel message.
DecodeError
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, so decode_control(encode_control(m)) == m.
encode_frame
Encode a control message as a complete TCP frame (6-byte header plus payload) appended to out. Composes encode_control with write_frame, so decode_frame(parse_frame(encode_frame(m))) == m.