| 391 | } |
| 392 | |
| 393 | static void |
| 394 | nat64clat_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. |
no test coverage detected