Module udp

Module udp 

Source
Expand description

UDP voice-plane envelope decoding (protobuf format, Mumble 1.5+).

A decrypted UDP packet is a one-byte type header followed by a protobuf message:

[ type: u8 ][ protobuf message ]

REF: references/vendored/protocol/MumbleProtocol.h : MUMBLE_ALL_UDP_MESSAGES (Audio = 0, Ping = 1). REF: MumbleProtocol.cpp : m_byteBuffer[0] = UDPMessageType::Audio/Ping, protobuf encoded from offset 1; UDPDecoder::decode rejects data.size() <= 1.

Only the protobuf format is implemented. The legacy UDP format is out of scope per ADR-0001; a packet whose header is neither Audio nor Ping is rejected rather than guessed (fail closed, R6). This decodes the envelope only: the opus_data payload stays as raw bytes — no Opus decoding happens here.

Input is assumed already decrypted; OCB2 lives in mumble-server-runtime-crypto.

Enums§

UdpDecodeError
Errors from decoding a UDP envelope.
UdpMessage
A decoded UDP voice-plane message.
UdpMessageType
UDP message type register (protobuf format). REF: MumbleProtocol.h : enum class UDPMessageType : byte { Audio = 0, Ping = 1 }.

Functions§

decode_udp
Decode a decrypted UDP packet into a typed UdpMessage.
encode_udp
Encode a UDP voice-plane message to a decrypted packet ([type][protobuf]) — the inverse of decode_udp, so decode_udp(&encode_udp(m)) == Ok(m).