Function xenet_packet::util::checksum

source ·
pub fn checksum(data: &[u8], skipword: usize) -> u16be
Expand description

Calculates a checksum. Used by ipv4 and icmp. The two bytes starting at skipword * 2 will be ignored. Supposed to be the checksum field, which is regarded as zero during calculation.