summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>2013-04-07 22:35:02 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2013-04-19 01:35:41 +0200
commit64d53531cb80e1007b32f95e3758e3cc2e4bdae1 (patch)
treef3bca97d47f5c0fb7824076cf923f25cfb30a652 /src/rule.c
parentaa56f410581fe3539b3c907c2a2fdec360481d5c (diff)
src: rule: fix compat XML output
The compat struct was not printed in XML. So, I think give output format is the first step to parse it. Signed-off-by: Arturo Borrero <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rule.c b/src/rule.c
index 68fb6d9..3df1780 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -450,6 +450,13 @@ static int nft_rule_snprintf_xml(char *buf, size_t size, struct nft_rule *r,
(unsigned long long)r->handle);
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+ ret = snprintf(buf+offset, len, "<rule_flags>%u</rule_flags>"
+ "<compat_flags>%u</compat_flags>"
+ "<compat_proto>%u</compat_proto>",
+ r->rule_flags,
+ r->compat.flags, r->compat.proto);
+ SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+
list_for_each_entry(expr, &r->expr_list, head) {
ret = snprintf(buf+offset, len,
"\n\t<expr type=\"%s\">\n", expr->ops->name);