pub struct SnifferConfig {
pub iface: String,
pub filter: Option<String>,
pub count: usize,
pub timeout: Option<Duration>,
pub snaplen: i32,
pub promisc: bool,
pub channel_capacity: usize,
}Expand description
Configuration for a packet capture session.
Fields§
§iface: StringNetwork interface name (e.g., “en0”, “eth0”, “lo0”).
filter: Option<String>BPF filter string (e.g., “tcp port 80”).
count: usizeMaximum number of packets to capture. 0 means unlimited.
timeout: Option<Duration>Capture timeout. None means no timeout.
snaplen: i32Snapshot length — max bytes captured per packet.
promisc: boolWhether to enable promiscuous mode.
channel_capacity: usizeChannel buffer capacity (number of packets).
Implementations§
Source§impl SnifferConfig
impl SnifferConfig
pub fn new(iface: impl Into<String>) -> Self
pub fn filter(self, filter: impl Into<String>) -> Self
pub fn count(self, count: usize) -> Self
pub fn timeout(self, timeout: Duration) -> Self
pub fn snaplen(self, snaplen: i32) -> Self
pub fn promisc(self, promisc: bool) -> Self
pub fn channel_capacity(self, capacity: usize) -> Self
Trait Implementations§
Source§impl Clone for SnifferConfig
impl Clone for SnifferConfig
Source§fn clone(&self) -> SnifferConfig
fn clone(&self) -> SnifferConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SnifferConfig
impl Debug for SnifferConfig
Auto Trait Implementations§
impl Freeze for SnifferConfig
impl RefUnwindSafe for SnifferConfig
impl Send for SnifferConfig
impl Sync for SnifferConfig
impl Unpin for SnifferConfig
impl UnsafeUnpin for SnifferConfig
impl UnwindSafe for SnifferConfig
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