/// Create a new IPv4 header.
Create a new IPv4 header.
Create a new IPv4 header .
pub fn new(
        src: Ipv4Addr,
        dst: Ipv4Addr,
        protocol: u8,
        ttl: u8) -> Ipv4PacketHeader {
        Ipv4PacketHeader {
            version:  4,
            dscp:     0,
            ecn:      0,
            ident:    0,
            flags:    0,
            foffset:  0,
            ttl:      ttl,
            protocol: protocol,
            src:      src,
            dst:      dst,
            options:  Vec::new(),
            length:   0
        }
    }
pub fn new ( src : Ipv4Addr , dst : Ipv4Addr , protocol : u8 , ttl : u8 ) -> Ipv4PacketHeader { Ipv4PacketHeader { version : 4 , dscp : 0 , ecn : 0 , ident : 0 , flags : 0 , foffset : 0 , ttl : ttl , protocol : protocol , src : src , dst : dst , options : Vec :: new ( ) , length : 0 } }
Create a new IPv4 header.
Create a new IPv4 header .
src
Ipv4Addr
dst
Ipv4Addr
protocol
u8
ttl
u8