Skip to main content

Module checksum

Module checksum 

Source
Expand description

UDP checksum calculation and verification.

UDP uses the same pseudo-header as TCP for checksum calculation. For IPv4, the checksum is optional (can be 0), but for IPv6 it’s mandatory. Per RFC 768, if the computed checksum is 0, it should be set to 0xFFFF.

Functions§

udp_checksum_ipv4
Calculate UDP checksum with IPv4 pseudo-header.
udp_checksum_ipv6
Calculate UDP checksum with IPv6 pseudo-header.
verify_udp_checksum_ipv4
Verify UDP checksum with IPv4 pseudo-header.
verify_udp_checksum_ipv6
Verify UDP checksum with IPv6 pseudo-header.