summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2004-03-15 15:25:45 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2004-03-15 15:25:45 +0000
commitbe793154b2acb7110f168e6f5095655f6d3b1764 (patch)
tree860fc7e2aa5c41537ee5930fa425d3083fb549a6
parentdbe39a3e717e68080196c27427697fefa73ba70f (diff)
cast %llu arguments to unsigned long long, from Max Laier,
ok henning@ cedric@
-rw-r--r--sbin/pfctl/pfctl.c17
-rw-r--r--sbin/pfctl/pfctl_parser.c24
-rw-r--r--sbin/pfctl/pfctl_qstats.c26
-rw-r--r--sbin/pfctl/pfctl_table.c20
4 files changed, 48 insertions, 39 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 430a59a6b45..c882bcbed48 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.211 2004/03/03 02:00:23 deraadt Exp $ */
+/* $OpenBSD: pfctl.c,v 1.212 2004/03/15 15:25:44 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -563,8 +563,9 @@ pfctl_print_rule_counters(struct pf_rule *rule, int opts)
if (opts & PF_OPT_VERBOSE)
printf(" [ Evaluations: %-8llu Packets: %-8llu "
"Bytes: %-10llu States: %-6u]\n",
- rule->evaluations, rule->packets,
- rule->bytes, rule->states);
+ (unsigned long long)rule->evaluations,
+ (unsigned long long)rule->packets,
+ (unsigned long long)rule->bytes, rule->states);
}
void
@@ -652,8 +653,9 @@ pfctl_show_rules(int dev, int opts, int format, char *anchorname,
if (pr.rule.label[0]) {
printf("%s ", pr.rule.label);
printf("%llu %llu %llu\n",
- pr.rule.evaluations, pr.rule.packets,
- pr.rule.bytes);
+ (unsigned long long)pr.rule.evaluations,
+ (unsigned long long)pr.rule.packets,
+ (unsigned long long)pr.rule.bytes);
}
break;
default:
@@ -686,8 +688,9 @@ pfctl_show_rules(int dev, int opts, int format, char *anchorname,
if (pr.rule.label[0]) {
printf("%s ", pr.rule.label);
printf("%llu %llu %llu\n",
- pr.rule.evaluations, pr.rule.packets,
- pr.rule.bytes);
+ (unsigned long long)pr.rule.evaluations,
+ (unsigned long long)pr.rule.packets,
+ (unsigned long long)pr.rule.bytes);
}
break;
default:
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 4739d572632..406c3931b6f 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.193 2004/03/10 17:48:48 henning Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.194 2004/03/15 15:25:44 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -515,23 +515,25 @@ print_status(struct pf_status *s, int opts)
printf("Interface Stats for %-16s %5s %16s\n",
s->ifname, "IPv4", "IPv6");
printf(" %-25s %14llu %16llu\n", "Bytes In",
- s->bcounters[0][0], s->bcounters[1][0]);
+ (unsigned long long)s->bcounters[0][0],
+ (unsigned long long)s->bcounters[1][0]);
printf(" %-25s %14llu %16llu\n", "Bytes Out",
- s->bcounters[0][1], s->bcounters[1][1]);
+ (unsigned long long)s->bcounters[0][1],
+ (unsigned long long)s->bcounters[1][1]);
printf(" Packets In\n");
printf(" %-23s %14llu %16llu\n", "Passed",
- s->pcounters[0][0][PF_PASS],
- s->pcounters[1][0][PF_PASS]);
+ (unsigned long long)s->pcounters[0][0][PF_PASS],
+ (unsigned long long)s->pcounters[1][0][PF_PASS]);
printf(" %-23s %14llu %16llu\n", "Blocked",
- s->pcounters[0][0][PF_DROP],
- s->pcounters[1][0][PF_DROP]);
+ (unsigned long long)s->pcounters[0][0][PF_DROP],
+ (unsigned long long)s->pcounters[1][0][PF_DROP]);
printf(" Packets Out\n");
printf(" %-23s %14llu %16llu\n", "Passed",
- s->pcounters[0][1][PF_PASS],
- s->pcounters[1][1][PF_PASS]);
+ (unsigned long long)s->pcounters[0][1][PF_PASS],
+ (unsigned long long)s->pcounters[1][1][PF_PASS]);
printf(" %-23s %14llu %16llu\n\n", "Blocked",
- s->pcounters[0][1][PF_DROP],
- s->pcounters[1][1][PF_DROP]);
+ (unsigned long long)s->pcounters[0][1][PF_DROP],
+ (unsigned long long)s->pcounters[1][1][PF_DROP]);
}
printf("%-27s %14s %16s\n", "State Table", "Total", "Rate");
printf(" %-25s %14u %14s\n", "current entries", s->states, "");
diff --git a/sbin/pfctl/pfctl_qstats.c b/sbin/pfctl/pfctl_qstats.c
index b5f0903950d..19ca600911b 100644
--- a/sbin/pfctl/pfctl_qstats.c
+++ b/sbin/pfctl/pfctl_qstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_qstats.c,v 1.28 2004/02/19 21:37:01 cedric Exp $ */
+/* $OpenBSD: pfctl_qstats.c,v 1.29 2004/03/15 15:25:44 dhartmei Exp $ */
/*
* Copyright (c) Henning Brauer <henning@openbsd.org>
@@ -290,10 +290,10 @@ print_cbqstats(struct queue_stats cur)
{
printf(" [ pkts: %10llu bytes: %10llu "
"dropped pkts: %6llu bytes: %6llu ]\n",
- cur.data.cbq_stats.xmit_cnt.packets,
- cur.data.cbq_stats.xmit_cnt.bytes,
- cur.data.cbq_stats.drop_cnt.packets,
- cur.data.cbq_stats.drop_cnt.bytes);
+ (unsigned long long)cur.data.cbq_stats.xmit_cnt.packets,
+ (unsigned long long)cur.data.cbq_stats.xmit_cnt.bytes,
+ (unsigned long long)cur.data.cbq_stats.drop_cnt.packets,
+ (unsigned long long)cur.data.cbq_stats.drop_cnt.bytes);
printf(" [ qlength: %3d/%3d borrows: %6u suspends: %6u ]\n",
cur.data.cbq_stats.qcnt, cur.data.cbq_stats.qmax,
cur.data.cbq_stats.borrows, cur.data.cbq_stats.delays);
@@ -311,10 +311,10 @@ print_priqstats(struct queue_stats cur)
{
printf(" [ pkts: %10llu bytes: %10llu "
"dropped pkts: %6llu bytes: %6llu ]\n",
- cur.data.priq_stats.xmitcnt.packets,
- cur.data.priq_stats.xmitcnt.bytes,
- cur.data.priq_stats.dropcnt.packets,
- cur.data.priq_stats.dropcnt.bytes);
+ (unsigned long long)cur.data.priq_stats.xmitcnt.packets,
+ (unsigned long long)cur.data.priq_stats.xmitcnt.bytes,
+ (unsigned long long)cur.data.priq_stats.dropcnt.packets,
+ (unsigned long long)cur.data.priq_stats.dropcnt.bytes);
printf(" [ qlength: %3d/%3d ]\n",
cur.data.priq_stats.qlength, cur.data.priq_stats.qlimit);
@@ -331,10 +331,10 @@ print_hfscstats(struct queue_stats cur)
{
printf(" [ pkts: %10llu bytes: %10llu "
"dropped pkts: %6llu bytes: %6llu ]\n",
- cur.data.hfsc_stats.xmit_cnt.packets,
- cur.data.hfsc_stats.xmit_cnt.bytes,
- cur.data.hfsc_stats.drop_cnt.packets,
- cur.data.hfsc_stats.drop_cnt.bytes);
+ (unsigned long long)cur.data.hfsc_stats.xmit_cnt.packets,
+ (unsigned long long)cur.data.hfsc_stats.xmit_cnt.bytes,
+ (unsigned long long)cur.data.hfsc_stats.drop_cnt.packets,
+ (unsigned long long)cur.data.hfsc_stats.drop_cnt.bytes);
printf(" [ qlength: %3d/%3d ]\n",
cur.data.hfsc_stats.qlength, cur.data.hfsc_stats.qlimit);
diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c
index 4d4f1e786ad..5d4c3d9f511 100644
--- a/sbin/pfctl/pfctl_table.c
+++ b/sbin/pfctl/pfctl_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_table.c,v 1.58 2004/02/26 11:57:19 cedric Exp $ */
+/* $OpenBSD: pfctl_table.c,v 1.59 2004/03/15 15:25:44 dhartmei Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
@@ -359,12 +359,14 @@ print_tstats(struct pfr_tstats *ts, int debug)
ts->pfrts_refcnt[PFR_REFCNT_ANCHOR],
ts->pfrts_refcnt[PFR_REFCNT_RULE]);
printf("\tEvaluations: [ NoMatch: %-18llu Match: %-18llu ]\n",
- ts->pfrts_nomatch, ts->pfrts_match);
+ (unsigned long long)ts->pfrts_nomatch,
+ (unsigned long long)ts->pfrts_match);
for (dir = 0; dir < PFR_DIR_MAX; dir++)
for (op = 0; op < PFR_OP_TABLE_MAX; op++)
printf("\t%-12s [ Packets: %-18llu Bytes: %-18llu ]\n",
- stats_text[dir][op], ts->pfrts_packets[dir][op],
- ts->pfrts_bytes[dir][op]);
+ stats_text[dir][op],
+ (unsigned long long)ts->pfrts_packets[dir][op],
+ (unsigned long long)ts->pfrts_bytes[dir][op]);
}
int
@@ -440,8 +442,9 @@ print_astats(struct pfr_astats *as, int dns)
for (dir = 0; dir < PFR_DIR_MAX; dir++)
for (op = 0; op < PFR_OP_ADDR_MAX; op++)
printf("\t%-12s [ Packets: %-18llu Bytes: %-18llu ]\n",
- stats_text[dir][op], as->pfras_packets[dir][op],
- as->pfras_bytes[dir][op]);
+ stats_text[dir][op],
+ (unsigned long long)as->pfras_packets[dir][op],
+ (unsigned long long)as->pfras_bytes[dir][op]);
}
void
@@ -589,8 +592,9 @@ print_iface(struct pfi_if *p, int opts)
dir = (i>>1) &1;
act = i & 1;
printf("\t%-12s [ Packets: %-18llu Bytes: %-18llu ]\n",
- istats_text[af][dir][act], p->pfif_packets[af][dir][act],
- p->pfif_bytes[af][dir][act]);
+ istats_text[af][dir][act],
+ (unsigned long long)p->pfif_packets[af][dir][act],
+ (unsigned long long)p->pfif_bytes[af][dir][act]);
}
}