summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2010-07-03 02:05:18 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2010-07-03 02:05:18 +0000
commit8f18205ae2492bc13d6a722ad0bb47a3dce8945e (patch)
treeb6e30beb57f8061eb817e6fefe78bef87b40d5c0 /sbin/pfctl
parent3ea772ed0333be8e15dc24e0ca201e4932a5757d (diff)
Use our own enum here rather than abusing the PF rule type enums, which
will be getting cleaned up soon. ok henning
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/pfctl_parser.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 5f7e0339d14..9adeed15ba1 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.266 2010/06/29 19:28:13 chl Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.267 2010/07/03 02:05:17 mcbride Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -207,6 +207,8 @@ const struct pf_timeout pf_timeouts[] = {
{ NULL, 0 }
};
+enum { PF_POOL_ROUTE, PF_POOL_NAT, PF_POOL_RDR };
+
const struct icmptypeent *
geticmptypebynumber(u_int8_t type, sa_family_t af)
{
@@ -451,7 +453,7 @@ print_pool(struct pf_pool *pool, u_int16_t p1, u_int16_t p2,
} else
print_addr(&pool->addr, af, verbose);
switch (id) {
- case PF_NAT:
+ case PF_POOL_NAT:
if ((p1 != PF_NAT_PROXY_PORT_LOW ||
p2 != PF_NAT_PROXY_PORT_HIGH) && (p1 != 0 || p2 != 0)) {
if (p1 == p2)
@@ -460,7 +462,7 @@ print_pool(struct pf_pool *pool, u_int16_t p1, u_int16_t p2,
printf(" port %u:%u", p1, p2);
}
break;
- case PF_RDR:
+ case PF_POOL_RDR:
if (p1) {
printf(" port %u", p1);
if (p2 && (p2 != p1))
@@ -490,7 +492,7 @@ print_pool(struct pf_pool *pool, u_int16_t p1, u_int16_t p2,
}
if (pool->opts & PF_POOL_STICKYADDR)
printf(" sticky-address");
- if (id == PF_NAT && p1 == 0 && p2 == 0)
+ if (id == PF_POOL_NAT && p1 == 0 && p2 == 0)
printf(" static-port");
}
@@ -1034,12 +1036,12 @@ print_rule(struct pf_rule *r, const char *anchor_call, int verbose)
if (!anchor_call[0] && r->nat.addr.type != PF_ADDR_NONE) {
printf (" nat-to ");
print_pool(&r->nat, r->nat.proxy_port[0],
- r->nat.proxy_port[1], r->af, PF_NAT, verbose);
+ r->nat.proxy_port[1], r->af, PF_POOL_NAT, verbose);
}
if (!anchor_call[0] && r->rdr.addr.type != PF_ADDR_NONE) {
printf (" rdr-to ");
print_pool(&r->rdr, r->rdr.proxy_port[0],
- r->rdr.proxy_port[1], r->af, PF_RDR, verbose);
+ r->rdr.proxy_port[1], r->af, PF_POOL_RDR, verbose);
}
if (r->rt) {
if (r->rt == PF_ROUTETO)
@@ -1052,7 +1054,7 @@ print_rule(struct pf_rule *r, const char *anchor_call, int verbose)
printf(" fastroute");
if (r->rt != PF_FASTROUTE) {
printf(" ");
- print_pool(&r->route, 0, 0, r->af, PF_PASS, verbose);
+ print_pool(&r->route, 0, 0, r->af, PF_POOL_ROUTE, verbose);
}
}
}