path: root/src/chain.c
diff options
authorArturo Borrero Gonzalez <>2013-02-13 12:15:13 +0000
committerPablo Neira Ayuso <>2013-02-14 09:33:33 +0100
commitd696047efe8d7356f441a52b43a531e6ca8ad3c7 (patch)
tree51363605ba54b46eb4da54571d2ce24fc08a6b9d /src/chain.c
parentc6aeca496fc747066ad09ac76c1fc281a948cd68 (diff)
src: change XML output format to use element instead of attributes
There are some problems in using attributes: * they cannot contain multiple values (child elements can) * they are not easily expandable (for future changes) * they cannot describe structures (child elements can) * they are more difficult to manipulate by program code * attribute values are not easy to test against a DTD Extracted from "XML Elements vs. Attributes" at: For more information. Signed-off-by: Arturo Borrero Gonzalez <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/chain.c')
1 files changed, 8 insertions, 8 deletions
diff --git a/src/chain.c b/src/chain.c
index 3c83e6d..1b1c3fe 100644
--- a/src/chain.c
+++ b/src/chain.c
@@ -443,14 +443,14 @@ static int nft_chain_snprintf_xml(char *buf, size_t size, struct nft_chain *c)
"<chain name=\"%s\" handle=\"%lu\""
" bytes=\"%lu\" packets=\"%lu\" >\n"
- "\t\t<flags value=\"%d\" />\n"
- "\t\t<type value=\"%s\" />\n"
- "\t\t<table value=\"%s\" />\n"
- "\t\t<prio value=\"%d\" />\n"
- "\t\t<use value=\"%d\" />\n"
- "\t\t<hooknum value=\"%d\" />\n"
- "\t\t<policy value=\"%d\" />\n"
- "\t\t<family value=\"%d\" />\n"
+ "\t\t<flags>%d</flags>\n"
+ "\t\t<type>%s</type>\n"
+ "\t\t<table>%s</table>\n"
+ "\t\t<prio>%d</prio>\n"
+ "\t\t<use>%d</use>\n"
+ "\t\t<hooknum>%d</hooknum>\n"
+ "\t\t<policy>%d</policy>\n"
+ "\t\t<family>%d</family>\n"
c->name, c->handle, c->bytes, c->packets,