diff options
author | Joerg Goltermann <gollo@cvs.openbsd.org> | 2008-09-16 15:48:14 +0000 |
---|---|---|
committer | Joerg Goltermann <gollo@cvs.openbsd.org> | 2008-09-16 15:48:14 +0000 |
commit | 1f2d6a5fa47ce5770dfea60d2353c1571104bb74 (patch) | |
tree | 1c83a7b4dc133b0026c420abf1a851b9bf3eac42 /sys/net/if_pflow.c | |
parent | 51fd863ee46944659e499e71c2c3f710bf1277a0 (diff) |
netstat statistics for pflow(4) via pseudo family
ok cluadio@ henning@
Diffstat (limited to 'sys/net/if_pflow.c')
-rw-r--r-- | sys/net/if_pflow.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/net/if_pflow.c b/sys/net/if_pflow.c index 2f2950f3a9d..4fb8b0672e3 100644 --- a/sys/net/if_pflow.c +++ b/sys/net/if_pflow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflow.c,v 1.2 2008/09/16 13:58:55 gollo Exp $ */ +/* $OpenBSD: if_pflow.c,v 1.3 2008/09/16 15:48:12 gollo Exp $ */ /* * Copyright (c) 2008 Henning Brauer <henning@openbsd.org> @@ -620,3 +620,22 @@ pflow_get_dynport(void) return (htons(ipport_hilastauto)); /* XXX */ } + +int +pflow_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen) +{ + if (namelen != 1) + return (ENOTDIR); + + switch (name[0]) { + case NET_PFLOW_STATS: + if (newp != NULL) + return (EPERM); + return (sysctl_struct(oldp, oldlenp, newp, newlen, + &pflowstats, sizeof(pflowstats))); + default: + return (EOPNOTSUPP); + } + return (0); +} |