Skip to main content

encode_binding_request

Function encode_binding_request 

Source
pub fn encode_binding_request(transaction_id: &[u8; 12]) -> Vec<u8> 
Expand description

Encode a STUN Binding request: a 20-byte header (type, length = 0, cookie, the 96-bit transaction id) and no attributes. transaction_id is caller-supplied so the response can later be matched to this request (SPEC.md §2.3).

Golden vector: for id 00 01 02 03 04 05 06 07 08 09 0a 0b this returns 00 01 00 00 21 12 a4 42 00 01 02 03 04 05 06 07 08 09 0a 0b (20 bytes) — proven byte-exact in tests/codec.rs.