From 151760f5d2beb2a0ddf8b4408183cad01e2f001a Mon Sep 17 00:00:00 2001 From: rpaulo Date: Sun, 28 Aug 2005 21:01:02 +0000 Subject: [PATCH] Implement net.inet6.udp6.stats. Reviewed by Elad Efrat. --- sys/netinet6/udp6_usrreq.c | 11 +++++++++-- sys/netinet6/udp6_var.h | 8 +++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 7445e3400b22..2463bf872121 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: udp6_usrreq.c,v 1.69 2005/08/10 13:06:49 yamt Exp $ */ +/* $NetBSD: udp6_usrreq.c,v 1.70 2005/08/28 21:01:02 rpaulo Exp $ */ /* $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.69 2005/08/10 13:06:49 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.70 2005/08/28 21:01:02 rpaulo Exp $"); #include #include @@ -460,4 +460,11 @@ SYSCTL_SETUP(sysctl_net_inet6_udp6_setup, "sysctl net.inet6.udp6 subtree setup") sysctl_inpcblist, 0, &udbtable, 0, CTL_NET, PF_INET6, IPPROTO_UDP, CTL_CREATE, CTL_EOL); + sysctl_createv(clog, 0, NULL, NULL, + CTLFLAG_PERMANENT, + CTLTYPE_STRUCT, "stats", + SYSCTL_DESCR("UDPv6 statistics"), + NULL, 0, &udp6stat, sizeof(udp6stat), + CTL_NET, PF_INET6, IPPROTO_UDP, UDP6CTL_STATS, + CTL_EOL); } diff --git a/sys/netinet6/udp6_var.h b/sys/netinet6/udp6_var.h index 1cfe6e90dbf8..7ce1cfb43299 100644 --- a/sys/netinet6/udp6_var.h +++ b/sys/netinet6/udp6_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: udp6_var.h,v 1.16 2004/12/15 04:25:21 thorpej Exp $ */ +/* $NetBSD: udp6_var.h,v 1.17 2005/08/28 21:01:02 rpaulo Exp $ */ /* $KAME: udp6_var.h,v 1.11 2000/06/05 00:14:31 itojun Exp $ */ /* @@ -83,18 +83,20 @@ struct udp6stat { }; /* - * Names for UDP sysctl objects + * Names for UDP6 sysctl objects */ #define UDP6CTL_SENDSPACE 1 /* default send buffer */ #define UDP6CTL_RECVSPACE 2 /* default recv buffer */ #define UDP6CTL_LOOPBACKCKSUM 3 /* do UDP checksum on loopback? */ -#define UDP6CTL_MAXID 4 +#define UDP6CTL_STATS 4 /* udp6 statistics */ +#define UDP6CTL_MAXID 5 #define UDP6CTL_NAMES { \ { 0, 0 }, \ { "sendspace", CTLTYPE_INT }, \ { "recvspace", CTLTYPE_INT }, \ { "do_loopback_cksum", CTLTYPE_INT }, \ + { "stats", CTLTYPE_STRUCT }, \ } #ifdef _KERNEL