diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2013-06-08 14:24:40 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2013-06-08 14:24:40 +0000 |
commit | 145d20d3089f385b19118cccc36b5bd809d49094 (patch) | |
tree | 5417c0c18137fff62a645044bbf333fa29b37d6b /sys | |
parent | b5eb995ea27dc816484505244c7aef178f6ac040 (diff) |
Add new sysctl for pipex packet input/output queue length and
counters.
ok guenther, feedback jmc
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/pipex.c | 14 | ||||
-rw-r--r-- | sys/net/pipex.h | 14 |
2 files changed, 15 insertions, 13 deletions
diff --git a/sys/net/pipex.c b/sys/net/pipex.c index a40ed53101e..5da7f15bbf4 100644 --- a/sys/net/pipex.c +++ b/sys/net/pipex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex.c,v 1.41 2013/04/16 07:36:55 yasuoka Exp $ */ +/* $OpenBSD: pipex.c,v 1.42 2013/06/08 14:24:38 yasuoka Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -3061,14 +3061,18 @@ int pipex_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 PIPEXCTL_ENABLE: + if (namelen != 1) + return (ENOTDIR); return (sysctl_int(oldp, oldlenp, newp, newlen, &pipex_enable)); + case PIPEXCTL_INQ: + return (sysctl_ifq(name + 1, namelen - 1, + oldp, oldlenp, newp, newlen, &pipexinq)); + case PIPEXCTL_OUTQ: + return (sysctl_ifq(name + 1, namelen - 1, + oldp, oldlenp, newp, newlen, &pipexoutq)); default: return (ENOPROTOOPT); } diff --git a/sys/net/pipex.h b/sys/net/pipex.h index 197a34bfe7a..f2b9839c528 100644 --- a/sys/net/pipex.h +++ b/sys/net/pipex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex.h,v 1.16 2012/12/05 23:20:23 deraadt Exp $ */ +/* $OpenBSD: pipex.h,v 1.17 2013/06/08 14:24:38 yasuoka Exp $ */ /* * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -33,17 +33,15 @@ * Names for pipex sysctl objects */ #define PIPEXCTL_ENABLE 1 -#define PIPEXCTL_MAXID 2 +#define PIPEXCTL_INQ 2 +#define PIPEXCTL_OUTQ 3 +#define PIPEXCTL_MAXID 4 #define PIPEXCTL_NAMES { \ { 0, 0 }, \ { "enable", CTLTYPE_INT }, \ -} - -#define PIPEXCTL_VARS { \ - NULL, \ - &pipex_enable \ - NULL \ + { "inq", CTLTYPE_NODE }, \ + { "outq", CTLTYPE_NODE }, \ } #define PIPEX_PROTO_L2TP 1 /* protocol L2TP */ |