net_replay/
lib.rs

1//! Capture and replay TCP connections
2//!
3//! Parts of this library only work on Linux. Specifically, the raw socket implementation uses Linux specific apis
4//! that aren't supported on other OSes. The other parts of this library, the replay and ip packet modules, solely
5//! depend on the rust standard library and can be used in any normal environment.
6//!
7//! This library implements a [`Raw`] socket that can be used to snoop IP packets on an interface and capture all of
8//! the network traffic. That socket implementation only supports reading via [`std::io::Read`]. **This module will
9//! require root privileges or raw network capabilities to work**.
10//!
11//! Use the [`capture`] module to capture the traffic you are interested in. **This module uses the raw socket and
12//! therefore requires the same kind of privileges**.
13//!
14//! The [`ip`] module can be used to save and load captured packets using pcap files.
15//!
16//! Lastly, [`replay`] can be used to replay a captured TCP stream to any host.
17
18pub mod ip;
19#[cfg(target_os="linux")]
20pub mod capture;
21pub mod replay;
22#[cfg(target_os="linux")]
23pub mod sock;