fn extract_echo_request(payload: &[u8]) -> TraceResult<EchoRequestPacket<'_>> {
    let ip4 = Ipv4Packet::new(payload).req()?;
    let header_len = usize::from(ip4.get_header_length() * 4);
    let nested_icmp = &payload[header_len..];
    let nested_echo = EchoRequestPacket::new(nested_icmp).req()?;
    Ok(nested_echo)
}
/// Get the original `EchoRequestPacket` packet embedded in the payload.
Get the original `EchoRequestPacket` packet embedded in the payload.
Get the original ` EchoRequestPacket ` packet embedded in the payload .
fn extract_echo_request(payload: &[u8]) -> TraceResult<EchoRequestPacket<'_>> {
    let ip4 = Ipv4Packet::new(payload).req()?;
    let header_len = usize::from(ip4.get_header_length() * 4);
    let nested_icmp = &payload[header_len..];
    let nested_echo = EchoRequestPacket::new(nested_icmp).req()?;
    Ok(nested_echo)
}
fn extract_echo_request ( payload : & [ u8 ] ) -> TraceResult < EchoRequestPacket < ' _ > > { let ip4 = Ipv4Packet :: new ( payload ) . req ( ) ? ; let header_len = usize :: from ( ip4 . get_header_length ( ) * 4 ) ; let nested_icmp = & payload [ header_len .. ] ; let nested_echo = EchoRequestPacket :: new ( nested_icmp ) . req ( ) ? ; Ok ( nested_echo ) }
Get the original `EchoRequestPacket` packet embedded in the payload.
Get the original ` EchoRequestPacket ` packet embedded in the payload .
payload
&[u8]