#include <stdio.h>
#include "flowps.h"
#include "sfxhash.h"
#include "ipobj.h"
Go to the source code of this file.
Defines | |
#define | SERVER_STATS_MAX_HITCOUNT 0xFFFFFFFF |
Functions | |
void | server_stats (SERVER_STATS *ssp, int dumpall) |
void | server_stats_dump (SERVER_STATS *ssp) |
int | server_stats_init (SERVER_STATS *ssp, IPSET *watchnet, unsigned int rows, int memcap) |
int | server_stats_destroy (SERVER_STATS *ssp) |
u_int32_t | server_stats_hitcount_ipv4 (SERVER_STATS *ssp, u_int8_t ip_proto, u_int32_t address, u_int16_t port) |
int | server_stats_add_ipv4 (SERVER_STATS *ssp, u_int8_t ip_proto, u_int32_t address, u_int16_t port, u_int32_t *retcount) |
int | server_stats_remove_ipv4 (SERVER_STATS *ssp, u_int8_t ip_proto, u_int32_t address, u_int16_t port) |
int | server_stats_save (SERVER_STATS *ssp, char *filename) |
int | server_stats_load (SERVER_STATS *ssp, char *filename) |
int | server_stats_row_count (SERVER_STATS *sbp) |
int | server_stats_memcap (SERVER_STATS *sbp) |
int | server_stats_overhead_bytes (SERVER_STATS *sbp) |
int | server_stats_contains (SERVER_STATS *ssp, u_int32_t address) |
|
Definition at line 10 of file server_stats.h. Referenced by server_stats_add_ipv4(). |
|
Definition at line 67 of file server_stats.c. References calc_percent(), flow_printf(), _SERVER_STATS::ipv4_table, server_stats_dump(), server_stats_memcap(), server_stats_overhead_bytes(), sfxhash_anr_count(), sfxhash_count(), sfxhash_find_fail(), sfxhash_find_success(), and sfxhash_find_total(). Referenced by flowps_stats(). |
|
Definition at line 220 of file server_stats.c. References _SERVER_KEY::address, FLOW_BADJUJU, FLOW_ENULL, FLOW_SUCCESS, FLOWASSERT, ipset_contains(), IPV4_FAMILY, _SERVER_STATS::ipv4_table, _SERVER_STATS::ipv4_watch, NULL, _SERVER_KEY::port, _SERVER_KEY::protocol, SERVER_STATS_MAX_HITCOUNT, sfxhash_add(), SFXHASH_INTABLE, sfxhash_mru(), SFXHASH_NOMEM, and SFXHASH_OK. Referenced by flowps_get_score(). |
|
See if we are watching this particular IP
Definition at line 178 of file server_stats.c. References FLOW_DISABLED, FLOW_SUCCESS, ipset_contains(), IPV4_FAMILY, and _SERVER_STATS::ipv4_watch. Referenced by flowps_server_watch(). |
|
Definition at line 157 of file server_stats.c. References FLOW_ENULL, FLOW_SUCCESS, ipset_free(), _SERVER_STATS::ipv4_table, _SERVER_STATS::ipv4_watch, and sfxhash_delete(). |
|
Print out the entirety of the server cache.
Definition at line 41 of file server_stats.c. References _SERVER_KEY::address, _sfxhash_node::data, flow_printf(), _SERVER_STATS::ipv4_table, _sfxhash_node::key, NULL, _SERVER_KEY::port, _SERVER_KEY::protocol, sfxhash_ghead(), and sfxhash_gnext(). Referenced by server_stats(). |
|
Definition at line 194 of file server_stats.c. References _SERVER_KEY::address, FLOWASSERT, ipset_contains(), IPV4_FAMILY, _SERVER_STATS::ipv4_table, _SERVER_STATS::ipv4_watch, NULL, _SERVER_KEY::port, _SERVER_KEY::protocol, and sfxhash_find(). Referenced by flowps_get_score(). |
|
Initialize the server stats structure If we do not specify a watchnet, then we have no use for this structure
Definition at line 115 of file server_stats.c. References FLOW_EINVALID, FLOW_ENOMEM, FLOW_ENULL, FLOW_SUCCESS, ipset_copy(), ipset_family(), IPV4_FAMILY, _SERVER_STATS::ipv4_table, _SERVER_STATS::ipv4_watch, memset, NULL, server_stats_init_entry(), sfxhash_delete(), and sfxhash_new(). Referenced by flowps_init(). |
|
load a server stats file fmt: 1 char for the family hex network representation of the IP (8 chars) hex network representation of the port (2 chars) 1 char for the ip_proto (1 char) hex network representation of the hit count (4 chars) yes this record format is hard to use but it's easy to parse! :>
Definition at line 408 of file server_stats.c. References _SERVER_KEY::address, COUNT_OFFSET, COUNT_SIZE, FAMILY_OFFSET, FAMILY_SIZE, FLOW_BADJUJU, FLOW_EINVALID, FLOW_ENULL, FLOW_NOTFOUND, FLOW_SUCCESS, IP_PROTO_OFFSET, IP_PROTO_SIZE, IPV4_OFFSET, IPV4_SIZE, _SERVER_STATS::ipv4_table, memcpy, _SERVER_KEY::port, PORT_OFFSET, PORT_SIZE, _SERVER_KEY::protocol, sfxhash_add(), and STATSREC_SIZE. |
|
get the memcap
Definition at line 498 of file server_stats.c. References _SERVER_STATS::ipv4_table, _sfxhash::mc, MEMCAP::memcap, and NULL. Referenced by FlowPSOutputConfig(), and server_stats(). |
|
get the overhead # of bytes
Definition at line 529 of file server_stats.c. References _SERVER_STATS::ipv4_table, NULL, and sfxhash_overhead_bytes(). Referenced by FlowPSOutputConfig(), and server_stats(). |
|
Definition at line 276 of file server_stats.c. References _SERVER_KEY::address, FLOW_ENULL, FLOW_SUCCESS, _SERVER_STATS::ipv4_table, _SERVER_KEY::port, _SERVER_KEY::protocol, and sfxhash_remove(). |
|
get the node count
Definition at line 513 of file server_stats.c. References _SERVER_STATS::ipv4_table, _sfxhash::nrows, and NULL. Referenced by FlowPSOutputConfig(). |
|
Definition at line 314 of file server_stats.c. References _SERVER_KEY::address, COUNT_OFFSET, COUNT_SIZE, _sfxhash_node::data, FAMILY_OFFSET, FAMILY_SIZE, FLOW_EINVALID, FLOW_ENULL, FLOW_NOTFOUND, flow_printf(), FLOW_SUCCESS, IP_PROTO_OFFSET, IP_PROTO_SIZE, IPV4_OFFSET, IPV4_SIZE, _SERVER_STATS::ipv4_table, _sfxhash_node::key, memcpy, NULL, O_SYNC, _SERVER_KEY::port, PORT_OFFSET, PORT_SIZE, _SERVER_KEY::protocol, s_debug, sfxhash_ghead(), sfxhash_gnext(), and STATSREC_SIZE. |