| 1427 | } |
| 1428 | |
| 1429 | int |
| 1430 | pfr_ina_begin(struct pfr_table *trs, u_int32_t *ticket, int *ndel, int flags) |
| 1431 | { |
| 1432 | struct pfr_ktableworkq workq; |
| 1433 | struct pfr_ktable *p; |
| 1434 | struct pf_kruleset *rs; |
| 1435 | int xdel = 0; |
| 1436 | |
| 1437 | ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY); |
| 1438 | rs = pf_find_or_create_kruleset(trs->pfrt_anchor); |
| 1439 | if (rs == NULL) |
| 1440 | return (ENOMEM); |
| 1441 | SLIST_INIT(&workq); |
| 1442 | RB_FOREACH(p, pfr_ktablehead, &V_pfr_ktables) { |
| 1443 | if (!(p->pfrkt_flags & PFR_TFLAG_INACTIVE) || |
| 1444 | pfr_skip_table(trs, p, 0)) |
| 1445 | continue; |
| 1446 | p->pfrkt_nflags = p->pfrkt_flags & ~PFR_TFLAG_INACTIVE; |
| 1447 | SLIST_INSERT_HEAD(&workq, p, pfrkt_workq); |
| 1448 | xdel++; |
| 1449 | } |
| 1450 | if (!(flags & PFR_FLAG_DUMMY)) { |
| 1451 | pfr_setflags_ktables(&workq); |
| 1452 | if (ticket != NULL) |
| 1453 | *ticket = ++rs->tticket; |
| 1454 | rs->topen = 1; |
| 1455 | } else |
| 1456 | pf_remove_if_empty_kruleset(rs); |
| 1457 | if (ndel != NULL) |
| 1458 | *ndel = xdel; |
| 1459 | return (0); |
| 1460 | } |
| 1461 | |
| 1462 | int |
| 1463 | pfr_ina_define(struct pfr_table *tbl, struct pfr_addr *addr, int size, |
no test coverage detected