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

Function nat64clat_stats

tools/ipfw/nat64clat.c:393–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393static void
394nat64clat_stats(const char *name, uint8_t set)
395{
396 struct ipfw_nat64clat_stats stats;
397
398 if (nat64clat_get_stats(name, set, &stats) != 0)
399 err(EX_OSERR, "Error retrieving stats");
400
401 if (g_co.use_set != 0 || set != 0)
402 printf("set %u ", set);
403 printf("nat64clat %s\n", name);
404
405 printf("\t%ju packets translated from IPv6 to IPv4\n",
406 (uintmax_t)stats.opcnt64);
407 printf("\t%ju packets translated from IPv4 to IPv6\n",
408 (uintmax_t)stats.opcnt46);
409 printf("\t%ju IPv6 fragments created\n",
410 (uintmax_t)stats.ofrags);
411 printf("\t%ju IPv4 fragments received\n",
412 (uintmax_t)stats.ifrags);
413 printf("\t%ju output packets dropped due to no bufs, etc.\n",
414 (uintmax_t)stats.oerrors);
415 printf("\t%ju output packets discarded due to no IPv4 route\n",
416 (uintmax_t)stats.noroute4);
417 printf("\t%ju output packets discarded due to no IPv6 route\n",
418 (uintmax_t)stats.noroute6);
419 printf("\t%ju packets discarded due to unsupported protocol\n",
420 (uintmax_t)stats.noproto);
421 printf("\t%ju packets discarded due to memory allocation problems\n",
422 (uintmax_t)stats.nomem);
423 printf("\t%ju packets discarded due to some errors\n",
424 (uintmax_t)stats.dropped);
425}
426
427/*
428 * Reset nat64clat instance statistics specified by @oh->ntlv.

Callers 1

ipfw_nat64clat_handlerFunction · 0.70

Calls 2

nat64clat_get_statsFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected