Function libpacket::udp::ipv4_checksum_adv[][src]

pub fn ipv4_checksum_adv(
    packet: &UdpPacket<'_>,
    extra_data: &[u8],
    source: &Ipv4Addr,
    destination: &Ipv4Addr
) -> u16be
Expand description

Calculate a checksum for a packet built on IPv4. Advanced version which accepts an extra slice of data that will be included in the checksum as being part of the data portion of the packet.

If packet contains an odd number of bytes the last byte will not be counted as the first byte of a word together with the first byte of extra_data.