#include "scoreboard.h"
#include "util_math.h"
Go to the source code of this file.
Functions | |
static void | sb_init_entry (void) |
static int | scoreboard_anrfree (void *key, void *data) |
static int | scoreboard_usrfree (void *key, void *data) |
static INLINE int | scoreboard_lru (SCOREBOARD *sbp, SCORE_ENTRY **sepp) |
static INLINE int | scoreboard_mru (SCOREBOARD *sbp, SCORE_ENTRY **sepp) |
int | scoreboard_init (SCOREBOARD *sbp, char *description, TRACKER_POSITION kind, unsigned int rows, int memcap) |
int | scoreboard_destroy (SCOREBOARD *sbp) |
int | scoreboard_add (SCOREBOARD *sbp, u_int32_t *address, SCORE_ENTRY **sepp) |
int | scoreboard_remove (SCOREBOARD *sbp, u_int32_t *address) |
int | scoreboard_find (SCOREBOARD *sbp, u_int32_t *address, SCORE_ENTRY **sepp) |
int | scoreboard_move (SCOREBOARD *dst, SCOREBOARD *src, u_int32_t *address) |
void | scoreboard_dump (SCOREBOARD *ssp) |
void | scoreboard_stats (SCOREBOARD *sbp, int dumpall) |
int | scoreboard_memcap (SCOREBOARD *sbp) |
int | scoreboard_row_count (SCOREBOARD *sbp) |
int | scoreboard_overhead_bytes (SCOREBOARD *sbp) |
Variables | |
static SCORE_ENTRY | s_init_entry |
|
initialize the static s_init_entry variable once and only once. This is used to zero out the key so that if the compiler pads the structure, we still have 0's in this keylookup. Definition at line 263 of file scoreboard.c. References memset. Referenced by scoreboard_init(). |
|
Definition at line 89 of file scoreboard.c. References FLOW_BADJUJU, FLOW_EINVALID, FLOW_ENOMEM, FLOW_ENULL, flow_printf(), FLOW_SUCCESS, _SCOREBOARD::ipv4_table, scoreboard_mru(), sfxhash_add(), SFXHASH_INTABLE, SFXHASH_NOMEM, and SFXHASH_OK. Referenced by flowps_add_entry(), and scoreboard_move(). |
|
Automatically recover nodes and make sure that all the other references are taken care of.
Definition at line 328 of file scoreboard.c. Referenced by scoreboard_init(). |
|
Definition at line 75 of file scoreboard.c. References FLOW_ENULL, FLOW_SUCCESS, _SCOREBOARD::ipv4_table, NULL, and sfxhash_delete(). Referenced by flowps_destroy(), and flowps_init(). |
|
Print out the entirety of the scoreboard
Definition at line 210 of file scoreboard.c. References _sfxhash_node::data, flow_printf(), flowps_entry_print(), _SCOREBOARD::ipv4_table, _sfxhash_node::key, NULL, sfxhash_ghead(), and sfxhash_gnext(). Referenced by scoreboard_stats(). |
|
Definition at line 145 of file scoreboard.c. References FLOW_ENULL, FLOW_NOTFOUND, FLOW_SUCCESS, _SCOREBOARD::ipv4_table, NULL, and sfxhash_find(). Referenced by flowps_find_entry(), and scoreboard_move(). |
|
Create a new scoreboard for tracking nodes.
Definition at line 28 of file scoreboard.c. References _SCOREBOARD::description, FLOW_EINVALID, FLOW_ENOMEM, FLOW_ENULL, flow_printf(), FLOW_SUCCESS, _SCOREBOARD::ipv4_table, _SCOREBOARD::kind, memset, NULL, sb_init_entry(), scoreboard_anrfree(), scoreboard_usrfree(), SDESC_SIZE, sfxhash_new(), and snprintf. Referenced by flowps_init(). |
|
Get the least recently used flow from the cache
Definition at line 304 of file scoreboard.c. References FLOW_EINVALID, FLOW_NOTFOUND, FLOW_SUCCESS, _SCOREBOARD::ipv4_table, NULL, and sfxhash_lru(). |
|
get the memcap
Definition at line 355 of file scoreboard.c. References _SCOREBOARD::ipv4_table, _sfxhash::mc, MEMCAP::memcap, and NULL. Referenced by FlowPSOutputConfig(). |
|
Move a scoreboard entry from one table to the other
Definition at line 172 of file scoreboard.c. References FLOW_BADJUJU, FLOW_EINVALID, FLOW_ENULL, FLOW_NOTFOUND, FLOW_SUCCESS, _SCOREBOARD::kind, memcpy, _PS_SCORE_ENTRY::position, scoreboard_add(), scoreboard_find(), and scoreboard_remove(). Referenced by flowps_newflow_callback(). |
|
Get the most recently used flow from the cache
Definition at line 283 of file scoreboard.c. References FLOW_EINVALID, FLOW_NOTFOUND, FLOW_SUCCESS, _SCOREBOARD::ipv4_table, NULL, and sfxhash_mru(). Referenced by scoreboard_add(). |
|
get the overhead # of bytes
Definition at line 386 of file scoreboard.c. References _SCOREBOARD::ipv4_table, NULL, and sfxhash_overhead_bytes(). Referenced by FlowPSOutputConfig(). |
|
Remove a node from the scoreboard
Definition at line 130 of file scoreboard.c. References FLOW_ENULL, FLOW_NOTFOUND, FLOW_SUCCESS, _SCOREBOARD::ipv4_table, and sfxhash_remove(). Referenced by scoreboard_move(). |
|
get the row count
Definition at line 370 of file scoreboard.c. References _SCOREBOARD::ipv4_table, _sfxhash::nrows, and NULL. Referenced by FlowPSOutputConfig(). |
|
Definition at line 232 of file scoreboard.c. References calc_percent(), _SCOREBOARD::description, flow_printf(), _SCOREBOARD::ipv4_table, _sfxhash::mc, MEMCAP::memcap, scoreboard_dump(), sfxhash_anr_count(), sfxhash_count(), sfxhash_find_fail(), sfxhash_find_success(), sfxhash_find_total(), and sfxhash_overhead_bytes(). Referenced by flowps_stats(). |
|
Automatically recover nodes and make sure that all the other references are taken care of.
Definition at line 343 of file scoreboard.c. Referenced by scoreboard_init(). |
|
Definition at line 4 of file scoreboard.c. |