netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 1/3] set: print set elem timeout information
Date: Sun, 12 Apr 2015 20:24:47 +0100	[thread overview]
Message-ID: <1428866689-17679-2-git-send-email-kaber@trash.net> (raw)
In-Reply-To: <1428866689-17679-1-git-send-email-kaber@trash.net>

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 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


  reply	other threads:[~2015-04-12 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-12 19:24 [PATCH 0/3] libnfnl: support for new set features Patrick McHardy
2015-04-12 19:24 ` Patrick McHardy [this message]
2015-04-12 19:24 ` [PATCH 2/3] set_elem: add support for userdata Patrick McHardy
2015-04-12 19:24 ` [PATCH 3/3] expr: add support for the dynset expr Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428866689-17679-2-git-send-email-kaber@trash.net \
    --to=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).