Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/pf/pf_ioctl.c
Show First 20 Lines • Show All 1,155 Lines • ▼ Show 20 Lines | pf_src_node_copy(const struct pf_ksrc_node *in, struct pf_src_node *out) | ||||
bzero(out, sizeof(struct pf_src_node)); | bzero(out, sizeof(struct pf_src_node)); | ||||
bcopy(&in->addr, &out->addr, sizeof(struct pf_addr)); | bcopy(&in->addr, &out->addr, sizeof(struct pf_addr)); | ||||
bcopy(&in->raddr, &out->raddr, sizeof(struct pf_addr)); | bcopy(&in->raddr, &out->raddr, sizeof(struct pf_addr)); | ||||
if (in->rule.ptr != NULL) | if (in->rule.ptr != NULL) | ||||
out->rule.nr = in->rule.ptr->nr; | out->rule.nr = in->rule.ptr->nr; | ||||
bcopy(&in->bytes, &out->bytes, sizeof(u_int64_t) * 2); | for (int i = 0; i < 2; i++) { | ||||
bcopy(&in->packets, &out->packets, sizeof(u_int64_t) * 2); | out->bytes[i] = counter_u64_fetch(in->bytes[i]); | ||||
out->packets[i] = counter_u64_fetch(in->packets[i]); | |||||
} | |||||
out->states = in->states; | out->states = in->states; | ||||
out->conn = in->conn; | out->conn = in->conn; | ||||
out->af = in->af; | out->af = in->af; | ||||
out->ruletype = in->ruletype; | out->ruletype = in->ruletype; | ||||
out->creation = secs - in->creation; | out->creation = secs - in->creation; | ||||
if (out->expire > secs) | if (out->expire > secs) | ||||
out->expire -= secs; | out->expire -= secs; | ||||
▲ Show 20 Lines • Show All 3,377 Lines • Show Last 20 Lines |