File: data_reg.h

package info (click to toggle)
libnftnl 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,060 kB
  • sloc: ansic: 25,721; sh: 5,175; makefile: 340
file content (40 lines) | stat: -rw-r--r-- 741 bytes parent folder | download | duplicates (2)
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
37
38
39
40
#ifndef _DATA_H_
#define _DATA_H_

#include <linux/netfilter/nf_tables.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>

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

enum {
	DATA_F_NOPFX = 1 << 0,
};

union nftnl_data_reg {
	struct {
		uint32_t	val[NFT_DATA_VALUE_MAXLEN / sizeof(uint32_t)];
		uint32_t	len;
	};
	struct {
		uint32_t	verdict;
		const char	*chain;
		uint32_t	chain_id;
	};
};

int nftnl_data_reg_snprintf(char *buf, size_t size,
			    const union nftnl_data_reg *reg,
			    uint32_t flags, int reg_type);
struct nlattr;

int nftnl_parse_data(union nftnl_data_reg *data, struct nlattr *attr, int *type);
int nftnl_data_cpy(union nftnl_data_reg *dreg, const void *src, uint32_t len);

#endif