NAF Core Library
libnaf 0.6.0 API documentation

match.h File Reference

NAF Core Library Flow Match API. More...

#include <naf/autoinc.h>
#include <naf/nafcore.h>
#include <naf/exparse.h>

Go to the source code of this file.


Data Structures

struct  _NAFMultiBin
 An indexed, time-ordered queue of flow bins; the basic unit of matching. More...
struct  _NAFBinTable
 A single flow bin. More...

Typedefs

typedef _NAFMultiBin NAFMultiBin
 An indexed, time-ordered queue of flow bins; the basic unit of matching.
typedef _NAFBinTable NAFBinTable
 A single flow bin.

Functions

void naf_mtab_init (NAFMultiBin *mtab, NAFAggConfig *conf)
 Initialize a given multibin for use with a given aggregation configuration.
gboolean naf_mtab_add (NAFMultiBin *mtab, NAFlowKey *key, NAFlowVal *val, GError **err)
 Add a binned flow to a multibin.
gboolean naf_mtab_add_raw (NAFMultiBin *mtab, NAFlowRaw *raw, GError **err)
 Add a raw flow to a multibin.
NAFBinTablenaf_mtab_dequeue (NAFMultiBin *mtab, NAFTimeSec horizon)
 Dequeue the next bintable from the multibin if it is over the given horizon.
void naf_mtab_bintable_complete (NAFBinTable *bintab)
 Free storage used by a bintable, after dequeueing it with naf_mtab_dequeue.

Detailed Description

NAF Core Library Flow Match API.

Used by nafalize. Defines an API for manipulating NAFMultiBin structures, which bin and match flows before aggregation. This structure allows NAF to build biflow aggregates from uniflow data sources. See aggregate.h or the nafalize source code for guidelines on using these calls.


Function Documentation

gboolean naf_mtab_add ( NAFMultiBin mtab,
NAFlowKey key,
NAFlowVal val,
GError **  err 
)

Add a binned flow to a multibin.

Ensures the multibin contains a bin table corresponding to the flow's bin.

Parameters:
mtab multibin to add flow to
key flow key to add
val flow value to add
err an error descriptor
Returns:
FALSE if add failed (e.g., on a horizon violation).

gboolean naf_mtab_add_raw ( NAFMultiBin mtab,
NAFlowRaw raw,
GError **  err 
)

Add a raw flow to a multibin.

Splits the flow into binned flows according to the bin size and binning algorithm in the multibin's configuration.

Parameters:
mtab multibin to add flow to
raw raw flow to add
err an error descriptor
Returns:
FALSE if add failed (e.g., on a horizon violation).

void naf_mtab_bintable_complete ( NAFBinTable bintab  ) 

Free storage used by a bintable, after dequeueing it with naf_mtab_dequeue.

Used by naf_aggregate(). Applications should have no reason to call this routine.

Parameters:
bintab bintable to free

NAFBinTable* naf_mtab_dequeue ( NAFMultiBin mtab,
NAFTimeSec  horizon 
)

Dequeue the next bintable from the multibin if it is over the given horizon.

Used by naf_aggregate() to retrieve bintables during aggregation. Applications should have no reason to call this routine.

Parameters:
mtab multibin to get next bintable from.
horizon horizon in seconds, or 0 to always return the next bintable.
Returns:
the next bintable, or NULL if none is available.

void naf_mtab_init ( NAFMultiBin mtab,
NAFAggConfig conf 
)

Initialize a given multibin for use with a given aggregation configuration.

mtab should be a pointer to an uninitialized, allocated NAFMultiBin structure.

Parameters:
mtab multibin to initialize
conf configuration to initialize with, from naf_exparse()