This embedded struct in struct nftnl_set holds useful info about data in elements. Export it to users for later use as parameter to API functions. Signed-off-by: Phil Sutter <phil@xxxxxx> --- include/libnftnl/set.h | 10 ++++++++++ include/set.h | 10 ++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/libnftnl/set.h b/include/libnftnl/set.h index 958bbc9065f67..d19635716b581 100644 --- a/include/libnftnl/set.h +++ b/include/libnftnl/set.h @@ -7,6 +7,7 @@ #include <sys/types.h> #include <libnftnl/common.h> +#include <linux/netfilter/nf_tables.h> #ifdef __cplusplus extern "C" { @@ -38,6 +39,15 @@ enum nftnl_set_attr { }; #define NFTNL_SET_MAX (__NFTNL_SET_MAX - 1) +struct nftnl_set_desc { + uint32_t size; + uint32_t byteorder; + uint8_t field_len[NFT_REG32_COUNT]; + uint8_t field_count; + uint8_t data_len[NFT_REG32_COUNT]; + uint8_t data_count; +}; + struct nftnl_set; struct nftnl_set *nftnl_set_alloc(void); diff --git a/include/set.h b/include/set.h index a9f6225401a4e..42e761a2a22bf 100644 --- a/include/set.h +++ b/include/set.h @@ -2,6 +2,7 @@ #define _LIBNFTNL_SET_INTERNAL_H_ #include <linux/netfilter/nf_tables.h> +#include <libnftnl/set.h> struct nftnl_set { struct list_head head; @@ -23,14 +24,7 @@ struct nftnl_set { } user; uint32_t id; enum nft_set_policies policy; - struct { - uint32_t size; - uint32_t byteorder; - uint8_t field_len[NFT_REG32_COUNT]; - uint8_t field_count; - uint8_t data_len[NFT_REG32_COUNT]; - uint8_t data_count; - } desc; + struct nftnl_set_desc desc; struct list_head element_list; uint32_t flags; -- 2.33.0