diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2001-06-27 10:31:52 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2001-06-27 10:31:52 +0000 |
commit | 1af4743896368d72b37729fb509c340856465816 (patch) | |
tree | 135ce5b80dfc7230b98001235cbc2e4c11bded46 /sys/net | |
parent | 448bece5da7e46a44180845c85ee979221134c31 (diff) |
add -z flag for zeroing statistics. -s status no longer resets anything
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf.c | 14 | ||||
-rw-r--r-- | sys/net/pfvar.h | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 811f4467aa0..8b62c34a703 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.76 2001/06/27 10:27:43 kjell Exp $ */ +/* $OpenBSD: pf.c,v 1.77 2001/06/27 10:31:51 kjell Exp $ */ /* * Copyright (c) 2001, Daniel Hartmeier @@ -962,18 +962,16 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) case DIOCGETSTATUS: { struct pf_status *s = (struct pf_status *)addr; + bcopy(&pf_status, s, sizeof(struct pf_status)); + break; + } + + case DIOCCLRSTATUS: { u_int8_t running = pf_status.running; u_int32_t states = pf_status.states; - - bcopy(&pf_status, s, sizeof(struct pf_status)); - if (s->since) - s->since = pftv.tv_sec - s->since; - else - s->since = 0; bzero(&pf_status, sizeof(struct pf_status)); pf_status.running = running; pf_status.states = states; - pf_status.since = pftv.tv_sec; break; } diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 72087015201..3f86ed947b3 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.22 2001/06/27 04:29:21 deraadt Exp $ */ +/* $OpenBSD: pfvar.h,v 1.23 2001/06/27 10:31:51 kjell Exp $ */ /* * Copyright (c) 2001, Daniel Hartmeier @@ -217,6 +217,7 @@ struct pfioc_if { #define DIOCGETSTATE _IOWR('D', 19, struct pfioc_state) #define DIOCSETSTATUSIF _IOWR('D', 20, struct pfioc_if) #define DIOCGETSTATUS _IOWR('D', 21, struct pf_status) +#define DIOCCLRSTATUS _IO ('D', 22) #ifdef _KERNEL |