stackforge_core/pcap/
mod.rs1pub mod reader;
7pub mod writer;
8
9use std::time::Duration;
10
11use crate::Packet;
12
13#[derive(Debug, Clone, Default)]
15pub struct PcapMetadata {
16 pub timestamp: Duration,
18 pub orig_len: u32,
20}
21
22#[derive(Debug, Clone)]
24pub struct CapturedPacket {
25 pub packet: Packet,
27 pub metadata: PcapMetadata,
29}
30
31#[derive(Debug, Clone, Copy, PartialEq, Eq)]
33pub struct LinkType(pub u32);
34
35impl LinkType {
36 pub const ETHERNET: Self = Self(1);
37 pub const RAW: Self = Self(101);
38 pub const LINUX_SLL: Self = Self(113);
39}
40
41pub use reader::{PcapIterator, rdpcap};
42pub use writer::{wrpcap, wrpcap_packets};