summaryrefslogtreecommitdiffstats
path: root/contrib/pf/pfctl/pfctl.c
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-03-15 13:41:17 +0000
committermlaier <mlaier@FreeBSD.org>2004-03-15 13:41:17 +0000
commit4c91a73d426123e1662d8a1b186f9605ca384b73 (patch)
tree0cd850f4bfbc1ebe7c447546892114cb24f965a6 /contrib/pf/pfctl/pfctl.c
parent950b98f1f71ea41489c4abcf9e4071bc2a3d33da (diff)
downloadFreeBSD-src-4c91a73d426123e1662d8a1b186f9605ca384b73.zip
FreeBSD-src-4c91a73d426123e1662d8a1b186f9605ca384b73.tar.gz
Fix some style(9) related issues after discussion with/education from bde:
- Add <sys/param.h> and <limits.h> where required (do not depend on other headers pulling it in). - __dead -> __dead2 - #if defined() -> #ifdef - Remove ugly PRIu64 macros and use %llu w/ (unsigned long long) cast. All changes looped back to OpenBSD (where applicable) for easier sync in the future. Requested by: bde Approved by: bms(mentor)
Diffstat (limited to 'contrib/pf/pfctl/pfctl.c')
-rw-r--r--contrib/pf/pfctl/pfctl.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/contrib/pf/pfctl/pfctl.c b/contrib/pf/pfctl/pfctl.c
index 9a8fed8..cd07433 100644
--- a/contrib/pf/pfctl/pfctl.c
+++ b/contrib/pf/pfctl/pfctl.c
@@ -37,12 +37,6 @@
#include <net/if.h>
#include <netinet/in.h>
-#if defined(__FreeBSD__)
-#include <inttypes.h>
-#include <net/route.h>
-#else
-#define PRIu64 "llu"
-#endif
#include <net/pfvar.h>
#include <arpa/inet.h>
#include <altq/altq.h>
@@ -201,7 +195,7 @@ pfctl_enable(int dev, int opts)
if (ioctl(dev, DIOCSTART)) {
if (errno == EEXIST)
errx(1, "pf already enabled");
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
else if (errno == ESRCH)
errx(1, "pfil registeration failed");
#endif
@@ -554,10 +548,11 @@ pfctl_print_rule_counters(struct pf_rule *rule, int opts)
rule->qname, rule->qid, rule->pqname, rule->pqid);
}
if (opts & PF_OPT_VERBOSE)
- printf(" [ Evaluations: %-8"PRIu64" Packets: %-8"PRIu64" "
- "Bytes: %-10"PRIu64" States: %-6u]\n",
- rule->evaluations, rule->packets,
- rule->bytes, rule->states);
+ printf(" [ Evaluations: %-8llu Packets: %-8llu "
+ "Bytes: %-10llu States: %-6u]\n",
+ (unsigned long long)rule->evaluations,
+ (unsigned long long)rule->packets,
+ (unsigned long long)rule->bytes, rule->states);
}
int
@@ -619,9 +614,10 @@ pfctl_show_rules(int dev, int opts, int format, char *anchorname,
case 1:
if (pr.rule.label[0]) {
printf("%s ", pr.rule.label);
- printf("%"PRIu64" %"PRIu64" %"PRIu64"\n",
- pr.rule.evaluations, pr.rule.packets,
- pr.rule.bytes);
+ printf("%llu %llu %llu\n",
+ (unsigned long long)pr.rule.evaluations,
+ (unsigned long long)pr.rule.packets,
+ (unsigned long long)pr.rule.bytes);
}
break;
default:
@@ -651,9 +647,10 @@ pfctl_show_rules(int dev, int opts, int format, char *anchorname,
case 1:
if (pr.rule.label[0]) {
printf("%s ", pr.rule.label);
- printf("%"PRIu64" %"PRIu64" %"PRIu64"\n",
- pr.rule.evaluations, pr.rule.packets,
- pr.rule.bytes);
+ printf("%llu %llu %llu\n",
+ (unsigned long long)pr.rule.evaluations,
+ (unsigned long long)pr.rule.packets,
+ (unsigned long long)pr.rule.bytes);
}
break;
default:
OpenPOWER on IntegriCloud