PERFORCE change 166652 for review

Gabor Pali pgj at FreeBSD.org
Mon Jul 27 20:45:26 UTC 2009


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

Change 166652 by pgj at petymeg-current on 2009/07/27 20:44:57

	Standardize struct icmpstat, add header.

Affected files ...

.. //depot/projects/soc2009/pgj_libstat/src/sys/netinet/icmp_var.h#2 edit
.. //depot/projects/soc2009/pgj_libstat/src/sys/netinet/ip_icmp.c#2 edit

Differences ...

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

@@ -38,23 +38,26 @@
  * Variables related to this implementation
  * of the internet control message protocol.
  */
+
+#define	ICMPSTAT_VERSION    0x00000001
+
 struct	icmpstat {
 /* statistics related to icmp packets generated */
-	u_long	icps_error;		/* # of calls to icmp_error */
-	u_long	icps_oldshort;		/* no error 'cuz old ip too short */
-	u_long	icps_oldicmp;		/* no error 'cuz old was icmp */
-	u_long	icps_outhist[ICMP_MAXTYPE + 1];
+	u_int64_t	icps_error;		/* # of calls to icmp_error */
+	u_int64_t	icps_oldshort;		/* no error 'cuz old ip too short */
+	u_int64_t	icps_oldicmp;		/* no error 'cuz old was icmp */
+	u_int64_t	icps_outhist[ICMP_MAXTYPE + 1];
 /* statistics related to input messages processed */
-	u_long	icps_badcode;		/* icmp_code out of range */
-	u_long	icps_tooshort;		/* packet < ICMP_MINLEN */
-	u_long	icps_checksum;		/* bad checksum */
-	u_long	icps_badlen;		/* calculated bound mismatch */
-	u_long	icps_reflect;		/* number of responses */
-	u_long	icps_inhist[ICMP_MAXTYPE + 1];
-	u_long	icps_bmcastecho;	/* b/mcast echo requests dropped */
-	u_long	icps_bmcasttstamp;	/* b/mcast tstamp requests dropped */
-	u_long	icps_badaddr;		/* bad return address */
-	u_long	icps_noroute;		/* no route back */
+	u_int64_t	icps_badcode;		/* icmp_code out of range */
+	u_int64_t	icps_tooshort;		/* packet < ICMP_MINLEN */
+	u_int64_t	icps_checksum;		/* bad checksum */
+	u_int64_t	icps_badlen;		/* calculated bound mismatch */
+	u_int64_t	icps_reflect;		/* number of responses */
+	u_int64_t	icps_inhist[ICMP_MAXTYPE + 1];
+	u_int64_t	icps_bmcastecho;	/* b/mcast echo requests dropped */
+	u_int64_t	icps_bmcasttstamp;	/* b/mcast tstamp requests dropped */
+	u_int64_t	icps_badaddr;		/* bad return address */
+	u_int64_t	icps_noroute;		/* no route back */
 };
 
 #ifdef _KERNEL

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

@@ -79,6 +79,10 @@
  */
 
 #ifdef VIMAGE_GLOBALS
+struct stat_header  icmpstat_header = {
+	.sth_version = ICMPSTAT_VERSION,
+	.sth_len = sizeof(struct icmpstat)
+};
 struct icmpstat	icmpstat;
 static int	icmpmaskrepl;
 static u_int	icmpmaskfake;
@@ -93,7 +97,10 @@
 #endif
 
 SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_icmp, ICMPCTL_STATS, stats,
-	CTLFLAG_RW, icmpstat, icmpstat, "");
+	CTLFLAG_RW, icmpstat, icmpstat, "ICMP statistics");
+
+SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, stats_header,
+	CTLFLAG_RW, icmpstat_header, stat_header, "ICMP statistics header");
 
 SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, ICMPCTL_MASKREPL, maskrepl,
 	CTLFLAG_RW, icmpmaskrepl, 0,


More information about the p4-projects mailing list