packet_formats::testutil

Function parse_ethernet_frame

Source
pub fn parse_ethernet_frame(
    buf: &[u8],
    ethernet_length_check: EthernetFrameLengthCheck,
) -> ParseResult<(&[u8], Mac, Mac, Option<EtherType>)>
Expand description

Parse an ethernet frame.

parse_ethernet_frame parses an ethernet frame, returning the body along with some important header fields.