diff options
author | Ana Rey <anarey@gmail.com> | 2014-06-03 12:41:56 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-06-05 15:22:56 +0200 |
commit | d79329a5e99f4f2fdf293f9e3418cad0af7e7b1d (patch) | |
tree | 71d8fdac7d56140c893465bcb8d31a01c4893ced /examples/nft-ruleset-get.c | |
parent | 131b5b7801d6801dbf57b6ae3e85b3c2a10cacac (diff) |
expr: log: Do not print unset values in xml
It changes the parse and the snprint functions to omit unset values.
If we used this rule:
nft add rule ip test output log
We got this xml file:
<rule><family>ip</family>
<table>test</table>
<chain>output</chain>
<handle>88</handle>
<expr type="log">
<prefix>(null)</prefix>
<group>0</group>
<snaplen>0</snaplen>
<qthreshold>0</qthreshold>
</expr>
</rule>
And It was imposible import this file.
Now, That rule creates this xml file without null values:
<rule><family>ip</family>
<table>test</table>
<chain>output</chain>
<handle>88</handle>
<expr type="log">
</expr>
</rule>
and It's possible import this xml file.
Signed-off-by: Ana Rey <anarey@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'examples/nft-ruleset-get.c')
0 files changed, 0 insertions, 0 deletions