Changeset View
Changeset View
Standalone View
Standalone View
lib/libpfctl/libpfctl.c
Show First 20 Lines • Show All 563 Lines • ▼ Show 20 Lines | if (anchor_call) | ||||
strlcpy(anchor_call, nvlist_get_string(nvl, "anchor_call"), | strlcpy(anchor_call, nvlist_get_string(nvl, "anchor_call"), | ||||
MAXPATHLEN); | MAXPATHLEN); | ||||
free(nv.data); | free(nv.data); | ||||
nvlist_destroy(nvl); | nvlist_destroy(nvl); | ||||
return (0); | return (0); | ||||
} | } | ||||
int | |||||
pfctl_set_keepcounters(int dev, bool keep) | |||||
{ | |||||
struct pfioc_nv nv; | |||||
nvlist_t *nvl; | |||||
int ret; | |||||
nvl = nvlist_create(0); | |||||
nvlist_add_bool(nvl, "keep_counters", keep); | |||||
nv.data = nvlist_pack(nvl, &nv.len); | |||||
nv.size = nv.len; | |||||
nvlist_destroy(nvl); | |||||
ret = ioctl(dev, DIOCKEEPCOUNTERS, &nv); | |||||
free(nv.data); | |||||
return (ret); | |||||
} |