From owner-p4-projects@FreeBSD.ORG Tue Jul 28 23:58:13 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 71055106566C; Tue, 28 Jul 2009 23:58:13 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31106106564A for ; Tue, 28 Jul 2009 23:58:13 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1F40D8FC0A for ; Tue, 28 Jul 2009 23:58:13 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SNwD2a056932 for ; Tue, 28 Jul 2009 23:58:13 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6SNwCVH056930 for perforce@freebsd.org; Tue, 28 Jul 2009 23:58:12 GMT (envelope-from pgj@FreeBSD.org) Date: Tue, 28 Jul 2009 23:58:12 GMT Message-Id: <200907282358.n6SNwCVH056930@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pgj@FreeBSD.org using -f From: Gabor Pali To: Perforce Change Reviews Cc: Subject: PERFORCE change 166707 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 23:58:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=166707 Change 166707 by pgj@petymeg-current on 2009/07/28 23:57:36 Add support for DDP statistics. Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#40 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#38 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#8 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#44 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#40 (text+ko) ==== @@ -122,6 +122,7 @@ stat_ICMP, stat_PIM, stat_IGMP, + stat_DDP, stat_MAX, stat_Invalid, }; @@ -154,6 +155,7 @@ struct icmp_stat; struct pim_stat; struct igmp_stat; +struct ddp_stat; __BEGIN_DECLS const char *netstat_strerror(int); @@ -558,4 +560,17 @@ u_int64_t netstat_igmps_get_rcv_ourreports(const struct igmp_stat *); u_int64_t netstat_igmps_get_rcv_nora(const struct igmp_stat *); u_int64_t netstat_igmps_get_snd_reports(const struct igmp_stat *); + +const struct ddp_stat *netstat_get_ddpstats(const struct stat_type *); + +u_int64_t netstat_ddps_get_short(const struct ddp_stat *); +u_int64_t netstat_ddps_get_long(const struct ddp_stat *); +u_int64_t netstat_ddps_get_nosum(const struct ddp_stat *); +u_int64_t netstat_ddps_get_badsum(const struct ddp_stat *); +u_int64_t netstat_ddps_get_tooshort(const struct ddp_stat *); +u_int64_t netstat_ddps_get_toosmall(const struct ddp_stat *); +u_int64_t netstat_ddps_get_forward(const struct ddp_stat *); +u_int64_t netstat_ddps_get_encap(const struct ddp_stat *); +u_int64_t netstat_ddps_get_cantforward(const struct ddp_stat *); +u_int64_t netstat_ddps_get_nosockspace(const struct ddp_stat *); #endif /* !_NETSTAT_H_ */ ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#38 (text+ko) ==== @@ -49,6 +49,8 @@ #include #include #include +#include +#include #include "netstat.h" @@ -314,6 +316,10 @@ struct igmpstat s; }; +struct ddp_stat { + struct ddpstat s; +}; + int kread_data(kvm_t *kvm, u_long kvm_pointer, void *address, size_t size); int kread_string(kvm_t *kvm, u_long kvm_pointer, char *buffer, int buflen); ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#8 (text+ko) ==== @@ -64,6 +64,7 @@ { ICMPSTAT_VERSION, "net.inet.icmp.stats", "_icmpstat" }, { PIMSTAT_VERSION, "net.inet.pim.stats", "_pimstat" }, { IGMPSTAT_VERSION, "net.inet.igmp.stats", "_igmpstat" }, + { DDPSTAT_VERSION, "net.ddp.stats", "_ddpstat" }, }; int ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#44 (text+ko) ==== @@ -2458,6 +2458,75 @@ return (isp->s.igps_snd_reports); } +const struct ddp_stat * +netstat_get_ddpstats(const struct stat_type *sttp) +{ + if (sttp->stt_type == stat_DDP) { + return ((const struct ddp_stat *)sttp->stt_data); + } + return (NULL); +} + +u_int64_t +netstat_ddps_get_short(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_short); +} + +u_int64_t +netstat_ddps_get_long(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_long); +} + +u_int64_t +netstat_ddps_get_nosum(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_nosum); +} + +u_int64_t +netstat_ddps_get_badsum(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_badsum); +} + +u_int64_t +netstat_ddps_get_tooshort(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_tooshort); +} + +u_int64_t +netstat_ddps_get_toosmall(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_toosmall); +} + +u_int64_t +netstat_ddps_get_forward(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_forward); +} + +u_int64_t +netstat_ddps_get_encap(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_encap); +} + +u_int64_t +netstat_ddps_get_cantforward(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_cantforward); +} + +u_int64_t +netstat_ddps_get_nosockspace(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_nosockspace); +} + static const char *icmpnames[ICMP_MAXTYPE + 1] = { "echo reply", /* RFC 792 */