From owner-p4-projects@FreeBSD.ORG Thu Jul 30 17:56:58 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2F68D1065674; Thu, 30 Jul 2009 17:56:58 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E36FC106566B for ; Thu, 30 Jul 2009 17:56:57 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B74D28FC18 for ; Thu, 30 Jul 2009 17:56:57 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6UHuvBL000543 for ; Thu, 30 Jul 2009 17:56:57 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6UHuvwf000541 for perforce@freebsd.org; Thu, 30 Jul 2009 17:56:57 GMT (envelope-from pgj@FreeBSD.org) Date: Thu, 30 Jul 2009 17:56:57 GMT Message-Id: <200907301756.n6UHuvwf000541@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pgj@FreeBSD.org using -f From: Gabor Pali To: Perforce Change Reviews Cc: Subject: PERFORCE change 166814 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 17:56:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=166814 Change 166814 by pgj@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 #include #include +#include #include #include #include +#include + #include #include #include @@ -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