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

Function print_ahstats

tools/netstat/ipsec.c:263–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263static void
264print_ahstats(const struct ahstat *ahstat)
265{
266 xo_open_container("ah-statictics");
267
268#define p(f, n, m) if (ahstat->f || sflag <= 1) \
269 xo_emit("\t{:" n "/%ju} {N:/" m "}\n", \
270 (uintmax_t)ahstat->f, plural(ahstat->f))
271#define hist(f, n, t, c) \
272 ipsec_hist_new((f), sizeof(f)/sizeof(f[0]), (n), (t), (c))
273
274 p(ahs_hdrops, "dropped-short-header",
275 "packet%s shorter than header shows");
276 p(ahs_nopf, "dropped-bad-protocol",
277 "packet%s dropped; protocol family not supported");
278 p(ahs_notdb, "dropped-no-tdb", "packet%s dropped; no TDB");
279 p(ahs_badkcr, "dropped-bad-kcr", "packet%s dropped; bad KCR");
280 p(ahs_qfull, "dropped-queue-full", "packet%s dropped; queue full");
281 p(ahs_noxform, "dropped-no-transform",
282 "packet%s dropped; no transform");
283 p(ahs_wrap, "replay-counter-wraps", "replay counter wrap%s");
284 p(ahs_badauth, "dropped-bad-auth",
285 "packet%s dropped; bad authentication detected");
286 p(ahs_badauthl, "dropped-bad-auth-level",
287 "packet%s dropped; bad authentication length");
288 p(ahs_replay, "possile-replay-detected",
289 "possible replay packet%s detected");
290 p(ahs_input, "received-packets", "packet%s in");
291 p(ahs_output, "send-packets", "packet%s out");
292 p(ahs_invalid, "dropped-bad-tdb", "packet%s dropped; invalid TDB");
293 p(ahs_ibytes, "received-bytes", "byte%s in");
294 p(ahs_obytes, "send-bytes", "byte%s out");
295 p(ahs_toobig, "dropped-too-large",
296 "packet%s dropped; larger than IP_MAXPACKET");
297 p(ahs_pdrops, "dropped-policy-violation",
298 "packet%s blocked due to policy");
299 p(ahs_crypto, "crypto-failures", "crypto processing failure%s");
300 p(ahs_tunnel, "tunnel-failures", "tunnel sanity check failure%s");
301 hist(ahstat->ahs_hist, ipsec_ahnames,
302 "AH output", "ah-output-histogram");
303
304#undef p
305#undef hist
306 xo_close_container("ah-statictics");
307}
308
309void
310ah_stats(u_long off, const char *name, int family __unused, int proto __unused)

Callers 1

ah_statsFunction · 0.85

Calls 2

xo_open_containerFunction · 0.85
xo_close_containerFunction · 0.85

Tested by

no test coverage detected