summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl.c
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2001-10-04 21:54:16 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2001-10-04 21:54:16 +0000
commit5a6edb4f30cd97ffe43cb7e9bc99d276fd6de4c5 (patch)
tree0e8c4930c557c00dd5c5e8891217d317a68996e6 /sbin/pfctl/pfctl.c
parent7489bf70c18e470300800237cf667fefa462dc5a (diff)
Honour -v flag when printing states, print only one line per state when
non-verbose. Suggested by gwyllion@ace.ulyssis.org.
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r--sbin/pfctl/pfctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 17000299990..c231a2e6232 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.46 2001/10/02 18:18:28 frantzen Exp $ */
+/* $OpenBSD: pfctl.c,v 1.47 2001/10/04 21:54:15 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -57,7 +57,7 @@ int pfctl_clear_states(int, int);
int pfctl_hint(int, const char *, int);
int pfctl_show_rules(int, int);
int pfctl_show_nat(int);
-int pfctl_show_states(int, u_int8_t);
+int pfctl_show_states(int, u_int8_t, int);
int pfctl_show_status(int);
int pfctl_rules(int, char *, int);
int pfctl_nat(int, char *, int);
@@ -321,7 +321,7 @@ pfctl_show_nat(int dev)
}
int
-pfctl_show_states(int dev, u_int8_t proto)
+pfctl_show_states(int dev, u_int8_t proto, int opts)
{
struct pfioc_states ps;
struct pf_state *p;
@@ -352,7 +352,7 @@ pfctl_show_states(int dev, u_int8_t proto)
p = ps.ps_states;
for (i = 0; i < ps.ps_len; i += sizeof(*p)) {
if (!proto || (p->proto == proto))
- print_state(p);
+ print_state(p, opts);
p++;
}
return (0);
@@ -790,7 +790,7 @@ main(int argc, char *argv[])
pfctl_show_nat(dev);
break;
case 's':
- pfctl_show_states(dev, 0);
+ pfctl_show_states(dev, 0, opts);
break;
case 'i':
pfctl_show_status(dev);
@@ -798,7 +798,7 @@ main(int argc, char *argv[])
case 'a':
pfctl_show_rules(dev, opts);
pfctl_show_nat(dev);
- pfctl_show_states(dev, 0);
+ pfctl_show_states(dev, 0, opts);
pfctl_show_status(dev);
break;
default: