Re: [iptables-compat PATCH] save: fix the printing of the counters

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

 



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