From owner-p4-projects@FreeBSD.ORG Fri Jul 31 20:56:32 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EC6D41065674; Fri, 31 Jul 2009 20:56:31 +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 AFD6A1065670 for ; Fri, 31 Jul 2009 20:56:31 +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 9ECB48FC08 for ; Fri, 31 Jul 2009 20:56:31 +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 n6VKuVcq083417 for ; Fri, 31 Jul 2009 20:56:31 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6VKuVsN083415 for perforce@freebsd.org; Fri, 31 Jul 2009 20:56:31 GMT (envelope-from pgj@FreeBSD.org) Date: Fri, 31 Jul 2009 20:56:31 GMT Message-Id: <200907312056.n6VKuVsN083415@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 166872 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 20:56:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=166872 Change 166872 by pgj@petymeg-current on 2009/07/31 20:56:03 Add support for multicast forwarding statistics (IPv4). Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#55 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#52 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#22 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#60 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#55 (text+ko) ==== @@ -173,6 +173,7 @@ stat_IPcomp, stat_IPsec, #endif + stat_mroute, stat_MAX, stat_Invalid, }; @@ -228,6 +229,7 @@ struct ah_stat; struct ipcomp_stat; #endif +struct mroute_stat; __BEGIN_DECLS const char *netstat_strerror(int); @@ -1124,4 +1126,20 @@ u_int32_t netstat_ipsecs_get_ips_input_middle(const struct ipsec_stat *); u_int32_t netstat_ipsecs_get_ips_input_end(const struct ipsec_stat *); #endif /* !IPSEC */ + +const struct mroute_stat *netstat_get_mroutestats(const struct stat_type *); + +u_int64_t netstat_mroutes_get_mfc_lookups(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_mfc_misses(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_upcalls(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_no_route(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_bad_tunnel(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_cant_tunnel(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_wrong_if(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_upq_ovflw(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_cache_cleanups(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_drop_sel(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_q_overflow(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_pkt2large(const struct mroute_stat *); +u_int64_t netstat_mroutes_get_upq_sockfull(const struct mroute_stat *); #endif /* !_NETSTAT_H_ */ ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#52 (text+ko) ==== @@ -73,6 +73,7 @@ #include #include #endif +#include #include "netstat.h" @@ -402,6 +403,10 @@ }; #endif +struct mroute_stat { + struct mrtstat s; +}; + /* Timestamp type. */ struct timestamp_type { u_int32_t ts_sec; ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#22 (text+ko) ==== @@ -94,6 +94,7 @@ { IPCOMPSTAT_VERSION, "net.inet.ipcomp.stats", "_ipcompstat" }, { IPSECSTAT_VERSION, "net.inet.ipsec.ipsecstats", "_ipsec4stat" }, #endif + { MRTSTAT_VERSION, "net.inet.ip.mrtstat", "_mrtstat" } }; int ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#60 (text+ko) ==== @@ -2106,6 +2106,26 @@ #undef IPSEC_ACCA #endif /* !IPSEC */ +#define MRT_ACC(field) \ + STATS_ACCX(u_int64_t,mroute,field,mrts_##field) + +STATS_GET(mroute,mroute); +MRT_ACC(mfc_lookups); +MRT_ACC(mfc_misses); +MRT_ACC(upcalls); +MRT_ACC(no_route); +MRT_ACC(bad_tunnel); +MRT_ACC(cant_tunnel); +MRT_ACC(wrong_if); +MRT_ACC(upq_ovflw); +MRT_ACC(cache_cleanups); +MRT_ACC(drop_sel); +MRT_ACC(q_overflow); +MRT_ACC(pkt2large); +MRT_ACC(upq_sockfull); +#undef MRT_ACC + + static const char *icmpnames[ICMP_MAXTYPE + 1] = { "echo reply", /* RFC 792 */ "#1",