Expand description
TCP checksum calculation.
TCP uses the Internet checksum (RFC 1071) computed over a pseudo-header followed by the TCP header and payload.
§IPv4 Pseudo-header
+--------+--------+--------+--------+
| Source Address |
+--------+--------+--------+--------+
| Destination Address |
+--------+--------+--------+--------+
| zero | PTCL | TCP Length |
+--------+--------+--------+--------+§IPv6 Pseudo-header
+--------+--------+--------+--------+
| |
+ +
| Source Address |
+ +
| |
+ +
| |
+--------+--------+--------+--------+
| |
+ +
| Destination Address |
+ +
| |
+ +
| |
+--------+--------+--------+--------+
| Upper-Layer Packet Length |
+--------+--------+--------+--------+
| zero |Next Hdr|
+--------+--------+--------+--------+Constants§
- TCP_
PROTOCOL - TCP protocol number for pseudo-header.
Functions§
- ipv4_
pseudo_ header - Build the IPv4 pseudo-header bytes for TCP.
- ipv6_
pseudo_ header - Build the IPv6 pseudo-header bytes for TCP.
- tcp_
checksum - Compute TCP checksum (generic version).
- tcp_
checksum_ ipv4 - Compute TCP checksum with IPv4 pseudo-header.
- tcp_
checksum_ ipv6 - Compute TCP checksum with IPv6 pseudo-header.
- tcp_
partial_ checksum - Compute checksum for partial data (for segmented computation).
- verify_
tcp_ checksum - Verify TCP checksum with IPv4 pseudo-header.
- verify_
tcp_ checksum_ ipv6 - Verify TCP checksum with IPv6 pseudo-header.