pub struct PacketCaptureOptions {Show 16 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 duration: Duration,
pub read_timeout: Duration,
pub promiscuous: bool,
pub store: bool,
pub store_limit: u32,
pub receive_undefined: bool,
pub use_tun: 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
duration: Duration
Capture duration limit
read_timeout: Duration
Read Timeout for read next packet (Linux, BPF, Netmap only)
promiscuous: bool
Capture in promiscuous mode
store: bool
Store captured packets in memory
store_limit: u32
Store limit
receive_undefined: bool
Receive undefined packets
use_tun: bool
Use TUN interface
loopback: bool
Loopback interface
Implementations§
Source§impl PacketCaptureOptions
impl PacketCaptureOptions
Sourcepub fn new() -> PacketCaptureOptions
pub fn new() -> PacketCaptureOptions
Constructs a new PacketCaptureOptions
Sourcepub fn with_interface_index(self, interface_index: u32) -> PacketCaptureOptions
pub fn with_interface_index(self, interface_index: u32) -> PacketCaptureOptions
Set interface index
Sourcepub fn set_src_ips(&mut self, ips: Vec<IpAddr>)
pub fn set_src_ips(&mut self, ips: Vec<IpAddr>)
Set source IP addresses to filter
Sourcepub fn set_dst_ips(&mut self, ips: Vec<IpAddr>)
pub fn set_dst_ips(&mut self, ips: Vec<IpAddr>)
Set destination IP addresses to filter
Sourcepub fn set_src_ports(&mut self, ports: Vec<u16>)
pub fn set_src_ports(&mut self, ports: Vec<u16>)
Set source ports to filter
Sourcepub fn set_dst_ports(&mut self, ports: Vec<u16>)
pub fn set_dst_ports(&mut self, ports: Vec<u16>)
Set destination ports to filter
Sourcepub fn set_ether_types(&mut self, ether_types: Vec<EtherType>)
pub fn set_ether_types(&mut self, ether_types: Vec<EtherType>)
Set ether types to filter
Sourcepub fn set_ip_protocols(&mut self, ip_protocols: Vec<IpNextLevelProtocol>)
pub fn set_ip_protocols(&mut self, ip_protocols: Vec<IpNextLevelProtocol>)
Set IP protocols to filter
Trait Implementations§
Source§impl Clone for PacketCaptureOptions
impl Clone for PacketCaptureOptions
Source§fn clone(&self) -> PacketCaptureOptions
fn clone(&self) -> PacketCaptureOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more