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 More...
 
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 31 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 DataJsonType::value.

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

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 
)

◆ 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.