pub fn parse(packet: &Ipv4Packet) -> Ipv4 {
        Ipv4 {
            layer: ipv4::Ipv4 {
                version: packet.get_version(),
                header_length: packet.get_header_length(),
                dscp: packet.get_dscp(),
                ecn: packet.get_ecn(),
                total_length: packet.get_total_length(),
                identification: packet.get_identification(),
                flags: packet.get_flags(),
                fragment_offset: packet.get_fragment_offset(),
                ttl: packet.get_ttl(),
                next_level_protocol: packet.get_next_level_protocol(),
                checksum: packet.get_checksum(),
                source: packet.get_source(),
                destination: packet.get_destination(),
                options: packet.get_options(),
                payload: vec![],
            },
        }
    }
/// Creates an `Ipv4` according to the given IPv4 packet.
Creates an `Ipv4` according to the given IPv4 packet.
Creates an ` Ipv4 ` according to the given IPv4 packet .
pub fn parse(packet: &Ipv4Packet) -> Ipv4 {
        Ipv4 {
            layer: ipv4::Ipv4 {
                version: packet.get_version(),
                header_length: packet.get_header_length(),
                dscp: packet.get_dscp(),
                ecn: packet.get_ecn(),
                total_length: packet.get_total_length(),
                identification: packet.get_identification(),
                flags: packet.get_flags(),
                fragment_offset: packet.get_fragment_offset(),
                ttl: packet.get_ttl(),
                next_level_protocol: packet.get_next_level_protocol(),
                checksum: packet.get_checksum(),
                source: packet.get_source(),
                destination: packet.get_destination(),
                options: packet.get_options(),
                payload: vec![],
            },
        }
    }
pub fn parse ( packet : & Ipv4Packet ) -> Ipv4 { Ipv4 { layer : ipv4 :: Ipv4 { version : packet . get_version ( ) , header_length : packet . get_header_length ( ) , dscp : packet . get_dscp ( ) , ecn : packet . get_ecn ( ) , total_length : packet . get_total_length ( ) , identification : packet . get_identification ( ) , flags : packet . get_flags ( ) , fragment_offset : packet . get_fragment_offset ( ) , ttl : packet . get_ttl ( ) , next_level_protocol : packet . get_next_level_protocol ( ) , checksum : packet . get_checksum ( ) , source : packet . get_source ( ) , destination : packet . get_destination ( ) , options : packet . get_options ( ) , payload : vec ! [ ] , } , } }
Creates an `Ipv4` according to the given IPv4 packet.
Creates an ` Ipv4 ` according to the given IPv4 packet .
packet
&Ipv4Packet