Date: Tue, 28 Jul 2009 23:58:12 GMT From: Gabor Pali <pgj@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 166707 for review Message-ID: <200907282358.n6SNwCVH056930@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=166707 Change 166707 by pgj@petymeg-current on 2009/07/28 23:57:36 Add support for DDP statistics. Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#40 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#38 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#8 edit .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#44 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#40 (text+ko) ==== @@ -122,6 +122,7 @@ stat_ICMP, stat_PIM, stat_IGMP, + stat_DDP, stat_MAX, stat_Invalid, }; @@ -154,6 +155,7 @@ struct icmp_stat; struct pim_stat; struct igmp_stat; +struct ddp_stat; __BEGIN_DECLS const char *netstat_strerror(int); @@ -558,4 +560,17 @@ u_int64_t netstat_igmps_get_rcv_ourreports(const struct igmp_stat *); u_int64_t netstat_igmps_get_rcv_nora(const struct igmp_stat *); u_int64_t netstat_igmps_get_snd_reports(const struct igmp_stat *); + +const struct ddp_stat *netstat_get_ddpstats(const struct stat_type *); + +u_int64_t netstat_ddps_get_short(const struct ddp_stat *); +u_int64_t netstat_ddps_get_long(const struct ddp_stat *); +u_int64_t netstat_ddps_get_nosum(const struct ddp_stat *); +u_int64_t netstat_ddps_get_badsum(const struct ddp_stat *); +u_int64_t netstat_ddps_get_tooshort(const struct ddp_stat *); +u_int64_t netstat_ddps_get_toosmall(const struct ddp_stat *); +u_int64_t netstat_ddps_get_forward(const struct ddp_stat *); +u_int64_t netstat_ddps_get_encap(const struct ddp_stat *); +u_int64_t netstat_ddps_get_cantforward(const struct ddp_stat *); +u_int64_t netstat_ddps_get_nosockspace(const struct ddp_stat *); #endif /* !_NETSTAT_H_ */ ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#38 (text+ko) ==== @@ -49,6 +49,8 @@ #include <netinet/icmp_var.h> #include <netinet/pim_var.h> #include <netinet/igmp_var.h> +#include <netatalk/at.h> +#include <netatalk/ddp_var.h> #include "netstat.h" @@ -314,6 +316,10 @@ struct igmpstat s; }; +struct ddp_stat { + struct ddpstat s; +}; + int kread_data(kvm_t *kvm, u_long kvm_pointer, void *address, size_t size); int kread_string(kvm_t *kvm, u_long kvm_pointer, char *buffer, int buflen); ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#8 (text+ko) ==== @@ -64,6 +64,7 @@ { ICMPSTAT_VERSION, "net.inet.icmp.stats", "_icmpstat" }, { PIMSTAT_VERSION, "net.inet.pim.stats", "_pimstat" }, { IGMPSTAT_VERSION, "net.inet.igmp.stats", "_igmpstat" }, + { DDPSTAT_VERSION, "net.ddp.stats", "_ddpstat" }, }; int ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#44 (text+ko) ==== @@ -2458,6 +2458,75 @@ return (isp->s.igps_snd_reports); } +const struct ddp_stat * +netstat_get_ddpstats(const struct stat_type *sttp) +{ + if (sttp->stt_type == stat_DDP) { + return ((const struct ddp_stat *)sttp->stt_data); + } + return (NULL); +} + +u_int64_t +netstat_ddps_get_short(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_short); +} + +u_int64_t +netstat_ddps_get_long(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_long); +} + +u_int64_t +netstat_ddps_get_nosum(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_nosum); +} + +u_int64_t +netstat_ddps_get_badsum(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_badsum); +} + +u_int64_t +netstat_ddps_get_tooshort(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_tooshort); +} + +u_int64_t +netstat_ddps_get_toosmall(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_toosmall); +} + +u_int64_t +netstat_ddps_get_forward(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_forward); +} + +u_int64_t +netstat_ddps_get_encap(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_encap); +} + +u_int64_t +netstat_ddps_get_cantforward(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_cantforward); +} + +u_int64_t +netstat_ddps_get_nosockspace(const struct ddp_stat *dsp) +{ + return (dsp->s.ddps_nosockspace); +} + static const char *icmpnames[ICMP_MAXTYPE + 1] = { "echo reply", /* RFC 792 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907282358.n6SNwCVH056930>
