pub struct Config {
pub interface: String,
pub promiscuous: bool,
pub inbound_only: bool,
pub recv_buffer: usize,
pub poll_interval: Duration,
}Available on crate feature
afpacket only.Expand description
How to open an Socket.
Fields§
§interface: StringInterface to bind to, e.g. eth0. Required.
promiscuous: boolPut the interface into promiscuous mode, so frames addressed to other stations are delivered too. Reverted when the socket is closed.
inbound_only: boolDeliver only frames the interface received, hiding those the host sent.
Off by default, matching what tcpdump shows.
recv_buffer: usizeKernel receive buffer in bytes; 0 leaves the system default. Raising this is the first thing to try when the drop counter climbs under load.
poll_interval: DurationHow long a blocked read waits before checking whether the socket has
been closed. Lower is a more responsive close,
higher is fewer wakeups on an idle link.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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