path: root/include/set.h
diff options
authorStefano Brivio <>2020-01-30 01:16:33 +0100
committerPablo Neira Ayuso <>2020-02-05 15:49:11 +0100
commit7cd41b5387acf84088e9299a796f7c2c72339a1a (patch)
tree853dc73aedbd68ff86184a581137489e867b9d31 /include/set.h
parent131a6c2fa4cccaa04a7b93b686f10f5ba6f11b3d (diff)
set: Add support for NFTA_SET_DESC_CONCAT attributes
If NFTNL_SET_DESC_CONCAT data is passed, pass that to the kernel as NFTA_SET_DESC_CONCAT attributes: it describes the length of single concatenated fields, in bytes. Similarly, parse NFTA_SET_DESC_CONCAT attributes if received from the kernel. This is the libnftnl counterpart for nftables patch: src: Add support for NFTNL_SET_DESC_CONCAT v4: - move NFTNL_SET_DESC_CONCAT to the end of enum nftnl_set_attr to avoid ABI breakage (Pablo Neira Ayuso) v3: - use NFTNL_SET_DESC_CONCAT and NFTA_SET_DESC_CONCAT instead of a stand-alone NFTA_SET_SUBKEY attribute (Pablo Neira Ayuso) - pass field length in bytes instead of bits, fields would get unnecessarily big otherwise v2: - fixed grammar in commit message - removed copy of array bytes in nftnl_set_nlmsg_build_subkey_payload(), we're simply passing values to htonl() (Phil Sutter) Signed-off-by: Stefano Brivio <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include/set.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/include/set.h b/include/set.h
index 446acd2..895ffdb 100644
--- a/include/set.h
+++ b/include/set.h
@@ -25,6 +25,8 @@ struct nftnl_set {
enum nft_set_policies policy;
struct {
uint32_t size;
+ uint8_t field_len[NFT_REG32_COUNT];
+ uint8_t field_count;
} desc;
struct list_head element_list;