diff options
-rw-r--r-- | sys/net/if_etherip.c | 16 | ||||
-rw-r--r-- | sys/netinet/ip_ether.c | 41 | ||||
-rw-r--r-- | sys/netinet/ip_ether.h | 4 |
3 files changed, 17 insertions, 44 deletions
diff --git a/sys/net/if_etherip.c b/sys/net/if_etherip.c index b392bb69b92..b87f635d6ec 100644 --- a/sys/net/if_etherip.c +++ b/sys/net/if_etherip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_etherip.c,v 1.22 2017/11/10 02:37:14 visa Exp $ */ +/* $OpenBSD: if_etherip.c,v 1.23 2017/11/15 17:30:20 jca Exp $ */ /* * Copyright (c) 2015 Kazuya GODA <goda@openbsd.org> * @@ -661,6 +661,20 @@ ip6_etherip_input(struct mbuf **mp, int *offp, int proto, int af) #endif /* INET6 */ int +etherip_sysctl_etheripstat(void *oldp, size_t *oldlenp, void *newp) +{ + struct etheripstat etheripstat; + + CTASSERT(sizeof(etheripstat) == (etherips_ncounters * + sizeof(uint64_t))); + memset(ðeripstat, 0, sizeof etheripstat); + counters_read(etheripcounters, (uint64_t *)ðeripstat, + etherips_ncounters); + return (sysctl_rdstruct(oldp, oldlenp, newp, ðeripstat, + sizeof(etheripstat))); +} + +int ip_etherip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) { diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c index 7bc9267949f..6a6b3f40289 100644 --- a/sys/netinet/ip_ether.c +++ b/sys/netinet/ip_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ether.c,v 1.89 2017/11/10 02:37:14 visa Exp $ */ +/* $OpenBSD: ip_ether.c,v 1.90 2017/11/15 17:30:20 jca Exp $ */ /* * The author of this code is Angelos D. Keromytis (kermit@adk.gr) * @@ -468,42 +468,3 @@ etherip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int proto) return 0; } - -int -etherip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) -{ - int error; - - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return (ENOTDIR); - - switch (name[0]) { - case ETHERIPCTL_ALLOW: - NET_LOCK(); - error = sysctl_int(oldp, oldlenp, newp, newlen, - ðerip_allow); - NET_UNLOCK(); - return (error); - case ETHERIPCTL_STATS: - return (etherip_sysctl_etheripstat(oldp, oldlenp, newp)); - default: - return (ENOPROTOOPT); - } - /* NOTREACHED */ -} - -int -etherip_sysctl_etheripstat(void *oldp, size_t *oldlenp, void *newp) -{ - struct etheripstat etheripstat; - - CTASSERT(sizeof(etheripstat) == (etherips_ncounters * - sizeof(uint64_t))); - memset(ðeripstat, 0, sizeof etheripstat); - counters_read(etheripcounters, (uint64_t *)ðeripstat, - etherips_ncounters); - return (sysctl_rdstruct(oldp, oldlenp, newp, ðeripstat, - sizeof(etheripstat))); -} diff --git a/sys/netinet/ip_ether.h b/sys/netinet/ip_ether.h index d48ca952a46..97b0778b780 100644 --- a/sys/netinet/ip_ether.h +++ b/sys/netinet/ip_ether.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ether.h,v 1.23 2017/11/10 02:37:14 visa Exp $ */ +/* $OpenBSD: ip_ether.h,v 1.24 2017/11/15 17:30:20 jca Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@adk.gr) * @@ -112,8 +112,6 @@ struct tdb; void etherip_init(void); int etherip_output(struct mbuf *, struct tdb *, struct mbuf **, int); int etherip_input(struct mbuf **, int *, int, int); -int etherip_sysctl(int *, u_int, void *, size_t *, void *, size_t); -int etherip_sysctl_etheripstat(void *, size_t *, void *); extern int etherip_allow; |