Function t2plugin::getflow [] [src]

pub fn getflow<'a>(index: c_ulong) -> &'a mut Flow

Returns the Flow structure of the flow with flow_index=index.

Corresponds to Tranalyzer2 internal flows[index].

Example

use t2plugin::{getflow, HASHTABLE_ENTRY_NOT_FOUND};
use t2plugin::nethdr::Flow;

fn get_opposite_flow<'a>(flow: &'a Flow) -> Option<&'a mut Flow> {
    match flow.opposite_flow_index {
        HASHTABLE_ENTRY_NOT_FOUND => None,
        index => Some(getflow(index)),
    }
}