summaryrefslogtreecommitdiffstats
path: root/include/libnftnl/common.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2015-09-01 19:34:18 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2015-09-07 19:24:33 +0200
commit96807c4c05e1e76b8bbf00d874a28a279e7d2840 (patch)
treefc74bc7a9bdc6c3e16524449812bc6cc7f51c5eb /include/libnftnl/common.h
parent760768890e60617acfd144dce875a4a3be14513c (diff)
src: add compat header file definitions
This patch restores the original nft_* definitions from the header files to avoid sudden compilation breakage of the existing clients of this library. Then, moving forward the idea is to deprecate the old nft_* symbols anytime soon using __attribute__((deprecated)) from the header files to warn our users that they need to update their code. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/libnftnl/common.h')
-rw-r--r--include/libnftnl/common.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/include/libnftnl/common.h b/include/libnftnl/common.h
index b9c6ff3..a40688c 100644
--- a/include/libnftnl/common.h
+++ b/include/libnftnl/common.h
@@ -52,4 +52,57 @@ int nftnl_batch_is_supported(void);
void nftnl_batch_begin(char *buf, uint32_t seq);
void nftnl_batch_end(char *buf, uint32_t seq);
+/*
+ * Compat
+ */
+
+enum {
+ NFT_PARSE_EBADINPUT = 0,
+ NFT_PARSE_EMISSINGNODE,
+ NFT_PARSE_EBADTYPE,
+ NFT_PARSE_EOPNOTSUPP,
+};
+
+enum nft_output_type {
+ NFT_OUTPUT_DEFAULT = 0,
+ NFT_OUTPUT_XML,
+ NFT_OUTPUT_JSON,
+};
+
+enum nft_output_flags {
+ NFT_OF_EVENT_NEW = (1 << 0),
+ NFT_OF_EVENT_DEL = (1 << 1),
+ NFT_OF_EVENT_ANY = (NFT_OF_EVENT_NEW | NFT_OF_EVENT_DEL),
+};
+
+enum nft_cmd_type {
+ NFT_CMD_UNSPEC = 0,
+ NFT_CMD_ADD,
+ NFT_CMD_INSERT,
+ NFT_CMD_DELETE,
+ NFT_CMD_REPLACE,
+ NFT_CMD_FLUSH,
+ NFT_CMD_MAX,
+};
+
+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);
+
+int nft_batch_is_supported(void);
+void nft_batch_begin(char *buf, uint32_t seq);
+void nft_batch_end(char *buf, uint32_t seq);
+
#endif