From owner-p4-projects@FreeBSD.ORG Mon Jul 27 14:46:49 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1A8E3106566C; Mon, 27 Jul 2009 14:46:49 +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 CDED2106564A for ; Mon, 27 Jul 2009 14:46:48 +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 B10178FC31 for ; Mon, 27 Jul 2009 14:46:48 +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 n6REkm0d089801 for ; Mon, 27 Jul 2009 14:46:48 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6REkmPB089799 for perforce@freebsd.org; Mon, 27 Jul 2009 14:46:48 GMT (envelope-from pgj@FreeBSD.org) Date: Mon, 27 Jul 2009 14:46:48 GMT Message-Id: <200907271446.n6REkmPB089799@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 166622 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: Mon, 27 Jul 2009 14:46:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=166622 Change 166622 by pgj@petymeg-current on 2009/07/27 14:46:41 Standardize struct udpstat, add header. Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/sys/netinet/udp_usrreq.c#4 edit .. //depot/projects/soc2009/pgj_libstat/src/sys/netinet/udp_var.h#3 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/sys/netinet/udp_usrreq.c#4 (text+ko) ==== @@ -82,6 +82,7 @@ #endif #include #include +#include #include #ifdef IPSEC @@ -139,6 +140,10 @@ struct inpcbhead udb; /* from udp_var.h */ struct inpcbinfo udbinfo; static uma_zone_t udpcb_zone; +struct stat_header udpstat_header = { + .sth_version = UDPSTAT_VERSION, + .sth_len = sizeof(struct udpstat) +}; struct udpstat udpstat; /* from udp_var.h */ #endif @@ -150,6 +155,10 @@ CTLFLAG_RW, udpstat, udpstat, "UDP statistics (struct udpstat, netinet/udp_var.h)"); +SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_udp, OID_AUTO, stats_header, + CTLFLAG_RD, udpstat_header, stat_header, + "UDP statistics header"); + static void udp_detach(struct socket *so); static int udp_output(struct inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *); ==== //depot/projects/soc2009/pgj_libstat/src/sys/netinet/udp_var.h#3 (text+ko) ==== @@ -64,24 +64,28 @@ #define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) #define sotoudpcb(so) (intoudpcb(sotoinpcb(so))) +#define UDPSTAT_VERSION 0x00000001 + struct udpstat { /* input statistics: */ - u_long udps_ipackets; /* total input packets */ - u_long udps_hdrops; /* packet shorter than header */ - u_long udps_badsum; /* checksum error */ - u_long udps_nosum; /* no checksum */ - u_long udps_badlen; /* data length larger than packet */ - u_long udps_noport; /* no socket on port */ - u_long udps_noportbcast; /* of above, arrived as broadcast */ - u_long udps_fullsock; /* not delivered, input socket full */ - u_long udpps_pcbcachemiss; /* input packets missing pcb cache */ - u_long udpps_pcbhashmiss; /* input packets not for hashed pcb */ + u_int64_t udps_ipackets; /* total input packets */ + u_int64_t udps_hdrops; /* packet shorter than header */ + u_int64_t udps_badsum; /* checksum error */ + u_int64_t udps_nosum; /* no checksum */ + u_int64_t udps_badlen; /* data length larger than packet */ + u_int64_t udps_noport; /* no socket on port */ + u_int64_t udps_noportbcast; /* of above, arrived as broadcast */ + u_int64_t udps_fullsock; /* not delivered, input socket full */ + u_int64_t udpps_pcbcachemiss; /* input packets missing pcb cache */ + u_int64_t udpps_pcbhashmiss; /* input packets not for hashed pcb */ + u_int64_t udps_delivered; + /* output statistics: */ - u_long udps_opackets; /* total output packets */ - u_long udps_fastout; /* output packets on fast path */ + u_int64_t udps_opackets; /* total output packets */ + u_int64_t udps_fastout; /* output packets on fast path */ /* of no socket on port, arrived as multicast */ - u_long udps_noportmcast; - u_long udps_filtermcast; /* blocked by multicast filter */ + u_int64_t udps_noportmcast; + u_int64_t udps_filtermcast; /* blocked by multicast filter */ }; #ifdef _KERNEL