[][src]Function packet::udp::checksum

pub fn checksum<B: AsRef<[u8]>>(ip: &Packet<B>, buffer: &[u8]) -> u16

Calculate the checksum for a UDP packet.

Note

Since the checksum for UDP packets includes a pseudo-header based on the enclosing IP packet, one has to be given.