Function caracat::builder::build_icmp

source ·
pub fn build_icmp(
    packet: &mut Packet<'_>,
    target_checksum: u16,
    target_sequence: u16
)
Expand description

Build the ICMP Echo Request header and payload.

In the ICMP echo header, the code and checksum fields are used for per-flow load-balancing. We encode the flow ID in the checksum field to vary the flow ID, and in the id field. We encode the timestamp in the sequence field. Since echo replies, in contrast to destination unreachable messages, doesn’t contain the original probe packet (including the original TTL and flow ID), we ignore them in the packet parser.