fn assert_header_err(hdr_prefix: HeaderPrefix, err: ParseError) {
            let mut buf = &mut hdr_prefix_to_bytes(hdr_prefix)[..];
            NetworkEndian::write_u16(&mut buf[CHECKSUM_OFFSET..], 0);
            let checksum =
                compute_transport_checksum(TEST_SRC_IPV4, TEST_DST_IPV4, IpProto::Tcp.into(), buf)
                    .unwrap();
            buf[CHECKSUM_RANGE].copy_from_slice(&checksum[..]);
            assert_eq!(
                buf.parse_with::<_, TcpSegment<_>>(TcpParseArgs::new(TEST_SRC_IPV4, TEST_DST_IPV4))
                    .unwrap_err(),
                err
            );
        }
// Assert that parsing a particular header prefix results in an error.
// This function is responsible for ensuring that the checksum is
// correct so that checksum errors won't hide the errors we're trying to
// test.
Assert that parsing a particular header prefix results in an error.
This function is responsible for ensuring that the checksum is
correct so that checksum errors won't hide the errors we're trying to
test.
Assert that parsing a particular header prefix results in an error . This function is responsible for ensuring that the checksum is correct so that checksum errors won ' t hide the errors we ' re trying to test .
fn assert_header_err(hdr_prefix: HeaderPrefix, err: ParseError) {
            let mut buf = &mut hdr_prefix_to_bytes(hdr_prefix)[..];
            NetworkEndian::write_u16(&mut buf[CHECKSUM_OFFSET..], 0);
            let checksum =
                compute_transport_checksum(TEST_SRC_IPV4, TEST_DST_IPV4, IpProto::Tcp.into(), buf)
                    .unwrap();
            buf[CHECKSUM_RANGE].copy_from_slice(&checksum[..]);
            assert_eq!(
                buf.parse_with::<_, TcpSegment<_>>(TcpParseArgs::new(TEST_SRC_IPV4, TEST_DST_IPV4))
                    .unwrap_err(),
                err
            );
        }
fn assert_header_err ( hdr_prefix : HeaderPrefix , err : ParseError ) { let mut buf = & mut hdr_prefix_to_bytes ( hdr_prefix ) [ .. ] ; NetworkEndian :: write_u16 ( & mut buf [ CHECKSUM_OFFSET .. ] , 0 ) ; let checksum = compute_transport_checksum ( TEST_SRC_IPV4 , TEST_DST_IPV4 , IpProto :: Tcp . into ( ) , buf ) . unwrap ( ) ; buf [ CHECKSUM_RANGE ] . copy_from_slice ( & checksum [ .. ] ) ; assert_eq ! ( buf parse_with TcpSegment ( TcpParseArgs new ( TEST_SRC_IPV4 TEST_DST_IPV4 ) ) unwrap_err ( ) err ) ; }
Assert that parsing a particular header prefix results in an error.
Assert that parsing a particular header prefix results in an error .
hdr_prefix
HeaderPrefix
err
ParseError
hdr_prefix
HeaderPrefix
err
ParseError