Skip to main content

Module replay

Module replay 

Source
Expand description

Live packet replay onto a real network interface.

Reads packets from a PCAP file and injects them via a raw AF_PACKET socket (Linux only) using the original or a scaled inter-packet timing.

§Timing modes

CLI flagBehaviour
(none)Real-time: honour original inter-packet gaps
--speed 2.0Multiplier: replay 2× faster than original
--speed maxNo delay — transmit as fast as the NIC allows
--pps 4096Fixed rate: 4 096 packets/second, ignores gaps

§Permissions

Raw sockets require CAP_NET_RAW. If the capability is absent the function returns ReplayError::PermissionDenied with a remediation hint.

Structs§

ReplayOptions
Options for replay_file.
ReplayReport
Summary returned by replay_file on success.

Enums§

ReplaySpeed
How to pace packet transmission during replay.

Functions§

replay_file
Replay all packets from input onto the network interface in opts.