summaryrefslogtreecommitdiffstats
path: root/include/libnftnl/common.h
blob: 9d18b2baa359606aee77c9fd068a4f3972380983 (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
#ifndef _LIBNFTNL_COMMON_H_
#define _LIBNFTNL_COMMON_H_

enum {
	NFT_PARSE_EBADINPUT	= 0,
	NFT_PARSE_EMISSINGNODE,
	NFT_PARSE_EBADTYPE,
};

enum nft_output_type {
	NFT_OUTPUT_DEFAULT	= 0,
	NFT_OUTPUT_XML,
	NFT_OUTPUT_JSON,
};

enum nft_parse_type {
	NFT_PARSE_NONE		= 0,
	NFT_PARSE_XML,
	NFT_PARSE_JSON,
	NFT_PARSE_MAX,
};

struct nft_parse_err;

struct nlmsghdr *nft_nlmsg_build_hdr(char *buf, uint16_t cmd, uint16_t family,
				     uint16_t type, uint32_t seq);

struct nft_parse_err *nft_parse_err_alloc(void);
void nft_parse_err_free(struct nft_parse_err *);
int nft_parse_perror(const char *str, struct nft_parse_err *err);
#endif