pub fn parse(packet: &TcpPacket, src: Ipv4Addr, dst: Ipv4Addr) -> Tcp {
        Tcp {
            layer: tcp::Tcp {
                source: packet.get_source(),
                destination: packet.get_destination(),
                sequence: packet.get_sequence(),
                acknowledgement: packet.get_acknowledgement(),
                data_offset: packet.get_data_offset(),
                reserved: packet.get_reserved(),
                flags: packet.get_flags(),
                window: packet.get_window(),
                checksum: packet.get_checksum(),
                urgent_ptr: packet.get_urgent_ptr(),
                options: packet.get_options(),
                payload: vec![],
            },
            src,
            dst,
        }
    }
/// Creates a `Tcp` according to the given TCP packet, source and destination.
Creates a `Tcp` according to the given TCP packet, source and destination.
Creates a ` Tcp ` according to the given TCP packet source and destination .
pub fn parse(packet: &TcpPacket, src: Ipv4Addr, dst: Ipv4Addr) -> Tcp {
        Tcp {
            layer: tcp::Tcp {
                source: packet.get_source(),
                destination: packet.get_destination(),
                sequence: packet.get_sequence(),
                acknowledgement: packet.get_acknowledgement(),
                data_offset: packet.get_data_offset(),
                reserved: packet.get_reserved(),
                flags: packet.get_flags(),
                window: packet.get_window(),
                checksum: packet.get_checksum(),
                urgent_ptr: packet.get_urgent_ptr(),
                options: packet.get_options(),
                payload: vec![],
            },
            src,
            dst,
        }
    }
pub fn parse ( packet : & TcpPacket , src : Ipv4Addr , dst : Ipv4Addr ) -> Tcp { Tcp { layer : tcp :: Tcp { source : packet . get_source ( ) , destination : packet . get_destination ( ) , sequence : packet . get_sequence ( ) , acknowledgement : packet . get_acknowledgement ( ) , data_offset : packet . get_data_offset ( ) , reserved : packet . get_reserved ( ) , flags : packet . get_flags ( ) , window : packet . get_window ( ) , checksum : packet . get_checksum ( ) , urgent_ptr : packet . get_urgent_ptr ( ) , options : packet . get_options ( ) , payload : vec ! [ ] , } , src , dst , } }
Creates a `Tcp` according to the given TCP packet, source and destination.
Creates a ` Tcp ` according to the given TCP packet source and destination .
packet
&TcpPacket
src
Ipv4Addr
dst
Ipv4Addr