From owner-p4-projects@FreeBSD.ORG Thu Jul 30 16:57:52 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 46D541065677; Thu, 30 Jul 2009 16:57:52 +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 B5AF51065674 for ; Thu, 30 Jul 2009 16:57:51 +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 A42898FC1D for ; Thu, 30 Jul 2009 16:57:51 +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 n6UGvpPC093101 for ; Thu, 30 Jul 2009 16:57:51 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6UGvpb4093099 for perforce@freebsd.org; Thu, 30 Jul 2009 16:57:51 GMT (envelope-from pgj@FreeBSD.org) Date: Thu, 30 Jul 2009 16:57:51 GMT Message-Id: <200907301657.n6UGvpb4093099@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 166802 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: Thu, 30 Jul 2009 16:57:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=166802 Change 166802 by pgj@petymeg-current on 2009/07/30 16:57:10 Standardize and add header for PIM6 and IPv6 Multicast Routing statistics. Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/sys/netinet6/ip6_mroute.c#3 edit .. //depot/projects/soc2009/pgj_libstat/src/sys/netinet6/ip6_mroute.h#2 edit .. //depot/projects/soc2009/pgj_libstat/src/sys/netinet6/pim6_var.h#2 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/sys/netinet6/ip6_mroute.c#3 (text+ko) ==== @@ -166,10 +166,17 @@ SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); +static struct stat_header mrt6stat_header = { + .sth_version = MRT6STAT_VERSION, + .sth_len = sizeof(struct mrt6stat) +}; static struct mrt6stat mrt6stat; SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, mrt6stat, CTLFLAG_RW, &mrt6stat, mrt6stat, "Multicast Routing Statistics (struct mrt6stat, netinet6/ip6_mroute.h)"); +SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, mrt6stat_header, CTLFLAG_RD, + &mrt6stat_header, stat_header, + "Multicast Routing Statistics header"); #define NO_RTE_FOUND 0x1 #define RTE_FOUND 0x2 @@ -258,10 +265,16 @@ static mifi_t nummifs = 0; static mifi_t reg_mif_num = (mifi_t)-1; +static struct stat_header pim6stat_header = { + .sth_version = PIM6STAT_VERSION, + .sth_len = sizeof(struct pim6stat) +}; static struct pim6stat pim6stat; -SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RD, +SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RW, &pim6stat, pim6stat, "PIM Statistics (struct pim6stat, netinet6/pim_var.h)"); +SYSCTL_STRUCT(_net_inet6_pim, OID_AUTO, stats_header, CTLFLAG_RD, + &pim6stat_header, stat_header, "PIM Statistics header"); #ifdef VIMAGE_GLOBALS static int pim6; ==== //depot/projects/soc2009/pgj_libstat/src/sys/netinet6/ip6_mroute.h#2 (text+ko) ==== @@ -120,20 +120,22 @@ /* * The kernel's multicast routing statistics. */ +#define MRT6STAT_VERSION 0x00000001 + struct mrt6stat { - u_quad_t mrt6s_mfc_lookups; /* # forw. cache hash table hits */ - u_quad_t mrt6s_mfc_misses; /* # forw. cache hash table misses */ - u_quad_t mrt6s_upcalls; /* # calls to multicast routing daemon */ - u_quad_t mrt6s_no_route; /* no route for packet's origin */ - u_quad_t mrt6s_bad_tunnel; /* malformed tunnel options */ - u_quad_t mrt6s_cant_tunnel; /* no room for tunnel options */ - u_quad_t mrt6s_wrong_if; /* arrived on wrong interface */ - u_quad_t mrt6s_upq_ovflw; /* upcall Q overflow */ - u_quad_t mrt6s_cache_cleanups; /* # entries with no upcalls */ - u_quad_t mrt6s_drop_sel; /* pkts dropped selectively */ - u_quad_t mrt6s_q_overflow; /* pkts dropped - Q overflow */ - u_quad_t mrt6s_pkt2large; /* pkts dropped - size > BKT SIZE */ - u_quad_t mrt6s_upq_sockfull; /* upcalls dropped - socket full */ + u_int64_t mrt6s_mfc_lookups; /* # forw. cache hash table hits */ + u_int64_t mrt6s_mfc_misses; /* # forw. cache hash table misses */ + u_int64_t mrt6s_upcalls; /* # calls to multicast routing daemon */ + u_int64_t mrt6s_no_route; /* no route for packet's origin */ + u_int64_t mrt6s_bad_tunnel; /* malformed tunnel options */ + u_int64_t mrt6s_cant_tunnel; /* no room for tunnel options */ + u_int64_t mrt6s_wrong_if; /* arrived on wrong interface */ + u_int64_t mrt6s_upq_ovflw; /* upcall Q overflow */ + u_int64_t mrt6s_cache_cleanups; /* # entries with no upcalls */ + u_int64_t mrt6s_drop_sel; /* pkts dropped selectively */ + u_int64_t mrt6s_q_overflow; /* pkts dropped - Q overflow */ + u_int64_t mrt6s_pkt2large; /* pkts dropped - size > BKT SIZE */ + u_int64_t mrt6s_upq_sockfull; /* upcalls dropped - socket full */ }; #ifdef MRT6_OINIT ==== //depot/projects/soc2009/pgj_libstat/src/sys/netinet6/pim6_var.h#2 (text+ko) ==== @@ -41,14 +41,16 @@ #ifndef _NETINET6_PIM6_VAR_H_ #define _NETINET6_PIM6_VAR_H_ +#define PIM6STAT_VERSION 0x00000001 + struct pim6stat { - u_quad_t pim6s_rcv_total; /* total PIM messages received */ - u_quad_t pim6s_rcv_tooshort; /* received with too few bytes */ - u_quad_t pim6s_rcv_badsum; /* received with bad checksum */ - u_quad_t pim6s_rcv_badversion; /* received bad PIM version */ - u_quad_t pim6s_rcv_registers; /* received registers */ - u_quad_t pim6s_rcv_badregisters; /* received invalid registers */ - u_quad_t pim6s_snd_registers; /* sent registers */ + u_int64_t pim6s_rcv_total; /* total PIM messages received */ + u_int64_t pim6s_rcv_tooshort; /* received with too few bytes */ + u_int64_t pim6s_rcv_badsum; /* received with bad checksum */ + u_int64_t pim6s_rcv_badversion; /* received bad PIM version */ + u_int64_t pim6s_rcv_registers; /* received registers */ + u_int64_t pim6s_rcv_badregisters; /* received invalid registers */ + u_int64_t pim6s_snd_registers; /* sent registers */ }; #if (defined(KERNEL)) || (defined(_KERNEL))