From 033ec6be245261cd5e53e5a01435afea71ef6230 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 3 Jul 2013 13:06:22 +0200 Subject: conntrack: api: add nfct_snprintf_labels nfct_snprintf doesn't print connlabels, as they're system specific and can easily generate lots of output. This adds a new helper function, nfct_snprintf_labels. It behaves like nfct_snprintf, except that the label names in the labelmap whose bits are contained in connlabel attribute bitset are added to the buffer. output looks like this: output looks like this: ... mark=0 use=1 labels=eth0-in,eth1-in or Signed-off-by: Florian Westphal --- src/conntrack/snprintf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/conntrack/snprintf.c') diff --git a/src/conntrack/snprintf.c b/src/conntrack/snprintf.c index 9a9017d..17ad885 100644 --- a/src/conntrack/snprintf.c +++ b/src/conntrack/snprintf.c @@ -68,16 +68,17 @@ int __snprintf_conntrack(char *buf, const struct nf_conntrack *ct, unsigned int type, unsigned int msg_output, - unsigned int flags) + unsigned int flags, + struct nfct_labelmap *map) { int size; switch(msg_output) { case NFCT_O_DEFAULT: - size = __snprintf_conntrack_default(buf, len, ct, type, flags); + size = __snprintf_conntrack_default(buf, len, ct, type, flags, map); break; case NFCT_O_XML: - size = __snprintf_conntrack_xml(buf, len, ct, type, flags); + size = __snprintf_conntrack_xml(buf, len, ct, type, flags, map); break; default: errno = ENOENT; -- cgit v1.2.3