[libnftables PATCH] src: rule: fix compat XML output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux