MCPcopy Create free account
hub / github.com/F-Stack/f-stack / print_ipcompstats

Function print_ipcompstats

tools/netstat/ipsec.c:383–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383static void
384print_ipcompstats(const struct ipcompstat *ipcompstat)
385{
386 xo_open_container("ipcomp-statictics");
387
388#define p(f, n, m) if (ipcompstat->f || sflag <= 1) \
389 xo_emit("\t{:" n "/%ju} {N:/" m "}\n", \
390 (uintmax_t)ipcompstat->f, plural(ipcompstat->f))
391#define hist(f, n, t, c) \
392 ipsec_hist_new((f), sizeof(f)/sizeof(f[0]), (n), (t), (c));
393
394 p(ipcomps_hdrops, "dropped-short-header",
395 "packet%s shorter than header shows");
396 p(ipcomps_nopf, "dropped-bad-protocol",
397 "packet%s dropped; protocol family not supported");
398 p(ipcomps_notdb, "dropped-no-tdb", "packet%s dropped; no TDB");
399 p(ipcomps_badkcr, "dropped-bad-kcr", "packet%s dropped; bad KCR");
400 p(ipcomps_qfull, "dropped-queue-full", "packet%s dropped; queue full");
401 p(ipcomps_noxform, "dropped-no-transform",
402 "packet%s dropped; no transform");
403 p(ipcomps_wrap, "replay-counter-wraps", "replay counter wrap%s");
404 p(ipcomps_input, "receieve-packets", "packet%s in");
405 p(ipcomps_output, "sent-packets", "packet%s out");
406 p(ipcomps_invalid, "dropped-bad-tdb", "packet%s dropped; invalid TDB");
407 p(ipcomps_ibytes, "receieved-bytes", "byte%s in");
408 p(ipcomps_obytes, "sent-bytes", "byte%s out");
409 p(ipcomps_toobig, "dropped-too-large",
410 "packet%s dropped; larger than IP_MAXPACKET");
411 p(ipcomps_pdrops, "dropped-policy-violation",
412 "packet%s blocked due to policy");
413 p(ipcomps_crypto, "crypto-failure", "crypto processing failure%s");
414 hist(ipcompstat->ipcomps_hist, ipsec_compnames,
415 "COMP output", "comp-output-histogram");
416 p(ipcomps_threshold, "sent-uncompressed-small-packets",
417 "packet%s sent uncompressed; size < compr. algo. threshold");
418 p(ipcomps_uncompr, "sent-uncompressed-useless-packets",
419 "packet%s sent uncompressed; compression was useless");
420
421#undef p
422#undef hist
423 xo_close_container("ipcomp-statictics");
424}
425
426void
427ipcomp_stats(u_long off, const char *name, int family __unused,

Callers 1

ipcomp_statsFunction · 0.85

Calls 2

xo_open_containerFunction · 0.85
xo_close_containerFunction · 0.85

Tested by

no test coverage detected