#[non_exhaustive]pub struct ScanConfig {
pub targets: Vec<Ipv4Addr>,
pub ports: Vec<Port>,
pub source: Ipv4Addr,
pub bandwidth_kib: u64,
pub timeout: Duration,
pub show_closed: bool,
}Expand description
Configuration for one SYN scan.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.targets: Vec<Ipv4Addr>IPv4 addresses to scan.
Addresses must be unique.
ports: Vec<Port>TCP ports to scan.
Ports must be unique.
source: Ipv4AddrSource IPv4 address assigned to the selected interface.
bandwidth_kib: u64Approximate maximum packet bandwidth in KiB/s.
ScanConfig::new defaults this to 15 KiB/s, or approximately 384 probes per second
with the scanner’s 40-byte packet accounting.
timeout: DurationTime to listen for late replies after the final probe.
Capped at 24 hours; ScanConfig::new defaults this to 30 seconds.
show_closed: boolWhether RST responses should be returned.
Implementations§
Source§impl ScanConfig
impl ScanConfig
Sourcepub const fn new(
targets: Vec<Ipv4Addr>,
ports: Vec<Port>,
source: Ipv4Addr,
) -> Self
pub const fn new( targets: Vec<Ipv4Addr>, ports: Vec<Port>, source: Ipv4Addr, ) -> Self
Creates a configuration with 15 KiB/s bandwidth and a 30-second late-reply timeout.
§Examples
use singsing_rs::ScanConfig;
use std::net::Ipv4Addr;
let target: Ipv4Addr = "192.168.2.10".parse()?;
let mut config = ScanConfig::new(vec![target], vec![22, 80, 443], Ipv4Addr::LOCALHOST);
config.show_closed = true;
assert_eq!(config.bandwidth_kib, 15);
assert!(config.show_closed);Trait Implementations§
Source§impl Clone for ScanConfig
impl Clone for ScanConfig
Source§fn clone(&self) -> ScanConfig
fn clone(&self) -> ScanConfig
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 moreSource§impl Debug for ScanConfig
impl Debug for ScanConfig
impl Eq for ScanConfig
Source§impl Hash for ScanConfig
impl Hash for ScanConfig
Source§impl PartialEq for ScanConfig
impl PartialEq for ScanConfig
impl StructuralPartialEq for ScanConfig
Auto Trait Implementations§
impl Freeze for ScanConfig
impl RefUnwindSafe for ScanConfig
impl Send for ScanConfig
impl Sync for ScanConfig
impl Unpin for ScanConfig
impl UnsafeUnpin for ScanConfig
impl UnwindSafe for ScanConfig
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