suricata
datasets-context-json.h File Reference
#include "suricata-common.h"
#include "datasets.h"
Include dependency graph for datasets-context-json.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DataJsonType
 
struct  DataJsonResultType
 

Macros

#define DATAJSON_JSON_LENGTH   1024
 

Typedefs

typedef struct DataJsonType DataJsonType
 
typedef struct DataJsonResultType DataJsonResultType
 

Functions

DatasetDatajsonGet (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
 
void DatajsonUnlockElt (DataJsonResultType *r)
 
int DatajsonCopyJson (DataJsonType *dst, DataJsonType *src)
 

Detailed Description

Macro Definition Documentation

◆ DATAJSON_JSON_LENGTH

#define DATAJSON_JSON_LENGTH   1024

Definition at line 30 of file datasets-context-json.h.

Typedef Documentation

◆ DataJsonResultType

◆ DataJsonType

typedef struct DataJsonType DataJsonType

Function Documentation

◆ DatajsonAddSerialized()

int DatajsonAddSerialized ( Dataset set,
const char *  value,
const char *  json 
)

add serialized data to json set

Return values
int1 added
int0 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.

Here is the call graph for this function:

◆ DatajsonCopyJson()

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().

Here is the caller graph for this function:

◆ DatajsonGet()

◆ DatajsonLookup()

DataJsonResultType DatajsonLookup ( Dataset set,
const uint8_t *  data,
const uint32_t  data_len 
)

◆ DatajsonUnlockElt()

void DatajsonUnlockElt ( DataJsonResultType r)

Definition at line 47 of file datasets-context-json.c.

References DataJsonResultType::hashdata.