summaryrefslogtreecommitdiffstats
path: root/include/common.h
blob: 4b9e2c563a088b2d089cb763929d96a5851a8539 (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
#ifndef _LIBNFTNL_COMMON_INTERNAL_H
#define _LIBNFTNL_COMMON_INTERNAL_H

#define BASE_DEC 10
#define BASE_HEX 16

#define NFT_SNPRINTF_BUFSIZ 4096

struct nft_parse_err {
	int line;
	int column;
	int error;
	const char *node_name;
};

enum nft_parse_input {
	NFT_PARSE_BUFFER,
	NFT_PARSE_FILE,
};

#include <stdio.h>

int nft_cmd_header_snprintf(char *buf, size_t bufsize, uint32_t cmd,
			   uint32_t format, uint32_t flags);
int nft_cmd_header_fprintf(FILE *fp, uint32_t cmd, uint32_t format,
			  uint32_t flags);
int nft_cmd_footer_snprintf(char *buf, size_t bufsize, uint32_t cmd,
			   uint32_t format, uint32_t flags);
int nft_cmd_footer_fprintf(FILE *fp, uint32_t cmd, uint32_t format,
			  uint32_t flags);

#endif