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

Function nat64lsn_get_stats

tools/ipfw/nat64lsn.c:687–706  ·  view source on GitHub ↗

* Get nat64lsn instance statistics. * Request: [ ipfw_obj_header ] * Reply: [ ipfw_obj_header ipfw_obj_ctlv [ uint64_t x N ] ] */

Source from the content-addressed store, hash-verified

685 * Reply: [ ipfw_obj_header ipfw_obj_ctlv [ uint64_t x N ] ]
686 */
687static int
688nat64lsn_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
708static void
709nat64lsn_stats(const char *name, uint8_t set)

Callers 1

nat64lsn_statsFunction · 0.85

Calls 5

callocFunction · 0.85
nat64lsn_fill_ntlvFunction · 0.85
do_get3Function · 0.85
memcpyFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected