* Get nat64lsn instance statistics. * Request: [ ipfw_obj_header ] * Reply: [ ipfw_obj_header ipfw_obj_ctlv [ uint64_t x N ] ] */
| 685 | * Reply: [ ipfw_obj_header ipfw_obj_ctlv [ uint64_t x N ] ] |
| 686 | */ |
| 687 | static int |
| 688 | nat64lsn_get_stats(const char *name, uint8_t set, |
| 689 | struct ipfw_nat64lsn_stats *stats) |
| 690 | { |
| 691 | ipfw_obj_header *oh; |
| 692 | ipfw_obj_ctlv *oc; |
| 693 | size_t sz; |
| 694 | |
| 695 | sz = sizeof(*oh) + sizeof(*oc) + sizeof(*stats); |
| 696 | oh = calloc(1, sz); |
| 697 | nat64lsn_fill_ntlv(&oh->ntlv, name, set); |
| 698 | if (do_get3(IP_FW_NAT64LSN_STATS, &oh->opheader, &sz) == 0) { |
| 699 | oc = (ipfw_obj_ctlv *)(oh + 1); |
| 700 | memcpy(stats, oc + 1, sizeof(*stats)); |
| 701 | free(oh); |
| 702 | return (0); |
| 703 | } |
| 704 | free(oh); |
| 705 | return (-1); |
| 706 | } |
| 707 | |
| 708 | static void |
| 709 | nat64lsn_stats(const char *name, uint8_t set) |
no test coverage detected