Struct t2plugin::flow::Flow

source ·
#[repr(C, packed)]
pub struct Flow { pub findex: u64, pub status: u64, pub flow_index: c_ulong, pub opposite_flow_index: c_ulong, pub vlan_id: u16, pub src_port: u16, pub dst_port: u16, /* private fields */ }
Expand description

Tranalyzer2 internal per flow structure.

Fields§

§findex: u64

Unique flow index: second column of Tranalyzer2 flow output.

§status: u64

flow status bits.

§flow_index: c_ulong

Tranalyzer2 internal flow index: uniquely identify a flow in internal hashmap but is not unique over a Tranalyzer2 run.

Use this value with the getflow function. Use findex for a unique flow index.

§opposite_flow_index: c_ulong

Similar to flow_index but identifies the opposite flow associated to this flow.

Equals HASHTABLE_ENTRY_NOT_FOUND if this flow has no opposite flow.

§vlan_id: u16

flow inner VLAN tag

§src_port: u16

flow source port (UDP or TCP)

§dst_port: u16

flow destination port (UDP or TCP)

Implementations§

source§

impl Flow

source

pub fn first_seen(&self) -> f64

Timestamp of the first seen packet (as the number of seconds since 1970-01-01).

source

pub fn last_seen(&self) -> f64

Timestamp of the last seen packet (as the number of seconds since 1970-01-01).

source

pub fn duration(&self) -> f64

Duration of this flow in seconds.

This method should only be called after the flow termination. To compute the current flow duration before the flow termination, use first_seen and last_seen.

source

pub fn src_ip(&self) -> Option<IpAddr>

Returns source IP address for IPv4 or IPv6 flow. None for non IP flow.

source

pub fn dst_ip(&self) -> Option<IpAddr>

Returns destination IP address for IPv4 or IPv6 flow. None for non IP flow.

source

pub fn l4_proto(&self) -> L4Type

Type of the layer 4 header as defined in L4Type.

source

pub fn ip_ver(&self) -> u8

Returns the IP version of this flow (4 or 6). Returns 0 if not IP flow.

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere 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 Twhere 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.