diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2009-11-29 20:37:30 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2009-11-29 20:37:30 +0000 |
commit | 90b4c081d017bc2d29ad48cf3437d0f159018b61 (patch) | |
tree | 6e3e6bc998199ca29d299c3bda8bdb7ade948768 /usr.bin/netstat/ipsec.c | |
parent | 6852bd671fb6e1db1a02859a879cb1eb87df5182 (diff) | |
download | src-90b4c081d017bc2d29ad48cf3437d0f159018b61.tar.gz src-90b4c081d017bc2d29ad48cf3437d0f159018b61.zip |
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
Notes
Notes:
svn path=/head/; revision=199946
Diffstat (limited to 'usr.bin/netstat/ipsec.c')
-rw-r--r-- | usr.bin/netstat/ipsec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/usr.bin/netstat/ipsec.c b/usr.bin/netstat/ipsec.c index bfd8ce01ee85..d3276bf27615 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 |