summaryrefslogtreecommitdiffstats
path: root/src/expr/data_reg.h
blob: 8a6a2350159038787e8a20554fe3df09b78d3346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _DATA_H_
#define _DATA_H_

enum {
	DATA_NONE,
	DATA_VALUE,
	DATA_VERDICT,
	DATA_CHAIN,
};

union nft_data_reg {
	struct {
		uint32_t	val[4];
		uint32_t	len;
	};
	struct {
		int		verdict;
		const char	*chain;
	};
};

#ifndef JSON_PARSING
#define json_t void
#endif

#ifndef XML_PARSING
#define mxml_node_t void
#endif

int nft_data_reg_snprintf(char *buf, size_t size, union nft_data_reg *reg,
                        uint32_t output_format, uint32_t flags, int reg_type);
int nft_data_reg_xml_parse(union nft_data_reg *reg, mxml_node_t *tree);
int nft_parse_data(union nft_data_reg *data, struct nlattr *attr, int *type);
int nft_data_reg_json_parse(union nft_data_reg *reg, json_t *data);

#endif