From 337636fc670eaed5c7146f99af8719018f63fe3b Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 19 May 2014 12:18:04 +0200 Subject: src: add set netlink message to the batch This patch moves the netlink set messages to the batch that contains the rules. This helps to speed up rule-set restoration time by changing the operational. To achieve this, an internal set ID which is unique to the batch is allocated as suggested by Patrick. To retain backward compatibility, nft initially guesses if the kernel supports set in batches. Otherwise, it falls back to the previous (slowier) operational. Signed-off-by: Pablo Neira Ayuso --- include/netlink.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/netlink.h') diff --git a/include/netlink.h b/include/netlink.h index eca4a483..4ef7365f 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -30,6 +30,7 @@ struct netlink_ctx { struct set *set; const void *data; uint32_t seqnum; + bool batch_supported; }; extern struct nft_table *alloc_nft_table(const struct handle *h); @@ -153,4 +154,6 @@ struct netlink_mon_handler { }; extern int netlink_monitor(struct netlink_mon_handler *monhandler); +bool netlink_batch_supported(void); + #endif /* NFTABLES_NETLINK_H */ -- cgit v1.2.3