fn check_packet_pure_ack_on_syn_ack(
    bytes: Bytes,
    eth2_src_addr: MacAddress,
    eth2_dst_addr: MacAddress,
    ipv4_src_addr: Ipv4Addr,
    ipv4_dst_addr: Ipv4Addr,
    dst_port: Port,
) {
    let (eth2_header, eth2_payload) = Ethernet2Header::parse(bytes).unwrap();
    assert_eq!(eth2_header.src_addr, eth2_src_addr);
    assert_eq!(eth2_header.dst_addr, eth2_dst_addr);
    assert_eq!(eth2_header.ether_type, EtherType2::Ipv4);
    let (ipv4_header, ipv4_payload) = Ipv4Header::parse(eth2_payload).unwrap();
    assert_eq!(ipv4_header.src_addr, ipv4_src_addr);
    assert_eq!(ipv4_header.dst_addr, ipv4_dst_addr);
    let (tcp_header, _) = TcpHeader::parse(&ipv4_header, ipv4_payload, false).unwrap();
    assert_eq!(tcp_header.dst_port, dst_port);
    assert_eq!(tcp_header.seq_num, Wrapping(1));
    assert_eq!(tcp_header.ack_num, Wrapping(1));
    assert_eq!(tcp_header.ack, true);
}
/// Checks for a pure ACK on a SYN+ACK packet. This packet is sent by the sender
/// side (active open peer) when transitioning from the SYN_SENT state to the
/// ESTABLISHED state.
Checks for a pure ACK on a SYN+ACK packet. This packet is sent by the sender
side (active open peer) when transitioning from the SYN_SENT state to the
ESTABLISHED state.
Checks for a pure ACK on a SYN + ACK packet . This packet is sent by the sender side ( active open peer ) when transitioning from the SYN_SENT state to the ESTABLISHED state .
fn check_packet_pure_ack_on_syn_ack(
    bytes: Bytes,
    eth2_src_addr: MacAddress,
    eth2_dst_addr: MacAddress,
    ipv4_src_addr: Ipv4Addr,
    ipv4_dst_addr: Ipv4Addr,
    dst_port: Port,
) {
    let (eth2_header, eth2_payload) = Ethernet2Header::parse(bytes).unwrap();
    assert_eq!(eth2_header.src_addr, eth2_src_addr);
    assert_eq!(eth2_header.dst_addr, eth2_dst_addr);
    assert_eq!(eth2_header.ether_type, EtherType2::Ipv4);
    let (ipv4_header, ipv4_payload) = Ipv4Header::parse(eth2_payload).unwrap();
    assert_eq!(ipv4_header.src_addr, ipv4_src_addr);
    assert_eq!(ipv4_header.dst_addr, ipv4_dst_addr);
    let (tcp_header, _) = TcpHeader::parse(&ipv4_header, ipv4_payload, false).unwrap();
    assert_eq!(tcp_header.dst_port, dst_port);
    assert_eq!(tcp_header.seq_num, Wrapping(1));
    assert_eq!(tcp_header.ack_num, Wrapping(1));
    assert_eq!(tcp_header.ack, true);
}
fn check_packet_pure_ack_on_syn_ack ( bytes : Bytes , eth2_src_addr : MacAddress , eth2_dst_addr : MacAddress , ipv4_src_addr : Ipv4Addr , ipv4_dst_addr : Ipv4Addr , dst_port : Port , ) { let ( eth2_header , eth2_payload ) = Ethernet2Header :: parse ( bytes ) . unwrap ( ) ; assert_eq ! ( eth2_header src_addr eth2_src_addr ) ; assert_eq ! ( eth2_header dst_addr eth2_dst_addr ) ; assert_eq ! ( eth2_header ether_type EtherType2 Ipv4 ) ; let ( ipv4_header , ipv4_payload ) = Ipv4Header :: parse ( eth2_payload ) . unwrap ( ) ; assert_eq ! ( ipv4_header src_addr ipv4_src_addr ) ; assert_eq ! ( ipv4_header dst_addr ipv4_dst_addr ) ; let ( tcp_header , _ ) = TcpHeader :: parse ( & ipv4_header , ipv4_payload , false ) . unwrap ( ) ; assert_eq ! ( tcp_header dst_port dst_port ) ; assert_eq ! ( tcp_header seq_num Wrapping ( 1 ) ) ; assert_eq ! ( tcp_header ack_num Wrapping ( 1 ) ) ; assert_eq ! ( tcp_header ack true ) ; }
Checks for a pure ACK on a SYN+ACK packet.
Checks for a pure ACK on a SYN + ACK packet .
bytes
Bytes
eth2_src_addr
MacAddress
eth2_dst_addr
MacAddress
ipv4_src_addr
Ipv4Addr
ipv4_dst_addr
Ipv4Addr
dst_port
Port
bytes
Bytes
eth2_src_addr
MacAddress
eth2_dst_addr
MacAddress
ipv4_src_addr
Ipv4Addr
ipv4_dst_addr
Ipv4Addr
dst_port
Port