PERFORCE change 166706 for review

Gabor Pali pgj at FreeBSD.org
Tue Jul 28 23:57:13 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166706

Change 166706 by pgj at petymeg-current on 2009/07/28 23:57:02

	- Standardize DDP statistics.
	- Export statistics via sysctl(3) [net.ddp.stats]
	- Add header.

Affected files ...

.. //depot/projects/soc2009/pgj_libstat/src/sys/netatalk/ddp_input.c#2 edit
.. //depot/projects/soc2009/pgj_libstat/src/sys/netatalk/ddp_var.h#2 edit

Differences ...

==== //depot/projects/soc2009/pgj_libstat/src/sys/netatalk/ddp_input.c#2 (text+ko) ====

@@ -60,8 +60,10 @@
 #include <sys/socketvar.h>
 #include <sys/sx.h>
 #include <sys/systm.h>
+#include <sys/sysctl.h>
 #include <net/if.h>
 #include <net/route.h>
+#include <netinet/tcp_var.h>
 
 #include <netatalk/at.h>
 #include <netatalk/at_var.h>
@@ -74,8 +76,19 @@
 
 static volatile int	ddp_forward = 1;
 static volatile int	ddp_firewall = 0;
+
+static struct stat_header   ddpstat_header = {
+	.sth_version = DDPSTAT_VERSION,
+	.sth_len = sizeof(struct ddpstat)
+};
 static struct ddpstat	ddpstat;
 
+SYSCTL_NODE(_net, OID_AUTO, ddp, CTLFLAG_RW, 0, "DDP");
+SYSCTL_STRUCT(_net_ddp, OID_AUTO, stats, CTLFLAG_RW, &ddpstat, ddpstat,
+    "DDP Statistics (struct ddpstat, netatalk/ddp_var.h)");
+SYSCTL_STRUCT(_net_ddp, OID_AUTO, stats_header, CTLFLAG_RD, &ddpstat_header,
+    stat_header, "DDP Statistics header");
+
 static struct route	forwro;
 
 static void     ddp_input(struct mbuf *, struct ifnet *, struct elaphdr *, int);

==== //depot/projects/soc2009/pgj_libstat/src/sys/netatalk/ddp_var.h#2 (text+ko) ====

@@ -40,17 +40,19 @@
 
 #define	sotoddpcb(so)	((struct ddpcb *)(so)->so_pcb)
 
+#define	DDPSTAT_VERSION	    0x00000001
+
 struct ddpstat {
-	long	ddps_short;		/* short header packets received */
-	long	ddps_long;		/* long header packets received */
-	long	ddps_nosum;		/* no checksum */
-	long	ddps_badsum;		/* bad checksum */
-	long	ddps_tooshort;		/* packet too short */
-	long	ddps_toosmall;		/* not enough data */
-	long	ddps_forward;		/* packets forwarded */
-	long	ddps_encap;		/* packets encapsulated */
-	long	ddps_cantforward;	/* packets rcvd for unreachable dest */
-	long	ddps_nosockspace;	/* no space in sockbuf for packet */
+	u_int64_t	ddps_short;		/* short header packets received */
+	u_int64_t	ddps_long;		/* long header packets received */
+	u_int64_t	ddps_nosum;		/* no checksum */
+	u_int64_t	ddps_badsum;		/* bad checksum */
+	u_int64_t	ddps_tooshort;		/* packet too short */
+	u_int64_t	ddps_toosmall;		/* not enough data */
+	u_int64_t	ddps_forward;		/* packets forwarded */
+	u_int64_t	ddps_encap;		/* packets encapsulated */
+	u_int64_t	ddps_cantforward;	/* packets rcvd for unreachable dest */
+	u_int64_t	ddps_nosockspace;	/* no space in sockbuf for packet */
 };
 
 #ifdef _KERNEL


More information about the p4-projects mailing list