Debian Codegraph @

include/data_reg.h

raw
1 #ifndef _DATA_H_
2 #define _DATA_H_
3
4 #include <linux/netfilter/nf_tables.h>
5 #include <stdint.h>
6 #include <stdbool.h>
7 #include <unistd.h>
8
9 enum {
10 DATA_NONE,
11 DATA_VALUE,
12 DATA_VERDICT,
13 DATA_CHAIN,
14 };
15
16 enum {
17 DATA_F_NOPFX = 1 << 0,
18 };
19
20 union nftnl_data_reg {
21 struct {
22 uint32_t val[NFT_DATA_VALUE_MAXLEN / sizeof(uint32_t)];
23 uint32_t len;
24 };
25 struct {
26 uint32_t verdict;
27 const char *chain;
28 uint32_t chain_id;
29 };
30 };
31
32 int nftnl_data_reg_snprintf(char *buf, size_t size,
33 const union nftnl_data_reg *reg,
34 uint32_t flags, int reg_type);
35 struct nlattr;
36
37 int nftnl_parse_data(union nftnl_data_reg *data, struct nlattr *attr, int *type);
38 int nftnl_data_cpy(union nftnl_data_reg *dreg, const void *src, uint32_t len);
39
40 #endif