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

Function nat64lsn_stats

tools/ipfw/nat64lsn.c:708–771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706}
707
708static void
709nat64lsn_stats(const char *name, uint8_t set)
710{
711 struct ipfw_nat64lsn_stats stats;
712
713 if (nat64lsn_get_stats(name, set, &stats) != 0)
714 err(EX_OSERR, "Error retrieving stats");
715
716 if (g_co.use_set != 0 || set != 0)
717 printf("set %u ", set);
718 printf("nat64lsn %s\n", name);
719 printf("\t%ju packets translated from IPv6 to IPv4\n",
720 (uintmax_t)stats.opcnt64);
721 printf("\t%ju packets translated from IPv4 to IPv6\n",
722 (uintmax_t)stats.opcnt46);
723 printf("\t%ju IPv6 fragments created\n",
724 (uintmax_t)stats.ofrags);
725 printf("\t%ju IPv4 fragments received\n",
726 (uintmax_t)stats.ifrags);
727 printf("\t%ju output packets dropped due to no bufs, etc.\n",
728 (uintmax_t)stats.oerrors);
729 printf("\t%ju output packets discarded due to no IPv4 route\n",
730 (uintmax_t)stats.noroute4);
731 printf("\t%ju output packets discarded due to no IPv6 route\n",
732 (uintmax_t)stats.noroute6);
733 printf("\t%ju packets discarded due to unsupported protocol\n",
734 (uintmax_t)stats.noproto);
735 printf("\t%ju packets discarded due to memory allocation problems\n",
736 (uintmax_t)stats.nomem);
737 printf("\t%ju packets discarded due to some errors\n",
738 (uintmax_t)stats.dropped);
739 printf("\t%ju packets not matched with IPv4 prefix\n",
740 (uintmax_t)stats.nomatch4);
741
742 printf("\t%ju mbufs queued for post processing\n",
743 (uintmax_t)stats.jreinjected);
744 printf("\t%ju times the job queue was processed\n",
745 (uintmax_t)stats.jcalls);
746 printf("\t%ju job requests queued\n",
747 (uintmax_t)stats.jrequests);
748 printf("\t%ju job requests queue limit reached\n",
749 (uintmax_t)stats.jmaxlen);
750 printf("\t%ju job requests failed due to memory allocation problems\n",
751 (uintmax_t)stats.jnomem);
752
753 printf("\t%ju hosts allocated\n", (uintmax_t)stats.hostcount);
754 printf("\t%ju hosts requested\n", (uintmax_t)stats.jhostsreq);
755 printf("\t%ju host requests failed\n", (uintmax_t)stats.jhostfails);
756
757 printf("\t%ju portgroups requested\n", (uintmax_t)stats.jportreq);
758 printf("\t%ju portgroups allocated\n", (uintmax_t)stats.spgcreated);
759 printf("\t%ju portgroups deleted\n", (uintmax_t)stats.spgdeleted);
760 printf("\t%ju portgroup requests failed\n",
761 (uintmax_t)stats.jportfails);
762 printf("\t%ju portgroups allocated for TCP\n",
763 (uintmax_t)stats.tcpchunks);
764 printf("\t%ju portgroups allocated for UDP\n",
765 (uintmax_t)stats.udpchunks);

Callers 1

Calls 2

nat64lsn_get_statsFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected