summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-10-10 14:17:44 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-10-10 15:06:41 +0200
commitd6ed28a3b3d96965dcf67656e8321f8835c0aa05 (patch)
tree292efdd1020b2faba5fbc65b6bdcd95505a507c4 /include
parentf354d6d24809f2ef520f6566b8f0e7095e76995d (diff)
mnl: remove alloc_nftnl_set()
We can remove alloc_nftnl_set() and consolidate infrastructure in the src/mnl.c file. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/mnl.h18
-rw-r--r--include/netlink.h14
2 files changed, 12 insertions, 20 deletions
diff --git a/include/mnl.h b/include/mnl.h
index c5fcb4cd..3ddc82a0 100644
--- a/include/mnl.h
+++ b/include/mnl.h
@@ -51,19 +51,17 @@ 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);
-int mnl_nft_set_batch_add(struct nftnl_set *nls, struct nftnl_batch *batch,
- unsigned int flags, uint32_t seqnum);
-int mnl_nft_set_batch_del(struct nftnl_set *nls, struct nftnl_batch *batch,
- unsigned int flags, uint32_t seqnum);
+int mnl_nft_set_add(struct netlink_ctx *ctx, const struct cmd *cmd,
+ unsigned int flags);
+int mnl_nft_set_del(struct netlink_ctx *ctx, const struct cmd *cmd);
+
struct nftnl_set_list *mnl_nft_set_dump(struct netlink_ctx *ctx, int family,
const char *table);
-int mnl_nft_setelem_batch_add(struct nftnl_set *nls, struct nftnl_batch *batch,
- unsigned int flags, uint32_t seqnum);
-int mnl_nft_setelem_batch_del(struct nftnl_set *nls, struct nftnl_batch *batch,
- unsigned int flags, uint32_t seqnum);
-int mnl_nft_setelem_batch_flush(struct nftnl_set *nls, struct nftnl_batch *batch,
- unsigned int flags, uint32_t seqnum);
+int mnl_nft_setelem_add(struct netlink_ctx *ctx, const struct set *set,
+ const struct expr *expr, unsigned int flags);
+int mnl_nft_setelem_del(struct netlink_ctx *ctx, const struct cmd *cmd);
+int mnl_nft_setelem_flush(struct netlink_ctx *ctx, const struct cmd *cmd);
int mnl_nft_setelem_get(struct netlink_ctx *ctx, struct nftnl_set *nls);
struct nftnl_set *mnl_nft_setelem_get_one(struct netlink_ctx *ctx,
struct nftnl_set *nls);
diff --git a/include/netlink.h b/include/netlink.h
index 36a89b9b..57e1d98a 100644
--- a/include/netlink.h
+++ b/include/netlink.h
@@ -58,7 +58,7 @@ struct netlink_ctx {
};
extern struct nftnl_expr *alloc_nft_expr(const char *name);
-extern struct nftnl_set *alloc_nftnl_set(const struct handle *h);
+extern void alloc_setelem_cache(const struct expr *set, struct nftnl_set *nls);
struct nft_data_linearize {
uint32_t len;
@@ -118,10 +118,6 @@ extern int netlink_flush_table(struct netlink_ctx *ctx, const struct cmd *cmd);
extern struct table *netlink_delinearize_table(struct netlink_ctx *ctx,
const struct nftnl_table *nlt);
-extern int netlink_add_set_batch(struct netlink_ctx *ctx, const struct cmd *cmd,
- uint32_t flags);
-extern int netlink_delete_set_batch(struct netlink_ctx *ctx,
- const struct cmd *cmd);
extern int netlink_list_sets(struct netlink_ctx *ctx, const struct handle *h);
extern struct set *netlink_delinearize_set(struct netlink_ctx *ctx,
const struct nftnl_set *nls);
@@ -130,16 +126,11 @@ extern struct stmt *netlink_parse_set_expr(const struct set *set,
const struct nft_cache *cache,
const struct nftnl_expr *nle);
-extern int netlink_add_setelems_batch(struct netlink_ctx *ctx, const struct handle *h,
- const struct expr *expr, uint32_t flags);
-extern int netlink_delete_setelems_batch(struct netlink_ctx *ctx,
- const struct cmd *cmd);
extern int netlink_list_setelems(struct netlink_ctx *ctx,
const struct handle *h, struct set *set);
extern int netlink_get_setelem(struct netlink_ctx *ctx, const struct handle *h,
const struct location *loc, struct table *table,
struct set *set, struct expr *init);
-extern int netlink_flush_setelems(struct netlink_ctx *ctx, const struct cmd *cmd);
extern int netlink_delinearize_setelem(struct nftnl_set_elem *nlse,
const struct set *set,
struct nft_cache *cache);
@@ -212,4 +203,7 @@ int netlink_markup_parse_cb(const struct nftnl_parse_ctx *ctx);
int netlink_events_trace_cb(const struct nlmsghdr *nlh, int type,
struct netlink_mon_handler *monh);
+enum nft_data_types dtype_map_to_kernel(const struct datatype *dtype);
+const struct datatype *dtype_map_from_kernel(enum nft_data_types type);
+
#endif /* NFTABLES_NETLINK_H */