Struct retina_datatypes::connection::Flow

source ·
pub struct Flow {
    pub nb_pkts: u64,
    pub nb_malformed_pkts: u64,
    pub nb_late_start_pkts: u64,
    pub nb_bytes: u64,
    pub max_simult_gaps: u64,
    pub data_start: u32,
    pub capacity: usize,
    pub chunks: Vec<Chunk>,
    pub gaps: HashMap<u32, u64>,
}
Expand description

A uni-directional flow.

Fields§

§nb_pkts: u64

Number of packets seen for this flow, including malformed and late start segments.

  • Malformed segments are defined as those that have a payload offset (start of the payload, as computed from the header length field) beyond the end of the packet buffer, or the end of the payload exceeds the end of the packet buffer.
  • Late start segments are those that arrive after the first packet seen in the flow, but have an earlier sequence number. Only applies to TCP flows.
§nb_malformed_pkts: u64

Number of malformed packets.

§nb_late_start_pkts: u64

Number of late start packets.

§nb_bytes: u64

Number of payload bytes observed in the flow. Does not include bytes from malformed segments.

§max_simult_gaps: u64

Maximum number of simultaneous content gaps.

A content gap is a “hole” in the TCP sequence number, indicated re-ordered or missing packets. Only applies to TCP flows.

§data_start: u32

Starting sequence number of the first byte in the first payload (ISN + 1). Only applies to TCP flows, and is set to 0 for UDP.

§capacity: usize

Maximum chunk capacity (the maximum number of simultaneous gaps + 1). Only applies to TCP flows. Used to prevent resizing chunks vector.

§chunks: Vec<Chunk>

The set of non-overlapping content intervals. Only applies to TCP flows.

§gaps: HashMap<u32, u64>

Maps relative sequence number of a content gap to the number of packets observed before it is filled. Only applies to TCP flows.

Implementations§

source§

impl Flow

source

pub fn content_gaps(&self) -> u64

Returns the number of content gaps at the connection end.

This is not the total number of content gaps ever observed, rather, it represents the total number of gaps remaining in the final state of the connection.

source

pub fn missed_bytes(&self) -> u64

Number of bytes missed in content gaps at connection end.

This is not the total size of all content gaps ever observed, rather, it represents the total number of missing bytes in the final state of the connection.

source

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

Returns the mean number of packet arrivals before a content gap is filled, or 0 if there were no gaps.

source

pub fn median_pkts_to_fill(&self) -> Option<u64>

Returns the median number of packet arrivals before a content gap is filled, or 0 if there were no gaps.

Trait Implementations§

source§

impl Clone for Flow

source§

fn clone(&self) -> Flow

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Flow

source§

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

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

impl Serialize for Flow

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Flow

§

impl RefUnwindSafe for Flow

§

impl Send for Flow

§

impl Sync for Flow

§

impl Unpin for Flow

§

impl UnwindSafe for Flow

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

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.