summaryrefslogtreecommitdiff
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-12-13 20:00:54 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-12-13 20:00:54 +0000
commit90654a32a12cd0e30f6adb846ff6e9e5e6682a28 (patch)
treee8f59de8c6fe04c760d9e46528cb22f1da0c1cfc /sys/netinet/udp_usrreq.c
parentb03a990aaf0a66e97ca7dd68b5f8b065d05e4b95 (diff)
implement sysctls to report IP, TCP, UDP, and ICMP statistics and
change netstat to use them instead of accessing kvm for it. more protocols will be added later. discussed with deraadt@ claudio@ gilles@ ok deraadt@
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 05ec0e1fe6f..7f4370c04b1 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.114 2007/06/11 11:29:35 henning Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.115 2007/12/13 20:00:53 reyk Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -1236,6 +1236,13 @@ udp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
case UDPCTL_BADDYNAMIC:
return (sysctl_struct(oldp, oldlenp, newp, newlen,
baddynamicports.udp, sizeof(baddynamicports.udp)));
+
+ case UDPCTL_STATS:
+ if (newp != NULL)
+ return (EPERM);
+ return (sysctl_struct(oldp, oldlenp, newp, newlen,
+ &udpstat, sizeof(udpstat)));
+
default:
if (name[0] < UDPCTL_MAXID)
return (sysctl_int_arr(udpctl_vars, name, namelen,