o serveral changes / additions to libiptc:
- iptc_set_policy has additional argument 'counters' to be consistent
with iptc_get_policy
- added functions for counter manipulation
(iptc_read_counter, iptc_zero_counter, iptc_set_counter)
o iptables-save and iptables-restore manpage clearifications
o iptables-restore counter restoring for chain counters
diff --git a/iptables-save.c b/iptables-save.c
index 413e1ad..a97d448 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -145,7 +145,7 @@
/* print counters */
if (counters)
- printf("[%llu,%llu] ", e->counters.pcnt, e->counters.bcnt);
+ printf("[%llu:%llu] ", e->counters.pcnt, e->counters.bcnt);
/* Print IP part. */
print_ip("-s", e->ip.src.s_addr,e->ip.smsk.s_addr,
@@ -251,9 +251,9 @@
struct ipt_counters count;
printf("%s ",
iptc_get_policy(chain, &count, &h));
- printf("%llu:%llu\n", count.pcnt, count.bcnt);
+ printf("[%llu:%llu]\n", count.pcnt, count.bcnt);
} else {
- printf("- 0 0\n");
+ printf("- [0:0]\n");
}
/* Dump out rules */