PERFORCE change 166837 for review

Gabor Pali pgj at FreeBSD.org
Thu Jul 30 22:04:33 UTC 2009


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

Change 166837 by pgj at petymeg-current on 2009/07/30 22:03:50

	Add header for ESP statistics.

Affected files ...

.. //depot/projects/soc2009/pgj_libstat/src/sys/netipsec/esp_var.h#2 edit
.. //depot/projects/soc2009/pgj_libstat/src/sys/netipsec/xform_esp.c#2 edit

Differences ...

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

@@ -47,6 +47,8 @@
  */
 #define	ESP_ALG_MAX	256		/* NB: could be < but skipjack is 249 */
 
+#define ESPSTAT_VERSION	0x00000001
+
 struct espstat {
 	u_int32_t	esps_hdrops;	/* Packet shorter than header shows */
 	u_int32_t	esps_nopf;	/* Protocol family not supported */

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

@@ -47,6 +47,7 @@
 #include <sys/random.h>
 #include <sys/sysctl.h>
 #include <sys/vimage.h>
+#include <sys/sockopt.h>
 
 #include <net/if.h>
 
@@ -55,6 +56,7 @@
 #include <netinet/ip.h>
 #include <netinet/ip_ecn.h>
 #include <netinet/ip6.h>
+#include <netinet/tcp_var.h>
 
 #include <net/route.h>
 #include <netipsec/ipsec.h>
@@ -77,6 +79,10 @@
 #include <opencrypto/xform.h>
 
 #ifdef VIMAGE_GLOBALS
+struct	stat_header espstat_header = {
+	.sth_version = ESPSTAT_VERSION,
+	.sth_len = sizeof(struct espstat)
+};
 struct	espstat espstat;
 static	int esp_max_ivlen;		/* max iv length over all algorithms */
 int	esp_enable;
@@ -85,8 +91,12 @@
 SYSCTL_DECL(_net_inet_esp);
 SYSCTL_V_INT(V_NET, vnet_ipsec,_net_inet_esp, OID_AUTO,
 	esp_enable,	CTLFLAG_RW,	esp_enable,	0, "");
+
 SYSCTL_V_STRUCT(V_NET, vnet_ipsec, _net_inet_esp, IPSECCTL_STATS,
-	stats,		CTLFLAG_RD,	espstat,	espstat, "");
+	stats,		CTLFLAG_RW,	espstat,	espstat, "");
+
+SYSCTL_V_STRUCT(V_NET, vnet_ipsec, _net_inet_esp, OID_AUTO,
+	stats_header,	CTLFLAG_RD,	espstat_header,	stat_header, "");
 
 static int esp_input_cb(struct cryptop *op);
 static int esp_output_cb(struct cryptop *crp);


More information about the p4-projects mailing list