diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-12-13 20:00:54 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-12-13 20:00:54 +0000 |
commit | 90654a32a12cd0e30f6adb846ff6e9e5e6682a28 (patch) | |
tree | e8f59de8c6fe04c760d9e46528cb22f1da0c1cfc /sys/netinet/tcp_usrreq.c | |
parent | b03a990aaf0a66e97ca7dd68b5f8b065d05e4b95 (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/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 9 |
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, |