From 12c362e2214a04786a68a8effc2e9580833b1586 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 26 Sep 2018 16:20:08 +0200 Subject: mnl: remove alloc_nftnl_table() The netlink layer sits in between the mnl and the rule layers, remove it. We can remove alloc_nftnl_table() and consolidate infrastructure in the src/mnl.c file. Signed-off-by: Pablo Neira Ayuso --- include/mnl.h | 9 +++++---- include/netlink.h | 7 ------- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/mnl.h b/include/mnl.h index 36109c7a..44dd90f9 100644 --- a/include/mnl.h +++ b/include/mnl.h @@ -3,6 +3,7 @@ #include #include +#include #include struct mnl_socket *netlink_open_sock(void); @@ -42,10 +43,10 @@ int mnl_nft_chain_batch_del(struct nftnl_chain *nlc, struct nftnl_batch *batch, struct nftnl_chain_list *mnl_nft_chain_dump(struct netlink_ctx *ctx, int family); -int mnl_nft_table_batch_add(struct nftnl_table *nlt, struct nftnl_batch *batch, - unsigned int flags, uint32_t seqnum); -int mnl_nft_table_batch_del(struct nftnl_table *nlt, struct nftnl_batch *batch, - unsigned int flags, uint32_t seqnum); +int mnl_nft_table_add(struct netlink_ctx *ctx, const struct cmd *cmd, + unsigned int flags); +int mnl_nft_table_del(struct netlink_ctx *ctx, const struct cmd *cmd); + struct nftnl_table_list *mnl_nft_table_dump(struct netlink_ctx *ctx, int family); diff --git a/include/netlink.h b/include/netlink.h index 4925af04..42c3eb90 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -57,7 +57,6 @@ struct netlink_ctx { struct nft_cache *cache; }; -extern struct nftnl_table *alloc_nftnl_table(const struct handle *h); extern struct nftnl_chain *alloc_nftnl_chain(const struct handle *h); extern struct nftnl_rule *alloc_nftnl_rule(const struct handle *h); extern struct nftnl_expr *alloc_nft_expr(const char *name); @@ -130,10 +129,6 @@ extern int netlink_flush_chain(struct netlink_ctx *ctx, const struct cmd *cmd); extern struct chain *netlink_delinearize_chain(struct netlink_ctx *ctx, const struct nftnl_chain *nlc); -extern int netlink_add_table_batch(struct netlink_ctx *ctx, - const struct cmd *cmd, uint32_t flags); -extern int netlink_delete_table_batch(struct netlink_ctx *ctx, - const struct cmd *cmd); extern int netlink_list_tables(struct netlink_ctx *ctx, const struct handle *h); extern int netlink_list_table(struct netlink_ctx *ctx, const struct handle *h); extern int netlink_flush_table(struct netlink_ctx *ctx, const struct cmd *cmd); @@ -205,8 +200,6 @@ extern int netlink_io_error(struct netlink_ctx *ctx, __netlink_init_error(__FILE__, __LINE__, strerror(errno)); extern void __noreturn __netlink_init_error(const char *file, int line, const char *reason); -extern int netlink_flush_ruleset(struct netlink_ctx *ctx, const struct cmd *cmd); - extern struct nftnl_ruleset *netlink_dump_ruleset(struct netlink_ctx *ctx, const struct handle *h, const struct location *loc); -- cgit v1.2.3