netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [libnftables PATCH] src: rule: fix compat XML output
@ 2013-04-08  8:35 Arturo Borrero
  2013-04-09 19:49 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Arturo Borrero @ 2013-04-08  8:35 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

The compat struct was not printed in XML. So, I think give output format is the first step to parse it.
---
 src/rule.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/rule.c b/src/rule.c
index 57b849d..e419b0a 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -445,11 +445,18 @@ static int nft_rule_snprintf_xml(char *buf, size_t size, struct nft_rule *r,
 
 	ret = snprintf(buf, size,
 		"<rule family=\"%u\" table=\"%s\" "
-			"chain=\"%s\" handle=\"%llu\"> ",
+			"chain=\"%s\" handle=\"%llu\">\n ",
 				r->family, r->table, r->chain,
 				(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);


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-18 23:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-08  8:35 [libnftables PATCH] src: rule: fix compat XML output Arturo Borrero
2013-04-09 19:49 ` Pablo Neira Ayuso
2013-04-09 20:34   ` Arturo Borrero Gonzalez
2013-04-18 23:29     ` Pablo Neira Ayuso

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).