| 1118 | } |
| 1119 | |
| 1120 | int |
| 1121 | pfr_clr_tables(struct pfr_table *filter, int *ndel, int flags) |
| 1122 | { |
| 1123 | struct pfr_ktableworkq workq; |
| 1124 | struct pfr_ktable *p; |
| 1125 | int xdel = 0; |
| 1126 | |
| 1127 | ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY | PFR_FLAG_ALLRSETS); |
| 1128 | if (pfr_fix_anchor(filter->pfrt_anchor)) |
| 1129 | return (EINVAL); |
| 1130 | if (pfr_table_count(filter, flags) < 0) |
| 1131 | return (ENOENT); |
| 1132 | |
| 1133 | SLIST_INIT(&workq); |
| 1134 | RB_FOREACH(p, pfr_ktablehead, &V_pfr_ktables) { |
| 1135 | if (pfr_skip_table(filter, p, flags)) |
| 1136 | continue; |
| 1137 | if (!strcmp(p->pfrkt_anchor, PF_RESERVED_ANCHOR)) |
| 1138 | continue; |
| 1139 | if (!(p->pfrkt_flags & PFR_TFLAG_ACTIVE)) |
| 1140 | continue; |
| 1141 | p->pfrkt_nflags = p->pfrkt_flags & ~PFR_TFLAG_ACTIVE; |
| 1142 | SLIST_INSERT_HEAD(&workq, p, pfrkt_workq); |
| 1143 | xdel++; |
| 1144 | } |
| 1145 | if (!(flags & PFR_FLAG_DUMMY)) |
| 1146 | pfr_setflags_ktables(&workq); |
| 1147 | if (ndel != NULL) |
| 1148 | *ndel = xdel; |
| 1149 | return (0); |
| 1150 | } |
| 1151 | |
| 1152 | int |
| 1153 | pfr_add_tables(struct pfr_table *tbl, int size, int *nadd, int flags) |
no test coverage detected