* Get nat64clat instance statistics. * Request: [ ipfw_obj_header ] * Reply: [ ipfw_obj_header ipfw_obj_ctlv [ uint64_t x N ] ] */
| 370 | * Reply: [ ipfw_obj_header ipfw_obj_ctlv [ uint64_t x N ] ] |
| 371 | */ |
| 372 | static int |
| 373 | nat64clat_get_stats(const char *name, uint8_t set, |
| 374 | struct ipfw_nat64clat_stats *stats) |
| 375 | { |
| 376 | ipfw_obj_header *oh; |
| 377 | ipfw_obj_ctlv *oc; |
| 378 | size_t sz; |
| 379 | |
| 380 | sz = sizeof(*oh) + sizeof(*oc) + sizeof(*stats); |
| 381 | oh = calloc(1, sz); |
| 382 | nat64clat_fill_ntlv(&oh->ntlv, name, set); |
| 383 | if (do_get3(IP_FW_NAT64CLAT_STATS, &oh->opheader, &sz) == 0) { |
| 384 | oc = (ipfw_obj_ctlv *)(oh + 1); |
| 385 | memcpy(stats, oc + 1, sizeof(*stats)); |
| 386 | free(oh); |
| 387 | return (0); |
| 388 | } |
| 389 | free(oh); |
| 390 | return (-1); |
| 391 | } |
| 392 | |
| 393 | static void |
| 394 | nat64clat_stats(const char *name, uint8_t set) |
no test coverage detected