summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2007-12-13 20:00:53 +0000
committerreyk <reyk@openbsd.org>2007-12-13 20:00:53 +0000
commit5000ee89c8e051880c2651e17fd3b27aeb0c4917 (patch)
treee22d43093e0cb4920671131fd4e71aa5515b8201 /sys/netinet/tcp_usrreq.c
parentSync with the mvme188 codebase, various tweaks from the last 18 months which (diff)
downloadwireguard-openbsd-5000ee89c8e051880c2651e17fd3b27aeb0c4917.tar.xz
wireguard-openbsd-5000ee89c8e051880c2651e17fd3b27aeb0c4917.zip
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/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 13dd15cbc67..2e1750e00af 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.94 2007/11/27 17:23:23 deraadt Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.95 2007/12/13 20:00:53 reyk Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -954,6 +954,13 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
}
return (0);
#endif
+
+ case TCPCTL_STATS:
+ if (newp != NULL)
+ return (EPERM);
+ return (sysctl_struct(oldp, oldlenp, newp, newlen,
+ &tcpstat, sizeof(tcpstat)));
+
default:
if (name[0] < TCPCTL_MAXID)
return (sysctl_int_arr(tcpctl_vars, name, namelen,