Skip to main content

Module checksum

Module checksum 

Source
Expand description

IPv4 header checksum calculation.

Implements RFC 1071 Internet checksum algorithm used for IPv4 headers. The checksum is computed lazily - only when the packet is serialized.

Re-exports§

pub use crate::utils::finalize_checksum;
pub use crate::utils::partial_checksum;

Functions§

incremental_update_checksum
Incrementally update a checksum when a 16-bit field changes.
incremental_update_checksum_32
Incrementally update checksum when a 32-bit field changes.
ipv4_checksum
Compute the Internet checksum (RFC 1071) over a byte slice.
pseudo_header_checksum
Compute the pseudo-header checksum for TCP/UDP.
read_checksum
Read checksum from buffer at the specified offset.
transport_checksum
Compute complete transport layer checksum (TCP or UDP).
verify_ipv4_checksum
Verify that a checksum is valid.
write_checksum
Write checksum to buffer at the specified offset.
zero_checksum
Zero out checksum field in a buffer at the specified offset.