summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2025-04-08 15:58:42 +0200
committerFlorian Westphal <fw@strlen.de>2025-06-22 19:38:17 +0200
commit81d19bc4a52cd0d4ec976c19d2320e102553c315 (patch)
tree955b638038ec18832808b0f44b07c760791fb5f8 /include
parent17190762f33f78090f5ff99a436c4cb866ac3ccd (diff)
set: dump set backend name (hash, rbtree...) and elem count, if available
In case kernel provided the information do include it in debug dump: nft --debug=netlink list ruleset family 2 s t 0 backend nft_set_rhash_type family 2 __set0 t 3 size 3 backend nft_set_hash_fast_type count 3 family 2 __set1 t 3 size 2 backend nft_set_bitmap_type count 2 [..] Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include')
-rw-r--r--include/libnftnl/set.h1
-rw-r--r--include/linux/netfilter/nf_tables.h4
-rw-r--r--include/set.h2
3 files changed, 7 insertions, 0 deletions
diff --git a/include/libnftnl/set.h b/include/libnftnl/set.h
index e2e5795..cad5e8e 100644
--- a/include/libnftnl/set.h
+++ b/include/libnftnl/set.h
@@ -32,6 +32,7 @@ enum nftnl_set_attr {
NFTNL_SET_DESC_CONCAT,
NFTNL_SET_EXPR,
NFTNL_SET_EXPRESSIONS,
+ NFTNL_SET_COUNT,
__NFTNL_SET_MAX
};
#define NFTNL_SET_MAX (__NFTNL_SET_MAX - 1)
diff --git a/include/linux/netfilter/nf_tables.h b/include/linux/netfilter/nf_tables.h
index 49c944e..7d6bc19 100644
--- a/include/linux/netfilter/nf_tables.h
+++ b/include/linux/netfilter/nf_tables.h
@@ -394,6 +394,8 @@ enum nft_set_field_attributes {
* @NFTA_SET_HANDLE: set handle (NLA_U64)
* @NFTA_SET_EXPR: set expression (NLA_NESTED: nft_expr_attributes)
* @NFTA_SET_EXPRESSIONS: list of expressions (NLA_NESTED: nft_list_attributes)
+ * @NFTA_SET_TYPE: set backend type (NLA_STRING)
+ * @NFTA_SET_COUNT: number of set elements (NLA_U32)
*/
enum nft_set_attributes {
NFTA_SET_UNSPEC,
@@ -415,6 +417,8 @@ enum nft_set_attributes {
NFTA_SET_HANDLE,
NFTA_SET_EXPR,
NFTA_SET_EXPRESSIONS,
+ NFTA_SET_TYPE,
+ NFTA_SET_COUNT,
__NFTA_SET_MAX
};
#define NFTA_SET_MAX (__NFTA_SET_MAX - 1)
diff --git a/include/set.h b/include/set.h
index 55018b6..bda8068 100644
--- a/include/set.h
+++ b/include/set.h
@@ -11,6 +11,7 @@ struct nftnl_set {
uint32_t set_flags;
const char *table;
const char *name;
+ const char *type;
uint64_t handle;
uint32_t key_type;
uint32_t key_len;
@@ -31,6 +32,7 @@ struct nftnl_set {
struct list_head element_list;
uint32_t flags;
+ uint32_t elemcount;
uint32_t gc_interval;
uint64_t timeout;
struct list_head expr_list;