summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-12-14 18:33:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-12-14 18:33:43 +0000
commit5532e64697944ad4c710705ab1b564052a8f51af (patch)
tree183870f005f01f56ae179f355463d683575b35a0 /sys/netinet/ip_input.c
parent4cb17e9667a272f7541dbee84ac942404facb823 (diff)
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/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 8bbe357c553..d8d3c01a4b4 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.155 2007/12/13 20:00:53 reyk Exp $ */
+/* $OpenBSD: ip_input.c,v 1.156 2007/12/14 18:33:41 deraadt Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -63,6 +63,10 @@
#include <net/pfvar.h>
#endif
+#ifdef MROUTING
+#include <netinet/ip_mroute.h>
+#endif
+
#ifdef IPSEC
#include <netinet/ip_ipsp.h>
#endif /* IPSEC */
@@ -1571,6 +1575,10 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
size_t newlen;
{
int error;
+#ifdef MROUTING
+ extern int ip_mrtproto;
+ extern struct mrtstat mrtstat;
+#endif
/* Almost all sysctl names at this level are terminal. */
if (namelen != 1 && name[0] != IPCTL_IFQUEUE)
@@ -1627,6 +1635,21 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
return (EPERM);
return (sysctl_struct(oldp, oldlenp, newp, newlen,
&ipstat, sizeof(ipstat)));
+ case IPCTL_MRTSTATS:
+#ifdef MROUTING
+ if (newp != NULL)
+ return (EPERM);
+ return (sysctl_struct(oldp, oldlenp, newp, newlen,
+ &mrtstat, sizeof(mrtstat)));
+#else
+ return (EOPNOTSUPP);
+#endif
+ case IPCTL_MRTPROTO:
+#ifdef MROUTING
+ return (sysctl_rdint(oldp, oldlenp, newp, ip_mrtproto));
+#else
+ return (EOPNOTSUPP);
+#endif
default:
if (name[0] < IPCTL_MAXID)
return (sysctl_int_arr(ipctl_vars, name, namelen,