pub struct PacketRecord {
pub timestamp_ns: u64,
pub src_ip: Option<IpAddr>,
pub dst_ip: Option<IpAddr>,
pub src_port: Option<u16>,
pub dst_port: Option<u16>,
pub protocol: Option<u8>,
pub flow_id: Option<u64>,
pub caplen: u32,
pub origlen: u32,
pub tcp_flags: Option<u8>,
pub payload: Vec<u8>,
}Expand description
A single packet record ready for serialisation.
Fields§
§timestamp_ns: u64Timestamp in nanoseconds since the Unix epoch.
src_ip: Option<IpAddr>Source IP address (IPv4 or IPv6), if available.
dst_ip: Option<IpAddr>Destination IP address, if available.
src_port: Option<u16>Source port (TCP/UDP only).
dst_port: Option<u16>Destination port (TCP/UDP only).
protocol: Option<u8>IP protocol number (6=TCP, 17=UDP, …).
flow_id: Option<u64>Deterministic 64-bit flow ID.
caplen: u32Captured packet length (bytes stored in the file).
origlen: u32Original wire length.
tcp_flags: Option<u8>TCP control-flags bitmask; None for non-TCP traffic.
payload: Vec<u8>Raw captured bytes (Ethernet frame payload up to snap length).
Trait Implementations§
Source§impl Clone for PacketRecord
impl Clone for PacketRecord
Source§fn clone(&self) -> PacketRecord
fn clone(&self) -> PacketRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PacketRecord
impl RefUnwindSafe for PacketRecord
impl Send for PacketRecord
impl Sync for PacketRecord
impl Unpin for PacketRecord
impl UnsafeUnpin for PacketRecord
impl UnwindSafe for PacketRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more