suricata
|
#include "suricata-common.h"
#include "suricata.h"
#include "rust.h"
#include "conf.h"
#include "datasets.h"
#include "datasets-string.h"
#include "datasets-ipv4.h"
#include "datasets-ipv6.h"
#include "datasets-md5.h"
#include "datasets-sha256.h"
#include "datasets-reputation.h"
#include "util-conf.h"
#include "util-thash.h"
#include "util-print.h"
#include "util-byte.h"
#include "util-misc.h"
#include "util-path.h"
#include "util-debug.h"
Go to the source code of this file.
Typedefs | |
typedef int(* | DatasetOpFunc) (Dataset *set, const uint8_t *data, const uint32_t data_len) |
Enumerations | |
enum | DatasetGetPathType { TYPE_STATE, TYPE_LOAD } |
Functions | |
enum DatasetTypes | DatasetGetTypeFromString (const char *s) |
Dataset * | DatasetFind (const char *name, enum DatasetTypes type) |
look for set by name without creating it More... | |
Dataset * | DatasetGet (const char *name, enum DatasetTypes type, const char *save, const char *load, uint64_t memcap, uint32_t hashsize) |
void | DatasetReload (void) |
void | DatasetPostReloadCleanup (void) |
int | DatasetsInit (void) |
void | DatasetsDestroy (void) |
void | DatasetsSave (void) |
int | DatasetLookup (Dataset *set, const uint8_t *data, const uint32_t data_len) |
see if data is part of the set More... | |
DataRepResultType | DatasetLookupwRep (Dataset *set, const uint8_t *data, const uint32_t data_len, const DataRepType *rep) |
int | DatasetAdd (Dataset *set, const uint8_t *data, const uint32_t data_len) |
int | DatasetAddSerialized (Dataset *set, const char *string) |
add serialized data to set More... | |
int | DatasetLookupSerialized (Dataset *set, const char *string) |
add serialized data to set More... | |
int | DatasetRemoveSerialized (Dataset *set, const char *string) |
remove serialized data from set More... | |
int | DatasetRemove (Dataset *set, const uint8_t *data, const uint32_t data_len) |
Variables | |
SCMutex | sets_lock = SCMUTEX_INITIALIZER |
bool | g_system |
Definition in file datasets.c.
typedef int(* DatasetOpFunc) (Dataset *set, const uint8_t *data, const uint32_t data_len) |
Definition at line 1596 of file datasets.c.
enum DatasetGetPathType |
Enumerator | |
---|---|
TYPE_STATE | |
TYPE_LOAD |
Definition at line 578 of file datasets.c.
int DatasetAdd | ( | Dataset * | set, |
const uint8_t * | data, | ||
const uint32_t | data_len | ||
) |
Definition at line 1555 of file datasets.c.
References DATASET_TYPE_STRING, and Dataset::type.
Referenced by DetectDatasetBufferMatch().
int DatasetAddSerialized | ( | Dataset * | set, |
const char * | string | ||
) |
add serialized data to set
int | 1 added |
int | 0 already in hash |
int | -1 API error (not added) |
int | -2 DATA error |
Definition at line 1659 of file datasets.c.
Dataset* DatasetFind | ( | const char * | name, |
enum DatasetTypes | type | ||
) |
look for set by name without creating it
Definition at line 616 of file datasets.c.
References SCMutexLock, and sets_lock.
Dataset* DatasetGet | ( | const char * | name, |
enum DatasetTypes | type, | ||
const char * | save, | ||
const char * | load, | ||
uint64_t | memcap, | ||
uint32_t | hashsize | ||
) |
Definition at line 630 of file datasets.c.
References DATASET_NAME_MAX_LEN, SCMutexLock, and sets_lock.
enum DatasetTypes DatasetGetTypeFromString | ( | const char * | s | ) |
Definition at line 56 of file datasets.c.
int DatasetLookup | ( | Dataset * | set, |
const uint8_t * | data, | ||
const uint32_t | data_len | ||
) |
see if data is part of the set
set | dataset |
data | data to look up |
data_len | length in bytes of data |
-1 | error |
0 | not found |
1 | found |
Definition at line 1320 of file datasets.c.
References DATASET_TYPE_STRING, and Dataset::type.
Referenced by DetectDatasetBufferMatch().
int DatasetLookupSerialized | ( | Dataset * | set, |
const char * | string | ||
) |
add serialized data to set
int | 1 added |
int | 0 already in hash |
int | -1 API error (not added) |
int | -2 DATA error |
Definition at line 1671 of file datasets.c.
DataRepResultType DatasetLookupwRep | ( | Dataset * | set, |
const uint8_t * | data, | ||
const uint32_t | data_len, | ||
const DataRepType * | rep | ||
) |
Definition at line 1340 of file datasets.c.
References DATASET_TYPE_STRING, DataRepResultType::found, and Dataset::type.
Referenced by DetectDatarepBufferMatch().
void DatasetPostReloadCleanup | ( | void | ) |
Definition at line 809 of file datasets.c.
References SCLogDebug, SCMutexLock, and sets_lock.
void DatasetReload | ( | void | ) |
Definition at line 787 of file datasets.c.
References SCMutexLock, and sets_lock.
int DatasetRemove | ( | Dataset * | set, |
const uint8_t * | data, | ||
const uint32_t | data_len | ||
) |
Definition at line 1755 of file datasets.c.
References DATASET_TYPE_STRING, and Dataset::type.
Referenced by DetectDatasetBufferMatch().
int DatasetRemoveSerialized | ( | Dataset * | set, |
const char * | string | ||
) |
remove serialized data from set
int | 1 removed |
int | 0 found but busy (not removed) |
int | -1 API error (not removed) |
int | -2 DATA error |
Definition at line 1749 of file datasets.c.
void DatasetsDestroy | ( | void | ) |
Definition at line 990 of file datasets.c.
References SCLogDebug.
Referenced by GlobalsDestroy().
int DatasetsInit | ( | void | ) |
Definition at line 856 of file datasets.c.
References ConfGetNode(), and SCLogDebug.
Referenced by PreRunPostPrivsDropInit().
void DatasetsSave | ( | void | ) |
Definition at line 1068 of file datasets.c.
References SCLogDebug.
Referenced by GlobalsDestroy().
bool g_system |
Definition at line 188 of file suricata.c.
SCMutex sets_lock = SCMUTEX_INITIALIZER |
Definition at line 43 of file datasets.c.
Referenced by DatasetFind(), DatasetGet(), DatasetPostReloadCleanup(), and DatasetReload().