Skip to main content

calculate_checksum

Function calculate_checksum 

Source
pub fn calculate_checksum(buffer: &[u8], pseudo_header: &PseudoHeader) -> u16
Expand description

Calculate the checksum for a UDP/TCP packet.

ยงArguments

  • buffer - the UDP/TCP packet as bytes (without the IP header)
  • pseudo_header - the pseudo header for this packet (IPv4 or IPv6)