PERFORCE change 166872 for review
Gabor Pali
pgj at FreeBSD.org
Fri Jul 31 20:56:32 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166872
Change 166872 by pgj at petymeg-current on 2009/07/31 20:56:03
Add support for multicast forwarding statistics (IPv4).
Affected files ...
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#55 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#52 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#22 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#60 edit
Differences ...
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#55 (text+ko) ====
@@ -173,6 +173,7 @@
stat_IPcomp,
stat_IPsec,
#endif
+ stat_mroute,
stat_MAX,
stat_Invalid,
};
@@ -228,6 +229,7 @@
struct ah_stat;
struct ipcomp_stat;
#endif
+struct mroute_stat;
__BEGIN_DECLS
const char *netstat_strerror(int);
@@ -1124,4 +1126,20 @@
u_int32_t netstat_ipsecs_get_ips_input_middle(const struct ipsec_stat *);
u_int32_t netstat_ipsecs_get_ips_input_end(const struct ipsec_stat *);
#endif /* !IPSEC */
+
+const struct mroute_stat *netstat_get_mroutestats(const struct stat_type *);
+
+u_int64_t netstat_mroutes_get_mfc_lookups(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_mfc_misses(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_upcalls(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_no_route(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_bad_tunnel(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_cant_tunnel(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_wrong_if(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_upq_ovflw(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_cache_cleanups(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_drop_sel(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_q_overflow(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_pkt2large(const struct mroute_stat *);
+u_int64_t netstat_mroutes_get_upq_sockfull(const struct mroute_stat *);
#endif /* !_NETSTAT_H_ */
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#52 (text+ko) ====
@@ -73,6 +73,7 @@
#include <netipsec/ipcomp_var.h>
#include <netipsec/ipsec.h>
#endif
+#include <netinet/ip_mroute.h>
#include "netstat.h"
@@ -402,6 +403,10 @@
};
#endif
+struct mroute_stat {
+ struct mrtstat s;
+};
+
/* Timestamp type. */
struct timestamp_type {
u_int32_t ts_sec;
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#22 (text+ko) ====
@@ -94,6 +94,7 @@
{ IPCOMPSTAT_VERSION, "net.inet.ipcomp.stats", "_ipcompstat" },
{ IPSECSTAT_VERSION, "net.inet.ipsec.ipsecstats", "_ipsec4stat" },
#endif
+ { MRTSTAT_VERSION, "net.inet.ip.mrtstat", "_mrtstat" }
};
int
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#60 (text+ko) ====
@@ -2106,6 +2106,26 @@
#undef IPSEC_ACCA
#endif /* !IPSEC */
+#define MRT_ACC(field) \
+ STATS_ACCX(u_int64_t,mroute,field,mrts_##field)
+
+STATS_GET(mroute,mroute);
+MRT_ACC(mfc_lookups);
+MRT_ACC(mfc_misses);
+MRT_ACC(upcalls);
+MRT_ACC(no_route);
+MRT_ACC(bad_tunnel);
+MRT_ACC(cant_tunnel);
+MRT_ACC(wrong_if);
+MRT_ACC(upq_ovflw);
+MRT_ACC(cache_cleanups);
+MRT_ACC(drop_sel);
+MRT_ACC(q_overflow);
+MRT_ACC(pkt2large);
+MRT_ACC(upq_sockfull);
+#undef MRT_ACC
+
+
static const char *icmpnames[ICMP_MAXTYPE + 1] = {
"echo reply", /* RFC 792 */
"#1",
More information about the p4-projects
mailing list