From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Giuseppe Longo <giuseppelng@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [iptables-compat PATCH] save: fix the printing of the counters
Date: Tue, 10 Jun 2014 13:48:53 +0200 [thread overview]
Message-ID: <20140610114853.GA11663@localhost> (raw)
In-Reply-To: <1401781652-3538-1-git-send-email-giuseppelng@gmail.com>
On Tue, Jun 03, 2014 at 09:47:32AM +0200, Giuseppe Longo wrote:
> This patch prints the counters of a rule before the details,
> like iptables-save syntax.
The output after your patch:
shell# iptables-compat-save -c
# Generated by xtables-save v1.4.21 on Tue Jun 10 13:37:11 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:test - [0:0]
[ 0 : 0 ] -A INPUT -s 1.1.1.1/32
COMMIT
# Completed on Tue Jun 10 13:37:11 2014
And the original iptables-save output:
shell# iptables-save -c
# Generated by iptables-save v1.4.21 on Tue Jun 10 13:33:06 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:test - [0:0]
[0:0] -A INPUT -s 1.1.1.1/32
COMMIT
I think you have to use:
+void save_counters(uint64_t pcnt, uint64_t bcnt, unsigned int format)
+{
+ printf("[%llu:%llu] ", pcnt, bcnt);
+}
to make it look similar to what we have. The format parameter, I think
you don't need it if this is only used for saving.
Can you fix you and resend? Thanks.
prev parent reply other threads:[~2014-06-10 11:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-03 7:47 [iptables-compat PATCH] save: fix the printing of the counters Giuseppe Longo
2014-06-10 11:48 ` Pablo Neira Ayuso [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140610114853.GA11663@localhost \
--to=pablo@netfilter.org \
--cc=giuseppelng@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).