Struct ntap_core::net::pcap::PacketCaptureOptions
source · pub struct PacketCaptureOptions {Show 14 fields
pub interface_index: u32,
pub interface_name: String,
pub src_ips: HashSet<IpAddr>,
pub dst_ips: HashSet<IpAddr>,
pub src_ports: HashSet<u16>,
pub dst_ports: HashSet<u16>,
pub ether_types: HashSet<EtherType>,
pub ip_protocols: HashSet<IpNextLevelProtocol>,
pub capture_timeout: Duration,
pub read_timeout: Duration,
pub promiscuous: bool,
pub receive_undefined: bool,
pub tunnel: bool,
pub loopback: bool,
}
Expand description
Packet capture options
Fields§
§interface_index: u32
Interface index
interface_name: String
Interface name
src_ips: HashSet<IpAddr>
Source IP addresses to filter. If empty, all source IP addresses will be captured
dst_ips: HashSet<IpAddr>
Destination IP addresses to filter. If empty, all destination IP addresses will be captured
src_ports: HashSet<u16>
Source ports to filter. If empty, all source ports will be captured
dst_ports: HashSet<u16>
Destination ports to filter. If empty, all destination ports will be captured
ether_types: HashSet<EtherType>
Ether types to filter. If empty, all ether types will be captured
ip_protocols: HashSet<IpNextLevelProtocol>
IP protocols to filter. If empty, all IP protocols will be captured
capture_timeout: Duration
Capture duration limit
read_timeout: Duration
Read Timeout for read next packet (Linux, BPF only)
promiscuous: bool
Capture in promiscuous mode
receive_undefined: bool
Receive undefined packets
tunnel: bool
Use TUN interface
loopback: bool
Loopback interface
Implementations§
source§impl PacketCaptureOptions
impl PacketCaptureOptions
pub fn default() -> Result<PacketCaptureOptions, String>
pub fn from_interface_index(if_index: u32) -> Option<PacketCaptureOptions>
pub fn from_interface_name(if_name: String) -> PacketCaptureOptions
pub fn from_interface(iface: &Interface) -> PacketCaptureOptions
Trait Implementations§
source§impl Clone for PacketCaptureOptions
impl Clone for PacketCaptureOptions
source§fn clone(&self) -> PacketCaptureOptions
fn clone(&self) -> PacketCaptureOptions
Returns a copy 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 PacketCaptureOptions
impl Debug for PacketCaptureOptions
source§impl<'de> Deserialize<'de> for PacketCaptureOptions
impl<'de> Deserialize<'de> for PacketCaptureOptions
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PacketCaptureOptions
impl RefUnwindSafe for PacketCaptureOptions
impl Send for PacketCaptureOptions
impl Sync for PacketCaptureOptions
impl Unpin for PacketCaptureOptions
impl UnwindSafe for PacketCaptureOptions
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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