fn extract_headers(bytes: Bytes) -> (Ethernet2Header, Ipv4Header, TcpHeader) {
    let (eth2_header, eth2_payload) = Ethernet2Header::parse(bytes).unwrap();
    let (ipv4_header, ipv4_payload) = Ipv4Header::parse(eth2_payload).unwrap();
    let (tcp_header, _) = TcpHeader::parse(&ipv4_header, ipv4_payload, false).unwrap();

    return (eth2_header, ipv4_header, tcp_header);
}
/// Extracts headers of a TCP packet.
Extracts headers of a TCP packet.
Extracts headers of a TCP packet .
fn extract_headers(bytes: Bytes) -> (Ethernet2Header, Ipv4Header, TcpHeader) {
    let (eth2_header, eth2_payload) = Ethernet2Header::parse(bytes).unwrap();
    let (ipv4_header, ipv4_payload) = Ipv4Header::parse(eth2_payload).unwrap();
    let (tcp_header, _) = TcpHeader::parse(&ipv4_header, ipv4_payload, false).unwrap();
    return (eth2_header, ipv4_header, tcp_header);
}
fn extract_headers ( bytes : Bytes ) -> ( Ethernet2Header , Ipv4Header , TcpHeader ) { let ( eth2_header , eth2_payload ) = Ethernet2Header :: parse ( bytes ) . unwrap ( ) ; let ( ipv4_header , ipv4_payload ) = Ipv4Header :: parse ( eth2_payload ) . unwrap ( ) ; let ( tcp_header , _ ) = TcpHeader :: parse ( & ipv4_header , ipv4_payload , false ) . unwrap ( ) ; return ( eth2_header , ipv4_header , tcp_header ) ; }
Extracts headers of a TCP packet.
Extracts headers of a TCP packet .
bytes
Bytes
bytes
Bytes