#[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: u64Unique flow index: second column of Tranalyzer2 flow output.
status: u64flow status bits.
flow_index: c_ulongTranalyzer2 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_ulongSimilar 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: u16flow inner VLAN tag
src_port: u16flow source port (UDP or TCP)
dst_port: u16flow destination port (UDP or TCP)
Implementations§
source§impl Flow
impl Flow
sourcepub fn first_seen(&self) -> f64
pub fn first_seen(&self) -> f64
Timestamp of the first seen packet (as the number of seconds since 1970-01-01).
sourcepub fn last_seen(&self) -> f64
pub fn last_seen(&self) -> f64
Timestamp of the last seen packet (as the number of seconds since 1970-01-01).
sourcepub fn duration(&self) -> f64
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.
sourcepub fn src_ip(&self) -> Option<IpAddr>
pub fn src_ip(&self) -> Option<IpAddr>
Returns source IP address for IPv4 or IPv6 flow. None for non IP flow.