Skip to main content

encode_frame

Function encode_frame 

Source
pub fn encode_frame(source_mac: [u8; 6], payload: &[u8]) -> Result<Vec<u8>>
Expand description

Wrap a CDP payload in the 802.3 + LLC/SNAP header addressed to the CDP multicast group.

The 802.3 length field carries the true length of everything after it (LLC + SNAP + payload). No padding to the 60-byte Ethernet minimum is added: on both transports something else is responsible for it — a NIC pads on transmit, and the UDP test transport has no minimum at all — and padding here would make the emitted bytes differ from the bytes the codec tests assert.