suricata
datasets-context-json.h
Go to the documentation of this file.
1/* Copyright (C) 2024 Open Information Security Foundation
2 *
3 * You can copy, redistribute or modify this Program under the terms of
4 * the GNU General Public License version 2 as published by the Free
5 * Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * version 2 along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17
18/**
19 * \file
20 *
21 * \author Eric Leblond <el@stamus-networks.com>
22 */
23
24#ifndef SURICATA_DATASETS_CONTEXT_JSON_H
25#define SURICATA_DATASETS_CONTEXT_JSON_H
26
27#include "suricata-common.h"
28#include "datasets.h"
29
30#define DATAJSON_JSON_LENGTH 1024
31
32typedef struct DataJsonType {
33 char *value;
34 uint16_t len;
36
42
43/* Common functions */
44
45Dataset *DatajsonGet(const char *name, enum DatasetTypes type, const char *load, uint64_t memcap,
46 uint32_t hashsize, char *json_key_value, char *json_array_key, DatasetFormats format,
47 bool remove_key);
48
49DataJsonResultType DatajsonLookup(Dataset *set, const uint8_t *data, const uint32_t data_len);
50
51int DatajsonAddSerialized(Dataset *set, const char *value, const char *json);
52
54
56
57#endif /* SURICATA_DATASETS_CONTEXT_JSON_H */
uint16_t dst
uint16_t src
int DatajsonAddSerialized(Dataset *set, const char *value, const char *json)
add serialized data to json set
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)
int DatajsonCopyJson(DataJsonType *dst, DataJsonType *src)
void DatajsonUnlockElt(DataJsonResultType *r)
DataJsonResultType DatajsonLookup(Dataset *set, const uint8_t *data, const uint32_t data_len)
DatasetTypes
Definition datasets.h:37
DatasetFormats
Definition datasets.h:31
uint16_t type
const char * name
#define hashsize(n)