Expand description
WireForge IO — cross-platform raw socket I/O for packet capture and injection.
§Platform Support
| Platform | L2 Capture | L3 Capture | Backend |
|---|---|---|---|
| Linux | AF_PACKET | raw socket | socket2 + libc |
| macOS | BPF | raw socket | /dev/bpf + libc |
| Windows | NPcap | raw socket | npcap crate |
§Quick Start
let mut rx = DefaultL2Reader::new("eth0")?;
let eth = rx.recv()?;
println!("EtherType: {:?}", eth.ethertype());§Permissions
L2 capture requires root (Linux/macOS) or Administrator (Windows).
list_interfaces() does not require elevated privileges.
Re-exports§
pub use linux::L2Receiver;pub use linux::L2Sender;pub use linux::L3Receiver;pub use linux::L3Sender;
Modules§
- linux
- Linux platform implementation — AF_PACKET L2 and raw socket L3.
- traits
- Platform-independent I/O traits for L2/L3 packet capture and injection.
Structs§
- Interface
- Information about a network interface.
Enums§
- IoError
- I/O error type for wireforge-io.
Functions§
- list_
interfaces - List all available network interfaces on the system.
Type Aliases§
- Default
L2Reader - The default L2 frame reader for the current platform.
- Default
L2Writer - The default L2 frame sender for the current platform.
- Default
L3Reader - The default L3 IPv4 packet reader for the current platform.
- Default
L3Writer - The default L3 IPv4 packet sender for the current platform.