PERFORCE change 166880 for review
Gabor Pali
pgj at FreeBSD.org
Fri Jul 31 22:09:53 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166880
Change 166880 by pgj at petymeg-current on 2009/07/31 22:09:46
Add support for IPv4 forwarding statistics.
Affected files ...
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#57 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#54 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#24 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#62 edit
Differences ...
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#57 (text+ko) ====
@@ -173,6 +173,7 @@
stat_IPcomp,
stat_IPsec,
#endif
+ stat_route,
stat_mroute,
#ifdef INET6
stat_mroute6,
@@ -232,6 +233,7 @@
struct ah_stat;
struct ipcomp_stat;
#endif
+struct route_stat;
struct mroute_stat;
#ifdef INET6
struct mroute6_stat;
@@ -1133,6 +1135,15 @@
u_int32_t netstat_ipsecs_get_ips_input_end(const struct ipsec_stat *);
#endif /* !IPSEC */
+const struct route_stat *netstat_get_routestats(const struct stat_type *);
+
+u_int64_t netstat_routes_get_badredirect(const struct route_stat *);
+u_int64_t netstat_routes_get_dynamic(const struct route_stat *);
+u_int64_t netstat_routes_get_newgateway(const struct route_stat *);
+u_int64_t netstat_routes_get_unreach(const struct route_stat *);
+u_int64_t netstat_routes_get_wildcard(const struct route_stat *);
+u_int64_t netstat_routes_get_trash(const struct route_stat *);
+
const struct mroute_stat *netstat_get_mroutestats(const struct stat_type *);
u_int64_t netstat_mroutes_get_mfc_lookups(const struct mroute_stat *);
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#54 (text+ko) ====
@@ -73,6 +73,7 @@
#include <netipsec/ipcomp_var.h>
#include <netipsec/ipsec.h>
#endif
+#include <net/route.h>
#include <netinet/ip_mroute.h>
#ifdef INET6
#include <netinet6/ip6_mroute.h>
@@ -406,6 +407,10 @@
};
#endif
+struct route_stat {
+ struct rtstat s;
+};
+
struct mroute_stat {
struct mrtstat s;
};
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#24 (text+ko) ====
@@ -94,6 +94,7 @@
{ IPCOMPSTAT_VERSION, "net.inet.ipcomp.stats", "_ipcompstat" },
{ IPSECSTAT_VERSION, "net.inet.ipsec.ipsecstats", "_ipsec4stat" },
#endif
+ { RTSTAT_VERSION, "net.inet.ip.rtstat", "_rtstat" },
{ MRTSTAT_VERSION, "net.inet.ip.mrtstat", "_mrtstat" },
#ifdef INET6
{ MRT6STAT_VERSION, "net.inet6.ip6.mrt6stat", "_mrt6stat" },
==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#62 (text+ko) ====
@@ -2106,6 +2106,18 @@
#undef IPSEC_ACCA
#endif /* !IPSEC */
+#define RT_ACC(field) \
+ STATS_ACCX(u_int64_t,route,field,rts_##field)
+
+STATS_GET(route,route);
+RT_ACC(badredirect);
+RT_ACC(dynamic);
+RT_ACC(newgateway);
+RT_ACC(unreach);
+RT_ACC(wildcard);
+RT_ACC(trash);
+#undef RT_ACC
+
#define MRT_ACC(field) \
STATS_ACCX(u_int64_t,mroute,field,mrts_##field)
More information about the p4-projects
mailing list