Skip to main content

ProbeStats

Struct ProbeStats 

Source
pub struct ProbeStats { /* private fields */ }
Expand description

What one raw scanner observed about its own run.

A short sweep has three possible causes with different fixes: probes or replies were lost (retransmission’s job); replies arrived after the scan stopped (the deadline is wrong); or replies arrived and went unrecognized (more time or packets will not help).

These counters separate them. sends_attempted against segments_seen bounds the first, stop_reason against last_reply bounds the second, and segments_off_target with replies_without_rtt bounds the third.

A reply the kernel discards because the capture buffer was full reaches no counter here, so capture is carried to tell receive-path loss from network loss.

Instrumentation about the scan; nothing here changes what is reported about a host.

Implementations§

Source§

impl ProbeStats

Source

pub fn scanner(&self) -> ScannerKind

The strategy these counters belong to.

Source

pub fn targets(&self) -> u128

How many targets this scanner owned: addresses for a discovery sweep, (address, port) probes for a port scan.

Source

pub fn stop_reason(&self) -> StopReason

Why the receive loop stopped.

Source

pub fn elapsed(&self) -> Duration

How long the scanner ran.

Source

pub fn sends_attempted(&self) -> u64

Probes the scanner tried to put on the wire.

Source

pub fn achieved_send_rate(&self) -> Option<f64>

Probes per second the scanner put on the wire over its whole run: sends_attempted over elapsed. None for a run with no time to divide by.

Compare with the configured rate. The send timer never makes up a missed tick, since catching up would be a burst, so a busy run sends slower than asked.

Source

pub fn sends_failed(&self) -> u64

Of those, ones that never left this host: the sender refused them or could not reach their address. Unreachable addresses are in the phase’s unroutable list.

Source

pub fn sends_witnessed(&self) -> u64

How many probes were watched leaving on the wire. Read against sends_attempted, and only when non-zero: the gap is probes the OS took and dropped. Zero means no egress capture.

Source

pub fn segments_seen(&self) -> u64

Segments the capture handed up, before any of the scanner’s own checks.

Source

pub fn window(&self) -> Option<WindowSummary>

What this run’s congestion window did, for a scanner paced by one.

Tells “these ports drop probes” from “this scan was outrun”. A run whose window bottomed out with most probes unanswered could not ask, which says nothing about a firewall.

None for a scanner that paces itself some other way.

Source

pub fn segments_off_target(&self) -> u64

Segments from an address outside this scan’s target set. Expected to be small; a large count means the capture filter is admitting other traffic.

Source

pub fn replies_without_rtt(&self) -> u64

In-set replies that answered no outstanding probe, so they proved a host alive but yielded no round-trip sample. Duplicates land here, and so does a correlation bug.

Source

pub fn refusals_unattributed(&self) -> u64

ICMP refusals among replies_without_rtt that quoted too little of the probe to name its attempt.

Anyone who knows the source port can forge a refusal naming the ports, so one that cannot name the attempt settles nothing, and the port keeps what its retries conclude. This counts them. A sender quoting only the eight bytes RFC 792 guarantees omits an ACK, window or Maimon scan’s nonce, and every INIT’s.

Source

pub fn hosts_found(&self) -> u64

Targets a reply resolved, counted once each.

In the unit of targets: a host for a discovery sweep, an (address, port) probe for a port scan.

Against targets it is coverage; against stop_reason and last_reply it says whether the run was still finding things when it ended.

Source

pub fn answered_on(&self) -> &[u64]

Found hosts by the attempt whose reply revealed them.

Index i counts hosts answered on attempt i + 1; the last slot counts attempt ATTEMPTS_COUNTED or later, so a hand-raised retry budget still has somewhere to land.

Shows whether retransmission earns its traffic.

Source

pub fn answered_unattributed(&self) -> u64

Found hosts whose reply named no attempt: it arrived after the probe had been written off, or carried nothing to match against.

Source

pub fn first_reply(&self) -> Option<Duration>

How far into the run the first host was credited.

Source

pub fn last_reply(&self) -> Option<Duration>

How far into the run the last host was credited. Close to elapsed on a run that stopped for DeadlineExpired means the scan was still finding hosts when it ran out of time.

Source

pub fn found_at(&self) -> &[u64]

Hosts by how far into the run they were credited, bucketed by BUCKET_BOUNDS_MS. Index i counts hosts found at or under BUCKET_BOUNDS_MS[i] milliseconds; the final slot counts everything later than the last bound.

Source

pub fn capture(&self) -> Option<CaptureCounts>

What the kernel capture reported. None for a synthetic receive stream.

Source§

impl ProbeStats

Source

pub fn from_parts(parts: ProbeStatsParts) -> Self

Rebuilds probe statistics from what was recorded of them.

Each distribution is read for the slots this build counts: extra slots are dropped and missing ones read as zero, so a record from a build with more slots still reads. A caller building these by hand sizes them from the two constants.

Trait Implementations§

Source§

impl Clone for ProbeStats

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProbeStats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ProbeStats

Source§

impl From<&ProbeStats> for ProbeStatsRecord

Source§

fn from(stats: &ProbeStats) -> Self

Converts to this type from the input type.
Source§

impl From<&ProbeStatsRecord> for ProbeStats

Source§

fn from(record: &ProbeStatsRecord) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ProbeStats

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ProbeStats

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more