#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "sflsq.h"
#include "sfghash.h"
#include "sfxhash.h"
#include "sfthd.h"
Go to the source code of this file.
Functions | |
THD_STRUCT * | sfthd_new (unsigned nbytes) |
static int | sfthd_create_threshold_local (THD_STRUCT *thd, unsigned gen_id, unsigned sig_id, int tracking, int type, int priority, int count, int seconds, unsigned ip_address, unsigned ip_mask, unsigned not_flag) |
static int | sfthd_create_threshold_global (THD_STRUCT *thd, unsigned gen_id, unsigned sig_id, int tracking, int type, int priority, int count, int seconds, unsigned ip_address, unsigned ip_mask) |
int | sfthd_create_threshold (THD_STRUCT *thd, unsigned gen_id, unsigned sig_id, int tracking, int type, int priority, int count, int seconds, unsigned ip_address, unsigned ip_mask, unsigned not_flag) |
static int | sfthd_test_object (THD_STRUCT *thd, THD_NODE *sfthd_node, unsigned sip, unsigned dip, time_t curtime) |
static int | sfthd_test_gobject (THD_STRUCT *thd, THD_NODE *sfthd_node, unsigned gen_id, unsigned sig_id, unsigned sip, unsigned dip, time_t curtime) |
int | sfthd_test_threshold (THD_STRUCT *thd, unsigned gen_id, unsigned sig_id, unsigned sip, unsigned dip, long curtime) |
int | sfthd_show_objects (THD_STRUCT *thd) |
Variables | |
static int | s_id = 1 |
Copyright (C) 2003 Sourcefire,Inc. Marc Norton
Definition in file sfthd.c.
|
Add a permanent threshold object to the threshold table. Multiple objects may be defined for each gen_id and sig_id pair. Internally a unique threshold id is generated for each pair. Threshold objects track the number of events seen during the time interval specified by seconds. Depending on the type of threshold object and the count value, the thresholding object determines if the current event should be logged or dropped.
Definition at line 443 of file sfthd.c. References sfthd_create_threshold_global(), and sfthd_create_threshold_local(). Referenced by sfthreshold_create(). |
|
Definition at line 356 of file sfthd.c. References THD_NODE::count, THD_NODE::gen_id, THD_NODE::ip_address, THD_NODE::ip_mask, THD_NODE::priority, s_id, THD_NODE::seconds, THD_STRUCT::sfthd_garray, THD_NODE::sig_id, THD_NODE::thd_id, THD_MAX_GENID, THD_NODE::tracking, and THD_NODE::type. Referenced by sfthd_create_threshold(). |
|
Add a permanent threshold object to the threshold table. Multiple objects may be defined for each gen_id and sig_id pair. Internally a unique threshold id is generated for each pair. Threshold objects track the number of events seen during the time interval specified by seconds. Depending on the type of threshold object and the count value, the thresholding object determines if the current event should be logged or dropped.
Definition at line 140 of file sfthd.c. References THD_STRUCT::count, THD_NODE::count, sf_list::count, THD_NODE::gen_id, THD_ITEM::gen_id, THD_NODE::ip_address, THD_NODE::ip_mask, sf_lnode::ndata, sf_lnode::next, THD_NODE::not_flag, THD_NODE::priority, s_id, THD_NODE::seconds, sfghash_add(), sfghash_find(), sfghash_new(), sflist_add_before(), sflist_add_head(), sflist_add_tail(), sflist_first_node(), sflist_new(), sflist_next_node(), THD_STRUCT::sfthd_array, THD_ITEM::sfthd_node_list, THD_NODE::sig_id, THD_ITEM::sig_id, sf_list::tail, THD_GEN_ID_1_ROWS, THD_GEN_ID_ROWS, THD_NODE::thd_id, THD_MAX_GENID, THD_PRIORITY_SUPPRESS, THD_TOO_MANY_THDOBJ, THD_TYPE_SUPPRESS, THD_NODE::tracking, and THD_NODE::type. Referenced by sfthd_create_threshold(). |
|
Create a threshold table, initialize the threshold system, and optionally limit it's memory usage.
Definition at line 48 of file sfthd.c. References THD_STRUCT::ip_gnodes, THD_STRUCT::ip_nodes, and sfxhash_new(). Referenced by sfthreshold_init(). |
|
A function to print the thresholding objects to stdout. Definition at line 1081 of file sfthd.c. References THD_NODE::count, _sfghash_node::data, THD_NODE::ip_address, THD_NODE::ip_mask, THD_NODE::priority, THD_NODE::seconds, sfghash_findfirst(), sfghash_findnext(), sflist_first(), sflist_next(), THD_STRUCT::sfthd_array, THD_ITEM::sfthd_node_list, THD_ITEM::sig_id, THD_NODE::thd_id, THD_MAX_GENID, THD_TYPE_BOTH, THD_TYPE_LIMIT, THD_TYPE_SUPPRESS, THD_TYPE_THRESHOLD, THD_NODE::tracking, and THD_NODE::type. |
|
Definition at line 714 of file sfthd.c. References _sfxhash::cnode, THD_NODE::count, THD_IP_GNODE::count, _sfxhash_node::data, THD_NODE::gen_id, THD_IP_GNODE_KEY::gen_id, THD_IP_GNODE_KEY::ip, THD_NODE::ip_address, THD_STRUCT::ip_gnodes, THD_NODE::ip_mask, THD_NODE::seconds, sfxhash_add(), SFXHASH_INTABLE, THD_IP_GNODE_KEY::sig_id, THD_TRK_SRC, THD_TYPE_BOTH, THD_TYPE_LIMIT, THD_TYPE_SUPPRESS, THD_TYPE_THRESHOLD, THD_NODE::tracking, THD_IP_GNODE::tstart, and THD_NODE::type. Referenced by sfthd_test_threshold(). |
|
Find/Test/Add an event against a single threshold object. Events without thresholding objects are automatically loggable.
Definition at line 517 of file sfthd.c. References _sfxhash::cnode, THD_NODE::count, THD_IP_NODE::count, _sfxhash_node::data, THD_IP_NODE::ip, THD_IP_NODE_KEY::ip, THD_NODE::ip_address, THD_NODE::ip_mask, THD_STRUCT::ip_nodes, THD_NODE::not_flag, THD_NODE::seconds, sfxhash_add(), SFXHASH_INTABLE, THD_NODE::thd_id, THD_IP_NODE_KEY::thd_id, THD_TRK_SRC, THD_TYPE_BOTH, THD_TYPE_LIMIT, THD_TYPE_SUPPRESS, THD_TYPE_THRESHOLD, THD_NODE::tracking, THD_IP_NODE::tstart, and THD_NODE::type. Referenced by sfthd_test_threshold(). |
|
Test a an event against the threshold database. Events without thresholding objects are automatically loggable.
Definition at line 923 of file sfthd.c. References THD_ITEM::gen_id, sfghash_find(), sflist_first(), sflist_next(), THD_STRUCT::sfthd_array, THD_STRUCT::sfthd_garray, THD_ITEM::sfthd_node_list, sfthd_test_gobject(), sfthd_test_object(), THD_ITEM::sig_id, THD_NODE::thd_id, THD_MAX_GENID, and THD_NODE::type. Referenced by sfthreshold_test(). |
|
Definition at line 22 of file sfthd.c. Referenced by sfthd_create_threshold_global(), and sfthd_create_threshold_local(). |