PERFORCE change 166814 for review
Gabor Pali
pgj at FreeBSD.org
Thu Jul 30 17:56:59 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166814
Change 166814 by pgj at petymeg-current on 2009/07/30 17:56:29
- Standardize and add header for IPX statistics.
- Expose data via sysctl(3) [net.ipx.ipx.stats].
Affected files ...
.. //depot/projects/soc2009/pgj_libstat/src/sys/netipx/ipx_input.c#2 edit
.. //depot/projects/soc2009/pgj_libstat/src/sys/netipx/ipx_var.h#2 edit
Differences ...
==== //depot/projects/soc2009/pgj_libstat/src/sys/netipx/ipx_input.c#2 (text+ko) ====
@@ -73,11 +73,14 @@
#include <sys/kernel.h>
#include <sys/random.h>
#include <sys/sysctl.h>
+#include <sys/sockopt.h>
#include <net/if.h>
#include <net/route.h>
#include <net/netisr.h>
+#include <netinet/tcp_var.h>
+
#include <netipx/ipx.h>
#include <netipx/spx.h>
#include <netipx/ipx_if.h>
@@ -109,7 +112,17 @@
.s_host[1] = 0xffff,
.s_host[2] = 0xffff };
+struct stat_header ipxstat_header = {
+ .sth_version = IPXSTAT_VERSION,
+ .sth_len = sizeof(struct ipxstat)
+};
struct ipxstat ipxstat;
+
+SYSCTL_STRUCT(_net_ipx_ipx, OID_AUTO, stats, CTLFLAG_RW, &ipxstat, ipxstat,
+ "IPX Statistics (struct ipxstat, netipx/ipx_var.h)");
+SYSCTL_STRUCT(_net_ipx_ipx, OID_AUTO, stats_header, CTLFLAG_RD,
+ &ipxstat_header, stat_header, "IPX Statistics header");
+
struct sockaddr_ipx ipx_netmask, ipx_hostmask;
/*
==== //depot/projects/soc2009/pgj_libstat/src/sys/netipx/ipx_var.h#2 (text+ko) ====
@@ -67,18 +67,20 @@
/*
* IPX Kernel Structures and Variables
*/
+#define IPXSTAT_VERSION 0x00000001
+
struct ipxstat {
- u_long ipxs_total; /* total packets received */
- u_long ipxs_badsum; /* checksum bad */
- u_long ipxs_tooshort; /* packet too short */
- u_long ipxs_toosmall; /* not enough data */
- u_long ipxs_forward; /* packets forwarded */
- u_long ipxs_cantforward; /* packets rcvd for unreachable dest */
- u_long ipxs_delivered; /* datagrams delivered to upper level*/
- u_long ipxs_localout; /* total ipx packets generated here */
- u_long ipxs_odropped; /* lost packets due to nobufs, etc. */
- u_long ipxs_noroute; /* packets discarded due to no route */
- u_long ipxs_mtutoosmall; /* the interface mtu is too small */
+ u_int64_t ipxs_total; /* total packets received */
+ u_int64_t ipxs_badsum; /* checksum bad */
+ u_int64_t ipxs_tooshort; /* packet too short */
+ u_int64_t ipxs_toosmall; /* not enough data */
+ u_int64_t ipxs_forward; /* packets forwarded */
+ u_int64_t ipxs_cantforward; /* packets rcvd for unreachable dest */
+ u_int64_t ipxs_delivered; /* datagrams delivered to upper level*/
+ u_int64_t ipxs_localout; /* total ipx packets generated here */
+ u_int64_t ipxs_odropped; /* lost packets due to nobufs, etc. */
+ u_int64_t ipxs_noroute; /* packets discarded due to no route */
+ u_int64_t ipxs_mtutoosmall; /* the interface mtu is too small */
};
#ifdef _KERNEL
More information about the p4-projects
mailing list