Myra Canyon  v0.0.1-768
network control
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Myra::FlowExpectation Class Referencefinal

The FlowExpectation class is used to insert hints that can link future or predicted flows with older existing flows. More...

#include "FlowExpectation.hpp"

Collaboration diagram for Myra::FlowExpectation:

Classes

struct  Record
 Each flow tuple must map to a Record. More...
 

Public Types

typedef std::map< FlowTuple,
Record
TupleRecordMap
 Map a partial or full flow tuple to a flow expectation record. More...
 

Public Member Functions

 ~FlowExpectation (void)
 Destructor. More...
 
 FlowExpectation (void)
 Constructor. More...
 
FlowTuple get_matching_tuple (const PktInfo &info) const
 Determine if a given packet (usually for a new TCP or UDP flow) has a matching expected flow record. More...
 
FlowTuple get_matching_tuple (const FlowTuple &tuple) const
 Determine if a given tuple (usually for a new TCP or UDP flow) has a matching expected flow record. More...
 
bool find_and_apply_record_to_flow (Flow &flow, const FlowTuple &tuple)
 Find and apply apply the appropriate fields (such as related_hash and traffic_types) to flow if a matching record exists for the given tuple. More...
 
void add_record (Record record, const FlowTuple &tuple)
 Add (or replace) a record for flows matching tuple. More...
 
std::size_t remove_record (const FlowHash hash)
 Remove records for a given parent flow. This is O(n) since the map is ordered by flow_tuple and not by flow hashes. More...
 
Record get_record (const PktInfo &info) const
 Determine if a record exist, and return a copy. More...
 
Record get_record (const FlowTuple &tuple) const
 

Public Attributes

TupleRecordMap tuple_record_map
 Map of flow tuples (keys) and records (values). More...
 

Detailed Description

The FlowExpectation class is used to insert hints that can link future or predicted flows with older existing flows.

Member Typedef Documentation

Map a partial or full flow tuple to a flow expectation record.

Constructor & Destructor Documentation

Myra::FlowExpectation::~FlowExpectation ( void  )

Destructor.

Myra::FlowExpectation::FlowExpectation ( void  )

Constructor.

Member Function Documentation

void Myra::FlowExpectation::add_record ( Record  record,
const FlowTuple tuple 
)

Add (or replace) a record for flows matching tuple.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Myra::FlowExpectation::find_and_apply_record_to_flow ( Myra::Flow flow,
const FlowTuple tuple 
)

Find and apply apply the appropriate fields (such as related_hash and traffic_types) to flow if a matching record exists for the given tuple.

Returns
true if a matching record was found.

Here is the call graph for this function:

Here is the caller graph for this function:

Myra::FlowTuple Myra::FlowExpectation::get_matching_tuple ( const PktInfo info) const

Determine if a given packet (usually for a new TCP or UDP flow) has a matching expected flow record.

Returns
an empty Myra::FlowTuple if there is no matching entry.
the matching tuple if a record exists. This tuple can be used as a key into tuple_record_map.

Here is the call graph for this function:

Here is the caller graph for this function:

Myra::FlowTuple Myra::FlowExpectation::get_matching_tuple ( const FlowTuple tuple) const

Determine if a given tuple (usually for a new TCP or UDP flow) has a matching expected flow record.

Returns
an empty Myra::FlowTuple if there is no matching entry.
the matching tuple if a record exists. This tuple can be used as a key into tuple_record_map.

Here is the call graph for this function:

Myra::FlowExpectation::Record Myra::FlowExpectation::get_record ( const PktInfo info) const

Determine if a record exist, and return a copy.

Returns
empty Record if there is no matching entry.
Myra::FlowExpectation::Record Myra::FlowExpectation::get_record ( const FlowTuple tuple) const
Parameters
[in]tuplecan be either a key into tuple_record_map or can be a flow tuple for which a matching record must be found.
See also
Myra::FlowExpectation::get_matching_tuple()

Here is the call graph for this function:

size_t Myra::FlowExpectation::remove_record ( const FlowHash  hash)

Remove records for a given parent flow. This is O(n) since the map is ordered by flow_tuple and not by flow hashes.

Member Data Documentation

TupleRecordMap Myra::FlowExpectation::tuple_record_map

Map of flow tuples (keys) and records (values).


The documentation for this class was generated from the following files: