pub fn send_tcp_ack_syn(&mut self, dst: SocketAddrV4, src_port: u16) -> io::Result<()> {
        let key = (src_port, dst);

        // TCP
        let tcp = Tcp::new_ack_syn(
            dst.ip().clone(),
            self.src_ip_addr,
            dst.port(),
            src_port,
            *self.tcp_sequence_map.get(&key).unwrap_or(&0),
            *self.tcp_acknowledgement_map.get(&key).unwrap_or(&0),
            *self.tcp_window_map.get(&key).unwrap_or(&65535),
        );

        // Send
        self.send_ipv4_with_transport(Layers::Tcp(tcp), None)?;

        // Update TCP sequence
        let tcp_sequence_entry = self.tcp_sequence_map.entry(key).or_insert(0);
        *tcp_sequence_entry = tcp_sequence_entry.checked_add(1).unwrap_or(0);

        Ok(())
    }
/// Sends an TCP ACK/SYN packet.
Sends an TCP ACK/SYN packet.
Sends an TCP ACK / SYN packet .
pub fn send_tcp_ack_syn(&mut self, dst: SocketAddrV4, src_port: u16) -> io::Result<()> {
        let key = (src_port, dst);
        // TCP
        let tcp = Tcp::new_ack_syn(
            dst.ip().clone(),
            self.src_ip_addr,
            dst.port(),
            src_port,
            *self.tcp_sequence_map.get(&key).unwrap_or(&0),
            *self.tcp_acknowledgement_map.get(&key).unwrap_or(&0),
            *self.tcp_window_map.get(&key).unwrap_or(&65535),
        );
        // Send
        self.send_ipv4_with_transport(Layers::Tcp(tcp), None)?;
        // Update TCP sequence
        let tcp_sequence_entry = self.tcp_sequence_map.entry(key).or_insert(0);
        *tcp_sequence_entry = tcp_sequence_entry.checked_add(1).unwrap_or(0);
        Ok(())
    }
pub fn send_tcp_ack_syn ( & mut self , dst : SocketAddrV4 , src_port : u16 ) -> io :: Result < ( ) > { let key = ( src_port , dst ) ; // TCP let tcp = Tcp :: new_ack_syn ( dst . ip ( ) . clone ( ) , self . src_ip_addr , dst . port ( ) , src_port , * self . tcp_sequence_map . get ( & key ) . unwrap_or ( & 0 ) , * self . tcp_acknowledgement_map . get ( & key ) . unwrap_or ( & 0 ) , * self . tcp_window_map . get ( & key ) . unwrap_or ( & 65535 ) , ) ; // Send self . send_ipv4_with_transport ( Layers :: Tcp ( tcp ) , None ) ? ; // Update TCP sequence let tcp_sequence_entry = self . tcp_sequence_map . entry ( key ) . or_insert ( 0 ) ; * tcp_sequence_entry = tcp_sequence_entry . checked_add ( 1 ) . unwrap_or ( 0 ) ; Ok ( ( ) ) }
Sends an TCP ACK/SYN packet.
Sends an TCP ACK / SYN packet .
&mut self
dst
SocketAddrV4
src_port
u16