00001 #ifndef _SERVER_STATS_H
00002 #define _SERVER_STATS_H
00003
00004 #include <stdio.h>
00005
00006 #include "flowps.h"
00007 #include "sfxhash.h"
00008 #include "ipobj.h"
00009
00010 #define SERVER_STATS_MAX_HITCOUNT 0xFFFFFFFF
00011
00012 void server_stats(SERVER_STATS *ssp, int dumpall);
00013 void server_stats_dump(SERVER_STATS *ssp);
00014
00015 int server_stats_init(SERVER_STATS *ssp, IPSET *watchnet, unsigned int rows, int memcap);
00016 int server_stats_destroy(SERVER_STATS *ssp);
00017
00018 u_int32_t server_stats_hitcount_ipv4(SERVER_STATS *ssp,
00019 u_int8_t ip_proto,
00020 u_int32_t address,
00021 u_int16_t port);
00022
00023 int server_stats_add_ipv4(SERVER_STATS *ssp, u_int8_t ip_proto, u_int32_t address,
00024 u_int16_t port, u_int32_t *retcount);
00025
00026 int server_stats_remove_ipv4(SERVER_STATS *ssp, u_int8_t ip_proto, u_int32_t address, u_int16_t port);
00027
00028 int server_stats_save(SERVER_STATS *ssp, char *filename);
00029 int server_stats_load(SERVER_STATS *ssp, char *filename);
00030
00031 int server_stats_row_count(SERVER_STATS *sbp);
00032 int server_stats_memcap(SERVER_STATS *sbp);
00033 int server_stats_overhead_bytes(SERVER_STATS *sbp);
00034 int server_stats_contains(SERVER_STATS *ssp, u_int32_t address);
00035 #endif