PERFORCE change 166803 for review
Gabor Pali
pgj at FreeBSD.org
Thu Jul 30 16:58:54 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166803
Change 166803 by pgj at petymeg-current on 2009/07/30 16:58:45
Add support for PIM6 stats.
Affected files ...
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#44 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#41 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#11 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#49 edit
Differences ...
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#44 (text+ko) ====
@@ -128,6 +128,7 @@
#endif
#ifdef INET6
stat_ICMP6,
+ stat_PIM6,
#endif
stat_MAX,
stat_Invalid,
@@ -169,6 +170,7 @@
#endif
#ifdef INET6
struct icmp6_stat;
+struct pim6_stat;
#endif
__BEGIN_DECLS
@@ -766,5 +768,15 @@
u_int64_t netstat_icmp6s_get_badrs(const struct icmp6_stat *);
u_int64_t netstat_icmp6s_get_badra(const struct icmp6_stat *);
u_int64_t netstat_icmp6s_get_badredirect(const struct icmp6_stat *);
+
+const struct pim6_stat *netstat_get_pim6stats(const struct stat_type *);
+
+u_int64_t netstat_pim6s_get_rcv_total(const struct pim6_stat *);
+u_int64_t netstat_pim6s_get_rcv_tooshort(const struct pim6_stat *);
+u_int64_t netstat_pim6s_get_rcv_badsum(const struct pim6_stat *);
+u_int64_t netstat_pim6s_get_rcv_badversion(const struct pim6_stat *);
+u_int64_t netstat_pim6s_get_rcv_registers(const struct pim6_stat *);
+u_int64_t netstat_pim6s_get_rcv_badregisters(const struct pim6_stat *);
+u_int64_t netstat_pim6s_get_snd_registers(const struct pim6_stat *);
#endif /* !INET6 */
#endif /* !_NETSTAT_H_ */
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#41 (text+ko) ====
@@ -56,6 +56,7 @@
#endif
#ifdef INET6
#include <netinet/icmp6.h>
+#include <netinet6/pim6_var.h>
#endif
#include "netstat.h"
@@ -336,6 +337,10 @@
struct icmp6_stat {
struct icmp6stat s;
};
+
+struct pim6_stat {
+ struct pim6stat s;
+};
#endif
/* Timestamp type. */
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#11 (text+ko) ====
@@ -38,6 +38,9 @@
#include <netinet/ip_carp.h>
#include <netinet/ip_icmp.h>
#include <netinet/icmp_var.h>
+#ifdef INET6
+#include <netinet6/pim6_var.h>
+#endif
#include <err.h>
#include <kvm.h>
@@ -70,6 +73,7 @@
#endif
#ifdef INET6
{ ICMP6STAT_VERSION, "net.inet6.icmp6.stats", "_icmp6stat" },
+ { PIM6STAT_VERSION, "net.inet6.pim.stats", "_pim6stat" },
#endif
};
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#49 (text+ko) ====
@@ -1726,6 +1726,18 @@
#undef ICMP_ACC
#undef ICMP_ACCA
+#define PIM6_ACC(field) \
+ STATS_ACCX(u_int64_t,pim6,field,pim6s_##field)
+
+STATS_GET(pim6,PIM6);
+PIM6_ACC(rcv_total);
+PIM6_ACC(rcv_tooshort);
+PIM6_ACC(rcv_badsum);
+PIM6_ACC(rcv_badversion);
+PIM6_ACC(rcv_registers);
+PIM6_ACC(rcv_badregisters);
+PIM6_ACC(snd_registers);
+#undef PIM6_ACC
#endif /* !INET6 */
static const char *icmpnames[ICMP_MAXTYPE + 1] = {
More information about the p4-projects
mailing list