Skip to main content

Module stun

Module stun 

Source
Expand description

STUN message framing from RFC 8489 section 5.

Constantsยง

ATTRIBUTE_ALIGNMENT_BYTES ๐Ÿ”’
Attributes are padded to 32-bit boundaries, so message length is a multiple of four.
COOKIE_OFFSET ๐Ÿ”’
Magic cookie follows the two-byte type and two-byte length.
HEADER_BYTES ๐Ÿ”’
Fixed STUN header length, including the 96-bit transaction ID.
LENGTH_OFFSET ๐Ÿ”’
Message length follows the two-byte message type.
MAGIC_COOKIE ๐Ÿ”’
Network-order STUN magic cookie identifying the updated message format.

Functionsยง

has_datagram_shape ๐Ÿ”’
Checks framing after the WebRTC multiplexer has selected STUN. Attributes, method validity, integrity and fingerprints remain unchecked.