diff options
author | Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> | 2013-04-07 22:35:02 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-04-19 01:35:41 +0200 |
commit | 64d53531cb80e1007b32f95e3758e3cc2e4bdae1 (patch) | |
tree | f3bca97d47f5c0fb7824076cf923f25cfb30a652 | |
parent | aa56f410581fe3539b3c907c2a2fdec360481d5c (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>
-rw-r--r-- | src/rule.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |