Expand description
Network Address Translation (NAT) engine
Supports SNAT (source NAT), DNAT (destination NAT), and IP masquerading. Uses a port pool with bitmap allocation for ephemeral port assignment. Implements RFC 1624 incremental checksum updates to avoid full recalculation when translating addresses.
Structs§
- NatEngine
- The NAT engine managing translations and port allocation
- NatMapping
- A single NAT mapping recording original and translated addresses
- Port
Pool - Bitmap-based ephemeral port allocator for NAT
Enums§
- NatType
- Type of NAT translation
Functions§
- init
- Initialize the NAT engine
- update_
checksum - Incrementally update a one’s complement checksum when a 16-bit value changes.
- update_
checksum_ 32 - Update checksum for a 32-bit (IP address) change, processing two 16-bit halves
- with_
nat - Access the global NAT engine