[PATCH 1/3] set: print set elem timeout information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
---
 src/set.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/set.c b/src/set.c
index d58c9e1..b07c4d9 100644
--- a/src/set.c
+++ b/src/set.c
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <inttypes.h>
 #include <netinet/in.h>
 #include <limits.h>
 #include <errno.h>
@@ -870,6 +871,18 @@ static int nft_set_snprintf_default(char *buf, size_t size, struct nft_set *s,
 			s->name, s->table, s->set_flags);
 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
 
+	if (s->flags & (1 << NFT_SET_ATTR_TIMEOUT)) {
+		ret = snprintf(buf + offset, len, " timeout %"PRIu64"ms",
+			       s->timeout);
+		SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+	}
+
+	if (s->flags & (1 << NFT_SET_ATTR_GC_INTERVAL)) {
+		ret = snprintf(buf + offset, len, " gc_interval %ums",
+			       s->gc_interval);
+		SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+	}
+
 	if (s->flags & (1 << NFT_SET_ATTR_POLICY)) {
 		ret = snprintf(buf + offset, len, " policy %u", s->policy);
 		SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux