set: add support for set mechanism selection
PATCH 1/1 set: add support for set mechanism selection
This patch adds support to select the set mechanism. The kernel support was added in commit:
c50b960 netfilter: nf_tables: implement proper set selection
Signed-off-by Arturo Borrero Gonzalez <[email protected]>
--- include/libnftnl/set.h | 2 + src/internal.h | 5 + src/set.c | 170 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 174 insertions(+), 3 deletions(-)
include/libnftnl/set.h +2 -0
@@ -18,6 +18,8 @@ enum {NFT_SET_ATTR_DATA_LEN ,NFT_SET_ATTR_FAMILY ,NFT_SET_ATTR_ID , +NFT_SET_ATTR_DESC_POLICY , +NFT_SET_ATTR_DESC_SIZE , __NFT_SET_ATTR_MAX };#define NFT_SET_ATTR_MAX (__NFT_SET_ATTR_MAX - 1)
src/internal.h +5 -0
@@ -14,6 +14,7 @@#include <stdint.h> #include <stdbool.h> #include <libnftnl/common.h> +#include <linux/netfilter/nf_tables.h> #define BASE_DEC 10#define BASE_HEX 16
@@ -168,6 +169,10 @@ struct nft_set {uint32_t data_type;uint32_t data_len;uint32_t id; +struct { +enum nft_set_policies policy; +uint32_t size; + } desc;struct list_head element_list;uint32_t flags;
src/set.c +167 -3
273 lines not on this page · raw message
Quoted 3 lines · Arturo Borrero Gonzalez
This patch adds support to select the set mechanism. The kernel support was added in commit:
c50b960 netfilter:nf_tables: implement proper set selection
I have moved the policy out of the desc area so we have a 1:1 mapping with what we have in the kernel.
I also fixed a compilation warning in XML code.
Applied, thanks Arturo.