Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/pf/pf_ioctl.c
Show First 20 Lines • Show All 5,781 Lines • ▼ Show 20 Lines | pf_state_export(struct pf_state_export *sp, struct pf_kstate *st) | ||||
if (sp->expire <= time_uptime) | if (sp->expire <= time_uptime) | ||||
sp->expire = htonl(0); | sp->expire = htonl(0); | ||||
else | else | ||||
sp->expire = htonl(sp->expire - time_uptime); | sp->expire = htonl(sp->expire - time_uptime); | ||||
sp->direction = st->direction; | sp->direction = st->direction; | ||||
sp->log = st->log; | sp->log = st->log; | ||||
sp->timeout = st->timeout; | sp->timeout = st->timeout; | ||||
/* 8 bits for old peers, 16 bits for new peers */ | /* 8 bits for the old libpfctl, 16 bits for the new libpfctl */ | ||||
sp->state_flags_compat = st->state_flags; | sp->state_flags_compat = st->state_flags; | ||||
sp->state_flags = st->state_flags; | sp->state_flags = htons(st->state_flags); | ||||
if (st->src_node) | if (st->src_node) | ||||
sp->sync_flags |= PFSYNC_FLAG_SRCNODE; | sp->sync_flags |= PFSYNC_FLAG_SRCNODE; | ||||
if (st->nat_src_node) | if (st->nat_src_node) | ||||
sp->sync_flags |= PFSYNC_FLAG_NATSRCNODE; | sp->sync_flags |= PFSYNC_FLAG_NATSRCNODE; | ||||
sp->id = st->id; | sp->id = st->id; | ||||
sp->creatorid = st->creatorid; | sp->creatorid = st->creatorid; | ||||
pf_state_peer_hton(&st->src, &sp->src); | pf_state_peer_hton(&st->src, &sp->src); | ||||
Show All 11 Lines | if (st->nat_rule.ptr == NULL) | ||||
sp->nat_rule = htonl(-1); | sp->nat_rule = htonl(-1); | ||||
else | else | ||||
sp->nat_rule = htonl(st->nat_rule.ptr->nr); | sp->nat_rule = htonl(st->nat_rule.ptr->nr); | ||||
sp->packets[0] = st->packets[0]; | sp->packets[0] = st->packets[0]; | ||||
sp->packets[1] = st->packets[1]; | sp->packets[1] = st->packets[1]; | ||||
sp->bytes[0] = st->bytes[0]; | sp->bytes[0] = st->bytes[0]; | ||||
sp->bytes[1] = st->bytes[1]; | sp->bytes[1] = st->bytes[1]; | ||||
sp->qid = htons(st->qid); | |||||
sp->pqid = htons(st->pqid); | |||||
sp->dnpipe = htons(st->dnpipe); | |||||
sp->dnrpipe = htons(st->dnrpipe); | |||||
sp->rtableid = htonl(st->rtableid); | |||||
sp->min_ttl = st->min_ttl; | |||||
sp->set_tos = st->set_tos; | |||||
sp->max_mss = htons(st->max_mss); | |||||
sp->rt = st->rt; | |||||
kp: Does this rely on another patch? It seems to be unhappy when I try to build it on main:
```… | |||||
vegeta_tuxpowered.netAuthorUnsubmitted Done Inline ActionsYes, this needs D39392 merged first. vegeta_tuxpowered.net: Yes, this needs D39392 merged first. | |||||
if (st->rt_kif) | |||||
strlcpy(sp->rt_ifname, st->rt_kif->pfik_name, | |||||
sizeof(sp->rt_ifname)); | |||||
sp->set_prio[0] = st->set_prio[0]; | |||||
sp->set_prio[1] = st->set_prio[1]; | |||||
} | } | ||||
static void | static void | ||||
pf_tbladdr_copyout(struct pf_addr_wrap *aw) | pf_tbladdr_copyout(struct pf_addr_wrap *aw) | ||||
{ | { | ||||
struct pfr_ktable *kt; | struct pfr_ktable *kt; | ||||
KASSERT(aw->type == PF_ADDR_TABLE, ("%s: type %u", __func__, aw->type)); | KASSERT(aw->type == PF_ADDR_TABLE, ("%s: type %u", __func__, aw->type)); | ||||
▲ Show 20 Lines • Show All 1,095 Lines • Show Last 20 Lines |
Does this rely on another patch? It seems to be unhappy when I try to build it on main: