PERFORCE change 166622 for review
Gabor Pali
pgj at FreeBSD.org
Mon Jul 27 14:46:50 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166622
Change 166622 by pgj at 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 <netinet/udp.h>
#include <netinet/udp_var.h>
+#include <netinet/tcp_var.h>
#include <netinet/vinet.h>
#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
More information about the p4-projects
mailing list