/// Create a new ARP packet for IPv4 over Ethernet.
Create a new ARP packet for IPv4 over Ethernet.
Create a new ARP packet for IPv4 over Ethernet .
pub fn ipv4_over_ethernet(
        oper: ArpOperation, 
        sha: &MacAddr, 
        spa: &Ipv4Addr,
        tha: &MacAddr,
        tpa: &Ipv4Addr) -> ArpPacket {
        ArpPacket {
            htype: ARP_HTYPE_EHER,
            ptype: ARP_PTYPE_IPV4,
            hlen:  6,
            plen:  4,
            oper:  oper,
            sha:   sha.octets().to_vec(),
            spa:   spa.octets().to_vec(),
            tha:   tha.octets().to_vec(),
            tpa:   tpa.octets().to_vec()
        }
    }
pub fn ipv4_over_ethernet ( oper : ArpOperation , sha : & MacAddr , spa : & Ipv4Addr , tha : & MacAddr , tpa : & Ipv4Addr ) -> ArpPacket { ArpPacket { htype : ARP_HTYPE_EHER , ptype : ARP_PTYPE_IPV4 , hlen : 6 , plen : 4 , oper : oper , sha : sha . octets ( ) . to_vec ( ) , spa : spa . octets ( ) . to_vec ( ) , tha : tha . octets ( ) . to_vec ( ) , tpa : tpa . octets ( ) . to_vec ( ) } }
Create a new ARP packet for IPv4 over Ethernet.
Create a new ARP packet for IPv4 over Ethernet .
oper
ArpOperation
sha
&MacAddr
spa
&Ipv4Addr
tha
&MacAddr
tpa
&Ipv4Addr