Date: Thu, 30 Jul 2009 19:26:37 GMT From: Gabor Pali <pgj@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 166829 for review Message-ID: <200907301926.n6UJQb5r012286@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=166829 Change 166829 by pgj@petymeg-current on 2009/07/30 19:26:29 Add support for pfsync statistics. Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#48 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#45 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#15 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#53 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#48 (text+ko) ==== @@ -135,6 +135,7 @@ stat_IPX, stat_SPX, #endif + stat_pfsync, stat_MAX, stat_Invalid, }; @@ -182,6 +183,7 @@ struct ipx_stat; struct spx_stat; #endif +struct pfsync_stat; __BEGIN_DECLS const char *netstat_strerror(int); @@ -879,4 +881,23 @@ u_int64_t netstat_spxs_get_notyet(const struct spx_stat *); u_int64_t netstat_spxs_get_lstdup(const struct spx_stat *); #endif /* !IPX */ + +const struct pfsync_stat *netstat_get_pfsyncstats(const struct stat_type *); + +u_int64_t netstat_pfsyncs_get_ipackets(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_ipackets6(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_badif(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_badttl(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_hdrops(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_badver(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_badact(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_badlen(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_badauth(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_stale(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_badval(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_badstate(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_opackets(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_opackets6(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_onomem(const struct pfsync_stat *); +u_int64_t netstat_pfsyncs_get_oerrors(const struct pfsync_stat *); #endif /* !_NETSTAT_H_ */ ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#45 (text+ko) ==== @@ -63,6 +63,8 @@ #include <netipx/ipx_var.h> #include <netipx/spx_var.h> #endif +#include <net/pfvar.h> +#include <net/if_pfsync.h> #include "netstat.h" @@ -362,6 +364,10 @@ }; #endif +struct pfsync_stat { + struct pfsyncstats s; +}; + /* Timestamp type. */ struct timestamp_type { u_int32_t ts_sec; ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#15 (text+ko) ==== @@ -85,6 +85,7 @@ { IPXSTAT_VERSION, "net.ipx.ipx.stats", "_ipxstat" }, { SPXSTAT_VERSION, "net.ipx.spx.stats", "_spx_istat" }, #endif + { PFSYNCSTAT_VERSION, "net.inet.pfsync.stats", "_pfsyncstats" }, }; int ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#53 (text+ko) ==== @@ -1843,6 +1843,28 @@ #undef SPX_ACC1 #endif /* !IPX */ +#define PFSYNC_ACC(field) \ + STATS_ACCX(u_int64_t,pfsync,field,pfsyncs_##field) + +STATS_GET(pfsync,pfsync); +PFSYNC_ACC(ipackets); +PFSYNC_ACC(ipackets6); +PFSYNC_ACC(badif); +PFSYNC_ACC(badttl); +PFSYNC_ACC(hdrops); +PFSYNC_ACC(badver); +PFSYNC_ACC(badact); +PFSYNC_ACC(badlen); +PFSYNC_ACC(badauth); +PFSYNC_ACC(stale); +PFSYNC_ACC(badval); +PFSYNC_ACC(badstate); +PFSYNC_ACC(opackets); +PFSYNC_ACC(opackets6); +PFSYNC_ACC(onomem); +PFSYNC_ACC(oerrors); +#undef PFSYNC_ACC + static const char *icmpnames[ICMP_MAXTYPE + 1] = { "echo reply", /* RFC 792 */ "#1",help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907301926.n6UJQb5r012286>
