Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

flow_cache.h File Reference

#include "flow.h"
#include "sfxhash.h"

Go to the source code of this file.

Defines

#define UINT64   unsigned long long

Typedefs

typedef _FCSTAT FCSTAT
typedef _FLOWCACHE FLOWCACHE

Functions

int flowcache_init (FLOWCACHE *flowcachep, unsigned int rows, int memcap, int datasize, FLOWHASHID hashid)
int flowcache_destroy (FLOWCACHE *flowcachep)
int flowcache_releaseflow (FLOWCACHE *flowcachep, FLOW **flowpp)
int flowcache_newflow (FLOWCACHE *flowcachep, FLOWKEY *keyp, FLOW **flowpp)
int flowcache_find (FLOWCACHE *flowcachep, FLOWKEY *keyp, FLOW **flowpp, int *direction)
void flowcache_stats (FILE *stream, FLOWCACHE *flowcachep)
int flowcache_overhead_bytes (FLOWCACHE *fcp)
int flowcache_memcap (FLOWCACHE *fcp)
int flowcache_row_count (FLOWCACHE *fcp)
const char * flowcache_pname (FLOW_POSITION position)


Define Documentation

#define UINT64   unsigned long long
 

Definition at line 8 of file flow_cache.h.

Referenced by InitFlowStats(), and ProcessFlowStats().


Typedef Documentation

typedef struct _FCSTAT FCSTAT
 

typedef struct _FLOWCACHE FLOWCACHE
 


Function Documentation

int flowcache_destroy FLOWCACHE flowcachep  ) 
 

Definition at line 141 of file flow_cache.c.

References FLOW_ENULL, FLOW_SUCCESS, _FLOWCACHE::ipv4_table, NULL, and sfxhash_delete().

Referenced by FlowCleanExit().

int flowcache_find FLOWCACHE flowcachep,
FLOWKEY keyp,
FLOW **  flowpp,
int *  direction
 

Look for the data in the flow tables.

Parameters:
flowcachep cache to look in
keyp pointer to searching key data
flowpp pointer to set with this module
direction pass back argument (FROM_INITIATOR or FROM_RESPONDER)
Returns:
FLOW_SUCCESS on success, FLOW_NOTFOUND when not found, else usage error

Definition at line 346 of file flow_cache.c.

References FCS_find(), FCS_find_fail(), FCS_find_success(), FCS_revfind(), FLOW_ENULL, FLOW_NOTFOUND, FLOW_SUCCESS, flowkey_normalize(), FROM_INITIATOR, FROM_RESPONDER, _FLOWKEY::init_address, _FLOWKEY::init_port, _FLOWCACHE::ipv4_table, _FLOW::key, NULL, and sfxhash_find().

Referenced by FlowPreprocessor().

int flowcache_init FLOWCACHE flowcachep,
unsigned int  rows,
int  memcap,
int  datasize,
FLOWHASHID  hashid
 

Definition at line 55 of file flow_cache.c.

References FLOW_BADJUJU, FLOW_EINVALID, FLOW_ENOMEM, FLOW_ENULL, FLOW_SUCCESS, flowcache_anrfree(), flowcache_usrfree(), flowkey_hashfcn1(), flowkey_hashfcn2(), flowkeycmp_fcn(), HASH1, HASH2, int(), _FLOWCACHE::ipv4_table, _FLOWCACHE::max_flowbits_bytes, memset, NULL, sfxhash_delete(), sfxhash_new(), and sfxhash_set_keyops().

Referenced by FlowInit().

int flowcache_memcap FLOWCACHE fcp  ) 
 

int flowcache_newflow FLOWCACHE flowcachep,
FLOWKEY keyp,
FLOW **  flowpp
 

Definition at line 203 of file flow_cache.c.

References _sfxhash_node::data, FCS_new(), FLOW_BADJUJU, FLOW_EINVALID, FLOW_ENOMEM, FLOW_ENULL, flow_init(), flow_printf(), FLOW_SUCCESS, flowcache_mru(), flowkey_normalize(), _FLOWKEY::init_address, init_flowdata(), _FLOWKEY::init_port, _FLOWCACHE::ipv4_table, memset, NULL, _FLOWKEY::protocol, _FLOWKEY::resp_address, _FLOWKEY::resp_port, sfxhash_add(), sfxhash_get_node(), SFXHASH_INTABLE, SFXHASH_NOMEM, and SFXHASH_OK.

Referenced by FlowPreprocessor().

int flowcache_overhead_bytes FLOWCACHE sbp  ) 
 

get the overhead # of bytes

Parameters:
sbp flowcache ptr to return the memcap of
Returns:
nrows or -1

Definition at line 635 of file flow_cache.c.

References _FLOWCACHE::ipv4_table, NULL, and sfxhash_overhead_bytes().

Referenced by DisplayFlowConfig(), and flowcache_stats().

const char* flowcache_pname FLOW_POSITION  position  ) 
 

map a position to a name

Parameters:
position where to return the name of
Returns:
string reprenting position name

Definition at line 407 of file flow_cache.c.

References FLOW_MAX.

Referenced by flow_callbacks().

int flowcache_releaseflow FLOWCACHE flowcachep,
FLOW **  flowpp
 

Todo:
remove any associated data with the flow

Definition at line 161 of file flow_cache.c.

References FLOW_ENULL, FLOW_NOTFOUND, FLOW_SUCCESS, flowkey_normalize(), _FLOWCACHE::ipv4_table, NULL, and sfxhash_remove().

Referenced by CheckFlowShutdown().

int flowcache_row_count FLOWCACHE sbp  ) 
 

get the row count

Parameters:
sbp flowcache ptr to return the memcap of
Returns:
nrows or -1

Definition at line 619 of file flow_cache.c.

References _FLOWCACHE::ipv4_table, _sfxhash::nrows, and NULL.

Referenced by DisplayFlowConfig().

void flowcache_stats FILE *  stream,
FLOWCACHE flowcachep
 

Definition at line 508 of file flow_cache.c.

References calc_percent(), _FCSTAT::find_fail, _FCSTAT::find_ops, _FCSTAT::find_success, flow_printf(), FLOW_SUCCESS, flowcache_lru(), flowcache_mru(), flowcache_overhead_blocks(), flowcache_overhead_bytes(), _FLOWCACHE::ipv4_table, _FLOWSTATS::last_packet, _sfxhash::mc, MEMCAP::memcap, MEMCAP::memused, MEMCAP::nblocks, _FCSTAT::new_flows, _FLOWCACHE::per_proto, _FCSTAT::reversed_ops, sfxhash_anr_count(), sfxhash_count(), sfxhash_maxdepth(), _FLOW::stats, and _FLOWCACHE::total.

Referenced by FlowCleanExit(), and FlowPreprocessor().


Generated on Sun May 14 14:51:24 2006 by  doxygen 1.4.2