Skip to main content

Module builder

Module builder 

Source
Expand description

ICMP packet builder.

Provides a fluent API for constructing ICMP packets with type-specific fields and automatic checksum calculation.

§Example

use stackforge_core::layer::icmp::IcmpBuilder;

// Build an echo request
let packet = IcmpBuilder::echo_request(0x1234, 1)
    .payload(b"ping data")
    .build();

// Build a destination unreachable message
let packet = IcmpBuilder::dest_unreach(3) // Port unreachable
    .build();

Structs§

IcmpBuilder
Builder for ICMP packets.