suricata
|
#include "suricata-common.h"
#include "suricata.h"
#include "rust.h"
#include "datasets.h"
#include "datasets-context-json.h"
#include "datasets-ipv4.h"
#include "datasets-ipv6.h"
#include "datasets-md5.h"
#include "datasets-sha256.h"
#include "datasets-string.h"
#include "util-byte.h"
#include "util-ip.h"
#include "util-debug.h"
Go to the source code of this file.
Functions | |
void | DatajsonUnlockElt (DataJsonResultType *r) |
int | DatajsonCopyJson (DataJsonType *dst, DataJsonType *src) |
Dataset * | DatajsonGet (const char *name, enum DatasetTypes type, const char *load, uint64_t memcap, uint32_t hashsize, char *json_key_value, char *json_array_key, DatasetFormats format, bool remove_key) |
DataJsonResultType | DatajsonLookup (Dataset *set, const uint8_t *data, const uint32_t data_len) |
int | DatajsonAddSerialized (Dataset *set, const char *value, const char *json) |
add serialized data to json set | |
Definition in file datasets-context-json.c.
int DatajsonAddSerialized | ( | Dataset * | set, |
const char * | value, | ||
const char * | json | ||
) |
add serialized data to json set
int | 1 added |
int | 0 already in hash |
int | -1 API error (not added) |
int | -2 DATA error |
Definition at line 875 of file datasets-context-json.c.
References DATASET_TYPE_IPV4, DATASET_TYPE_IPV6, DATASET_TYPE_MD5, DATASET_TYPE_SHA256, DATASET_TYPE_STRING, DatasetParseIpv6String(), HexToRaw(), Dataset::load, Dataset::name, SC_IPV4_LEN, SC_IPV6_LEN, SC_MD5_LEN, SC_SHA256_LEN, SCFree, SCLogError, SCLogNotice, Dataset::type, and DataJsonType::value.
int DatajsonCopyJson | ( | DataJsonType * | dst, |
DataJsonType * | src | ||
) |
Definition at line 54 of file datasets-context-json.c.
References dst, SCMalloc, and src.
Referenced by IPv4JsonSet(), IPv6JsonSet(), Md5StrJsonSet(), Sha256StrJsonSet(), and StringJsonSet().
Dataset * DatajsonGet | ( | const char * | name, |
enum DatasetTypes | type, | ||
const char * | load, | ||
uint64_t | memcap, | ||
uint32_t | hashsize, | ||
char * | json_key_value, | ||
char * | json_array_key, | ||
DatasetFormats | format, | ||
bool | remove_key | ||
) |
Definition at line 631 of file datasets-context-json.c.
References DATASET_TYPE_IPV4, DATASET_TYPE_IPV6, DATASET_TYPE_MD5, DATASET_TYPE_SHA256, DATASET_TYPE_STRING, DatasetAppendSet(), DatasetGetOrCreate(), DatasetLock(), DatasetUnlock(), Dataset::hash, hashsize, IPv4Compare(), IPv4Hash(), IPv4JsonFree(), IPv4JsonGetLength(), IPv4JsonSet(), IPv6Compare(), IPv6Hash(), IPv6JsonFree(), IPv6JsonGetLength(), IPv6JsonSet(), Dataset::load, Md5StrCompare(), Md5StrHash(), Md5StrJsonFree(), Md5StrJsonGetLength(), Md5StrJsonSet(), Dataset::name, name, Dataset::remove_key, Dataset::save, SCFree, SCLogDebug, SCLogError, Sha256StrCompare(), Sha256StrHash(), Sha256StrJsonFree(), Sha256StrJsonGetLength(), Sha256StrJsonSet(), StringCompare(), StringHash(), StringJsonFree(), StringJsonGetLength(), StringJsonSet(), THashInit(), THashShutdown(), Dataset::type, and type.
DataJsonResultType DatajsonLookup | ( | Dataset * | set, |
const uint8_t * | data, | ||
const uint32_t | data_len | ||
) |
Definition at line 846 of file datasets-context-json.c.
References DATASET_TYPE_IPV4, DATASET_TYPE_IPV6, DATASET_TYPE_MD5, DATASET_TYPE_SHA256, DATASET_TYPE_STRING, DataJsonResultType::found, and Dataset::type.
void DatajsonUnlockElt | ( | DataJsonResultType * | r | ) |
Definition at line 47 of file datasets-context-json.c.
References DataJsonResultType::hashdata.