From owner-p4-projects@FreeBSD.ORG Fri Jul 31 22:09:53 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 485E61065670; Fri, 31 Jul 2009 22:09:53 +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 E54EF106564A for ; Fri, 31 Jul 2009 22:09:52 +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 B9BC78FC08 for ; Fri, 31 Jul 2009 22:09:52 +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 n6VM9qeI090699 for ; Fri, 31 Jul 2009 22:09:52 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6VM9qYe090697 for perforce@freebsd.org; Fri, 31 Jul 2009 22:09:52 GMT (envelope-from pgj@FreeBSD.org) Date: Fri, 31 Jul 2009 22:09:52 GMT Message-Id: <200907312209.n6VM9qYe090697@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 166880 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: Fri, 31 Jul 2009 22:09:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=166880 Change 166880 by pgj@petymeg-current on 2009/07/31 22:09:46 Add support for IPv4 forwarding statistics. Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#57 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#54 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#24 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#62 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#57 (text+ko) ==== @@ -173,6 +173,7 @@ stat_IPcomp, stat_IPsec, #endif + stat_route, stat_mroute, #ifdef INET6 stat_mroute6, @@ -232,6 +233,7 @@ struct ah_stat; struct ipcomp_stat; #endif +struct route_stat; struct mroute_stat; #ifdef INET6 struct mroute6_stat; @@ -1133,6 +1135,15 @@ u_int32_t netstat_ipsecs_get_ips_input_end(const struct ipsec_stat *); #endif /* !IPSEC */ +const struct route_stat *netstat_get_routestats(const struct stat_type *); + +u_int64_t netstat_routes_get_badredirect(const struct route_stat *); +u_int64_t netstat_routes_get_dynamic(const struct route_stat *); +u_int64_t netstat_routes_get_newgateway(const struct route_stat *); +u_int64_t netstat_routes_get_unreach(const struct route_stat *); +u_int64_t netstat_routes_get_wildcard(const struct route_stat *); +u_int64_t netstat_routes_get_trash(const struct route_stat *); + const struct mroute_stat *netstat_get_mroutestats(const struct stat_type *); u_int64_t netstat_mroutes_get_mfc_lookups(const struct mroute_stat *); ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#54 (text+ko) ==== @@ -73,6 +73,7 @@ #include #include #endif +#include #include #ifdef INET6 #include @@ -406,6 +407,10 @@ }; #endif +struct route_stat { + struct rtstat s; +}; + struct mroute_stat { struct mrtstat s; }; ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#24 (text+ko) ==== @@ -94,6 +94,7 @@ { IPCOMPSTAT_VERSION, "net.inet.ipcomp.stats", "_ipcompstat" }, { IPSECSTAT_VERSION, "net.inet.ipsec.ipsecstats", "_ipsec4stat" }, #endif + { RTSTAT_VERSION, "net.inet.ip.rtstat", "_rtstat" }, { MRTSTAT_VERSION, "net.inet.ip.mrtstat", "_mrtstat" }, #ifdef INET6 { MRT6STAT_VERSION, "net.inet6.ip6.mrt6stat", "_mrt6stat" }, ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#62 (text+ko) ==== @@ -2106,6 +2106,18 @@ #undef IPSEC_ACCA #endif /* !IPSEC */ +#define RT_ACC(field) \ + STATS_ACCX(u_int64_t,route,field,rts_##field) + +STATS_GET(route,route); +RT_ACC(badredirect); +RT_ACC(dynamic); +RT_ACC(newgateway); +RT_ACC(unreach); +RT_ACC(wildcard); +RT_ACC(trash); +#undef RT_ACC + #define MRT_ACC(field) \ STATS_ACCX(u_int64_t,mroute,field,mrts_##field)