summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2009-11-29 20:37:30 +0000
committerbz <bz@FreeBSD.org>2009-11-29 20:37:30 +0000
commit21f84f921a8c72a476cb67e339ffe469ccdafed8 (patch)
tree6e3e6bc998199ca29d299c3bda8bdb7ade948768 /usr.bin
parent3797d9ecfd0598a6d59a7637523545b49a4af853 (diff)
downloadFreeBSD-src-21f84f921a8c72a476cb67e339ffe469ccdafed8.zip
FreeBSD-src-21f84f921a8c72a476cb67e339ffe469ccdafed8.tar.gz
Add more statistics variables for IPcomp.
Try to version the struct in a backward compatible way. People asked for the versioning of the stats structs in general before. MFC after: 5 days
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/ipsec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr.bin/netstat/ipsec.c b/usr.bin/netstat/ipsec.c
index bfd8ce0..d3276bf 100644
--- a/usr.bin/netstat/ipsec.c
+++ b/usr.bin/netstat/ipsec.c
@@ -418,6 +418,7 @@ esp_stats(u_long off, const char *name, int family __unused, int proto __unused)
static void
print_ipcompstats(const struct ipcompstat *ipcompstat)
{
+ uint32_t version;
#define p32(f, m) if (ipcompstat->f || sflag <= 1) \
printf("\t%u" m, (unsigned int)ipcompstat->f, plural(ipcompstat->f))
#define p64(f, m) if (ipcompstat->f || sflag <= 1) \
@@ -425,6 +426,11 @@ print_ipcompstats(const struct ipcompstat *ipcompstat)
#define hist(f, n, t) \
ipsec_hist_new((f), sizeof(f)/sizeof(f[0]), (n), (t));
+#ifndef IPCOMPSTAT_VERSION
+ version = 0;
+#else
+ version = ipcompstat->version;
+#endif
p32(ipcomps_hdrops, " packet%s shorter than header shows\n");
p32(ipcomps_nopf, " packet%s dropped; protocol family not supported\n");
p32(ipcomps_notdb, " packet%s dropped; no TDB\n");
@@ -441,6 +447,10 @@ print_ipcompstats(const struct ipcompstat *ipcompstat)
p32(ipcomps_pdrops, " packet%s blocked due to policy\n");
p32(ipcomps_crypto, " crypto processing failure%s\n");
hist(ipcompstat->ipcomps_hist, ipsec_compnames, "COMP output");
+ if (version >= 1) {
+ p32(ipcomps_threshold, " packet%s sent uncompressed; size < compr. algo. threshold\n");
+ p32(ipcomps_uncompr, " packet%s sent uncompressed; compression was useless\n");
+ }
#undef p32
#undef p64
OpenPOWER on IntegriCloud