pub fn decode_frame(frame: &[u8]) -> Result<(FrameHeader, &[u8])>Expand description
Split a complete Ethernet frame into its header and the CDP payload.
The LLC/SNAP header is checked byte for byte — DSAP, SSAP, control, OUI and protocol id — so anything that is not CDP is rejected here rather than being handed to the TLV parser. The 802.3 length field is not enforced against the captured length: a captured frame is padded to the Ethernet minimum and may be truncated by the snaplen, so requiring agreement would reject real traffic. It is reported instead, and the TLV walk is bounded by the bytes actually present.