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

unique_tracker.h File Reference

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

Go to the source code of this file.

Typedefs

typedef _UNIQUE_TRACKER UNIQUE_TRACKER

Enumerations

enum  UT_TYPE { UT_OLD, UT_NEW }

Functions

int ut_init (UNIQUE_TRACKER *utp, unsigned int rows, int memcap)
int ut_destroy (UNIQUE_TRACKER *utp)
int ut_check (UNIQUE_TRACKER *utp, FLOWKEY *keyp, UT_TYPE *retval)
void ut_stats (UNIQUE_TRACKER *utp, int dumpall)
int ut_memcap (UNIQUE_TRACKER *utp)
int ut_row_count (UNIQUE_TRACKER *utp)
int ut_overhead_bytes (UNIQUE_TRACKER *sbp)


Typedef Documentation

typedef struct _UNIQUE_TRACKER UNIQUE_TRACKER
 


Enumeration Type Documentation

enum UT_TYPE
 

Enumeration values:
UT_OLD 
UT_NEW 

Definition at line 7 of file unique_tracker.h.


Function Documentation

int ut_check UNIQUE_TRACKER utp,
FLOWKEY keyp,
UT_TYPE retval
 

Determine if a flowkey is sufficiently unique to be called new

This assumes that sfxhash_add performs a splay to the top on an INTABLE add. This must be updated if that's ever changed.

Parameters:
utp tracker to use
keyp key to check
@return FLOW_SUCCESS if the check went OK

Definition at line 98 of file unique_tracker.c.

References _UT_KEY::dip, _UT_KEY::dport, FLOW_ENULL, FLOW_SUCCESS, _FLOWKEY::init_address, _UNIQUE_TRACKER::ipv4_table, NULL, _FLOWKEY::protocol, _UT_KEY::protocol, _FLOWKEY::resp_address, _FLOWKEY::resp_port, sfxhash_add(), SFXHASH_INTABLE, SFXHASH_NOMEM, SFXHASH_OK, _UT_KEY::sip, UT_NEW, and UT_OLD.

Referenced by flowps_get_score().

int ut_destroy UNIQUE_TRACKER utp  ) 
 

Destroy a table completely

Parameters:
utp table to kill
Returns:
FLOW_SUCCESS when table is gone

Definition at line 74 of file unique_tracker.c.

References FLOW_ENULL, FLOW_SUCCESS, _UNIQUE_TRACKER::ipv4_table, and sfxhash_delete().

Referenced by flowps_destroy(), and flowps_init().

int ut_init UNIQUE_TRACKER utp,
unsigned int  rows,
int  memcap
 

Definition at line 38 of file unique_tracker.c.

References FLOW_ENOMEM, FLOW_ENULL, flow_printf(), FLOW_SUCCESS, _UNIQUE_TRACKER::ipv4_table, memset, NULL, s_debug, sfxhash_new(), and ut_init_entry().

Referenced by flowps_init().

int ut_memcap UNIQUE_TRACKER utp  ) 
 

get the memcap

Parameters:
utp ptr to get the memcap of something
Returns:
memcap or -1

Definition at line 222 of file unique_tracker.c.

References _UNIQUE_TRACKER::ipv4_table, _sfxhash::mc, MEMCAP::memcap, and NULL.

Referenced by FlowPSOutputConfig(), and ut_stats().

int ut_overhead_bytes UNIQUE_TRACKER sbp  ) 
 

get the overhead # of bytes

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

Definition at line 252 of file unique_tracker.c.

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

Referenced by FlowPSOutputConfig(), and ut_stats().

int ut_row_count UNIQUE_TRACKER utp  ) 
 

get the # of rows in table

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

Definition at line 237 of file unique_tracker.c.

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

Referenced by FlowPSOutputConfig().

void ut_stats UNIQUE_TRACKER utp,
int  dumpall
 

Parameters:
utp unique tracker ptr
dumpall if 1, dump the contents of the tracker

Definition at line 190 of file unique_tracker.c.

References calc_percent(), flow_printf(), _UNIQUE_TRACKER::ipv4_table, sfxhash_anr_count(), sfxhash_count(), sfxhash_find_fail(), sfxhash_find_success(), sfxhash_find_total(), unique_tracker_dump(), ut_memcap(), and ut_overhead_bytes().

Referenced by flowps_stats().


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