From owner-p4-projects@FreeBSD.ORG Thu Jul 30 17:57:59 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 650681065672; Thu, 30 Jul 2009 17:57:59 +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 22978106567C for ; Thu, 30 Jul 2009 17:57:59 +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 109668FC18 for ; Thu, 30 Jul 2009 17:57:59 +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 n6UHvw5t000639 for ; Thu, 30 Jul 2009 17:57:58 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6UHvwNn000637 for perforce@freebsd.org; Thu, 30 Jul 2009 17:57:58 GMT (envelope-from pgj@FreeBSD.org) Date: Thu, 30 Jul 2009 17:57:58 GMT Message-Id: <200907301757.n6UHvwNn000637@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 166815 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:58:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=166815 Change 166815 by pgj@petymeg-current on 2009/07/30 17:57:22 Add (optional) support for IPX statistics. Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/Makefile#15 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#46 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#43 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#13 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#51 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/Makefile#15 (text+ko) ==== @@ -26,4 +26,8 @@ CFLAGS+= -DINET6 .endif +.if ${MK_IPX_SUPPORT} != "no" +CFLAGS+= -DIPX +.endif + .include ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#46 (text+ko) ==== @@ -131,6 +131,9 @@ stat_PIM6, stat_RIP6, #endif +#ifdef IPX + stat_IPX, +#endif stat_MAX, stat_Invalid, }; @@ -174,6 +177,9 @@ struct pim6_stat; struct rip6_stat; #endif +#ifdef IPX +struct ipx_stat; +#endif __BEGIN_DECLS const char *netstat_strerror(int); @@ -792,4 +798,20 @@ u_int64_t netstat_rip6s_get_opackets(const struct rip6_stat *); u_int64_t netstat_rip6s_get_delivered(const struct rip6_stat *); #endif /* !INET6 */ + +#ifdef IPX +const struct ipx_stat *netstat_get_ipxstats(const struct stat_type *); + +u_int64_t netstat_ipxs_get_total(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_badsum(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_tooshort(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_toosmall(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_forward(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_cantforward(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_delivered(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_localout(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_odropped(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_noroute(const struct ipx_stat *); +u_int64_t netstat_ipxs_get_mtutoosmall(const struct ipx_stat *); +#endif /* !IPX */ #endif /* !_NETSTAT_H_ */ ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#43 (text+ko) ==== @@ -59,6 +59,9 @@ #include #include #endif +#ifdef IPX +#include +#endif #include "netstat.h" @@ -348,6 +351,12 @@ }; #endif +#ifdef IPX +struct ipx_stat { + struct ipxstat s; +}; +#endif + /* Timestamp type. */ struct timestamp_type { u_int32_t ts_sec; ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#13 (text+ko) ==== @@ -42,6 +42,9 @@ #include #include #endif +#ifdef IPX +#include +#endif #include #include @@ -77,6 +80,9 @@ { PIM6STAT_VERSION, "net.inet6.pim.stats", "_pim6stat" }, { RIP6STAT_VERSION, "net.inet6.ip6.rip6stats", "_rip6stat" }, #endif +#ifdef IPX + { IPXSTAT_VERSION, "net.ipx.ipx.stats", "_ipxstat" }, +#endif }; int ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#51 (text+ko) ==== @@ -1754,6 +1754,25 @@ #undef RIP6_ACC #endif /* !INET6 */ +#ifdef IPX +#define IPX_ACC(field) \ + STATS_ACCX(u_int64_t,ipx,field,ipxs_##field) + +STATS_GET(ipx,IPX); +IPX_ACC(total); +IPX_ACC(badsum); +IPX_ACC(tooshort); +IPX_ACC(toosmall); +IPX_ACC(forward); +IPX_ACC(cantforward); +IPX_ACC(delivered); +IPX_ACC(localout); +IPX_ACC(odropped); +IPX_ACC(noroute); +IPX_ACC(mtutoosmall); +#undef IPX_ACC +#endif /* !IPX */ + static const char *icmpnames[ICMP_MAXTYPE + 1] = { "echo reply", /* RFC 792 */ "#1",