* Get NPTv6 instance statistics. * Request: [ ipfw_obj_header ] * Reply: [ ipfw_obj_header ipfw_obj_ctlv [ uint64_t x N ] ] */
| 304 | * Reply: [ ipfw_obj_header ipfw_obj_ctlv [ uint64_t x N ] ] |
| 305 | */ |
| 306 | static int |
| 307 | nptv6_get_stats(const char *name, uint8_t set, struct ipfw_nptv6_stats *stats) |
| 308 | { |
| 309 | ipfw_obj_header *oh; |
| 310 | ipfw_obj_ctlv *oc; |
| 311 | size_t sz; |
| 312 | |
| 313 | sz = sizeof(*oh) + sizeof(*oc) + sizeof(*stats); |
| 314 | oh = calloc(1, sz); |
| 315 | nptv6_fill_ntlv(&oh->ntlv, name, set); |
| 316 | if (do_get3(IP_FW_NPTV6_STATS, &oh->opheader, &sz) == 0) { |
| 317 | oc = (ipfw_obj_ctlv *)(oh + 1); |
| 318 | memcpy(stats, oc + 1, sizeof(*stats)); |
| 319 | free(oh); |
| 320 | return (0); |
| 321 | } |
| 322 | free(oh); |
| 323 | return (-1); |
| 324 | } |
| 325 | |
| 326 | static void |
| 327 | nptv6_stats(const char *name, uint8_t set) |
no test coverage detected