diff options
author | 2007-12-14 18:33:37 +0000 | |
---|---|---|
committer | 2007-12-14 18:33:37 +0000 | |
commit | ab46c28df9dade40ac2a7e07eff58829ad435982 (patch) | |
tree | a00a64a333d8efced177951cd0e350ca85389a07 /sys/netinet6/raw_ip6.c | |
parent | Remove a lot of symbols from the namespace, otherwise sys/sysctl.h and (diff) | |
download | wireguard-openbsd-ab46c28df9dade40ac2a7e07eff58829ad435982.tar.xz wireguard-openbsd-ab46c28df9dade40ac2a7e07eff58829ad435982.zip |
add sysctl entry points into various network layers, in particular to
provide netstat(1) with data it needs; ok claudio reyk
Diffstat (limited to 'sys/netinet6/raw_ip6.c')
-rw-r--r-- | sys/netinet6/raw_ip6.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index bccb8e65ccb..5bbb3baaf14 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.34 2007/10/29 16:19:24 chl Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.35 2007/12/14 18:33:41 deraadt Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -69,6 +69,7 @@ #include <sys/socketvar.h> #include <sys/errno.h> #include <sys/systm.h> +#include <sys/sysctl.h> #include <net/if.h> #include <net/route.h> @@ -841,3 +842,23 @@ rip6_usrreq(so, req, m, nam, control, p) m_freem(m); return (error); } + +int +rip6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen) +{ + /* All sysctl names at this level are terminal. */ + if (namelen != 1) + return ENOTDIR; + + switch (name[0]) { + case RIPV6CTL_STATS: + if (newp != NULL) + return (EPERM); + return (sysctl_struct(oldp, oldlenp, newp, newlen, + &rip6stat, sizeof(rip6stat))); + default: + return (EOPNOTSUPP); + } + /* NOTREACHED */ +} |