summaryrefslogtreecommitdiff
path: root/sys/net/if_pflow.c
diff options
context:
space:
mode:
authorJoerg Goltermann <gollo@cvs.openbsd.org>2008-09-16 15:48:14 +0000
committerJoerg Goltermann <gollo@cvs.openbsd.org>2008-09-16 15:48:14 +0000
commit1f2d6a5fa47ce5770dfea60d2353c1571104bb74 (patch)
tree1c83a7b4dc133b0026c420abf1a851b9bf3eac42 /sys/net/if_pflow.c
parent51fd863ee46944659e499e71c2c3f710bf1277a0 (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.c21
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);
+}