diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2005-05-24 04:20:27 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2005-05-24 04:20:27 +0000 |
commit | 3b1f70a1b16fe7fbb4dd2023fca5a05586074d52 (patch) | |
tree | 72f3f02f4df5d3c61cca11a91dd883a2a896d7a4 /sys/net/if.c | |
parent | 361cb4c97740f40c5cd3808004369134731beb44 (diff) |
add net.inet.ip.ifq for monitoring and changing ifqueue; similar to netbsd
ok henning
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 986d622be58..2cee6ff14ca 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.116 2005/05/24 02:49:34 henning Exp $ */ +/* $OpenBSD: if.c,v 1.117 2005/05/24 04:20:25 markus Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -77,6 +77,7 @@ #include <sys/kernel.h> #include <sys/ioctl.h> #include <sys/domain.h> +#include <sys/sysctl.h> #include <net/if.h> #include <net/if_dl.h> @@ -1743,3 +1744,25 @@ ifpromisc(struct ifnet *ifp, int pswitch) ifr.ifr_flags = ifp->if_flags; return ((*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr)); } + +int +sysctl_ifq(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen, struct ifqueue *ifq) +{ + /* All sysctl names at this level are terminal. */ + if (namelen != 1) + return (ENOTDIR); + + switch (name[0]) { + case IFQCTL_LEN: + return (sysctl_rdint(oldp, oldlenp, newp, ifq->ifq_len)); + case IFQCTL_MAXLEN: + return (sysctl_int(oldp, oldlenp, newp, newlen, + &ifq->ifq_maxlen)); + case IFQCTL_DROPS: + return (sysctl_rdint(oldp, oldlenp, newp, ifq->ifq_drops)); + default: + return (EOPNOTSUPP); + } + /* NOTREACHED */ +} |