Lines Matching refs:rw
1094 struct opcode_obj_rewrite *rw; in move_objects() local
1113 rw = find_op_rw(cmd, &kidx, NULL); in move_objects()
1114 if (rw == NULL || rw->manage_sets == NULL) in move_objects()
1122 if (rw->manage_sets(ch, kidx, 1, COUNT_ONE) != 0) in move_objects()
1140 rw = find_op_rw(cmd, &kidx, NULL); in move_objects()
1141 if (rw == NULL || rw->manage_sets == NULL) in move_objects()
1144 c = rw->manage_sets(ch, kidx, in move_objects()
1159 rw = find_op_rw(cmd, &kidx, NULL); in move_objects()
1160 if (rw == NULL || rw->manage_sets == NULL) in move_objects()
1163 rw->manage_sets(ch, kidx, in move_objects()
1168 rw->manage_sets(ch, kidx, in move_objects()
1426 struct opcode_obj_rewrite *rw; in swap_sets() local
1440 for (rw = ctl3_rewriters; in swap_sets()
1441 rw < ctl3_rewriters + ctl3_rsize; rw++) { in swap_sets()
1442 if (rw->manage_sets == NULL) in swap_sets()
1444 i = rw->manage_sets(chain, (uint8_t)rt->set, in swap_sets()
1458 for (rw = ctl3_rewriters; rw < ctl3_rewriters + ctl3_rsize; rw++) { in swap_sets()
1459 if (rw->manage_sets == NULL) in swap_sets()
1461 rw->manage_sets(chain, (uint8_t)rt->set, in swap_sets()
2384 struct opcode_obj_rewrite *rw; in mark_rule_objects() local
2396 rw = find_op_rw(cmd, &kidx, &subtype); in mark_rule_objects()
2397 if (rw == NULL) in mark_rule_objects()
2400 if (ipfw_mark_object_kidx(da->bmask, rw->etlv, kidx)) in mark_rule_objects()
2555 struct opcode_obj_rewrite *rw; in create_objects_compat() local
2572 rw = find_op_rw(cmd + p->off, NULL, NULL); in create_objects_compat()
2573 KASSERT(rw != NULL, ("Unable to find handler for op %d", in create_objects_compat()
2576 if (rw->create_object == NULL) in create_objects_compat()
2579 error = rw->create_object(ch, ti, &kidx); in create_objects_compat()
2610 struct opcode_obj_rewrite *rw; in set_legacy_obj_kidx() local
2628 rw = find_op_rw(cmd, &kidx, &subtype); in set_legacy_obj_kidx()
2629 if (rw == NULL) in set_legacy_obj_kidx()
2633 no = rw->find_bykidx(ch, kidx); in set_legacy_obj_kidx()
2650 rw->update(cmd, uidx); in set_legacy_obj_kidx()
2666 struct opcode_obj_rewrite *rw; in unref_oib_objects() local
2676 rw = find_op_rw(cmd + p->off, NULL, NULL); in unref_oib_objects()
2677 KASSERT(rw != NULL, ("Unable to find handler for op %d", in unref_oib_objects()
2681 no = rw->find_bykidx(ch, p->kidx); in unref_oib_objects()
2694 struct opcode_obj_rewrite *rw; in unref_rule_objects() local
2709 rw = find_op_rw(cmd, &kidx, &subtype); in unref_rule_objects()
2710 if (rw == NULL) in unref_rule_objects()
2712 no = rw->find_bykidx(ch, kidx); in unref_rule_objects()
2721 if (no->refcnt == 1 && rw->destroy_object != NULL) in unref_rule_objects()
2722 rw->destroy_object(ch, no); in unref_rule_objects()
2741 struct opcode_obj_rewrite *rw; in ref_opcode_object() local
2745 rw = find_op_rw(cmd, &ti->uidx, &ti->type); in ref_opcode_object()
2746 if (rw == NULL) in ref_opcode_object()
2754 error = rw->find_byname(ch, ti, &no); in ref_opcode_object()
2775 rw->update(cmd, no->kidx); in ref_opcode_object()
3179 struct opcode_obj_rewrite *ctl3_max, *lo, *hi, h, *rw; in find_op_rw_range() local
3184 rw = (struct opcode_obj_rewrite *)bsearch(&h, ctl3_rewriters, in find_op_rw_range()
3186 if (rw == NULL) in find_op_rw_range()
3190 lo = rw; in find_op_rw_range()
3195 hi = rw; in find_op_rw_range()
3214 struct opcode_obj_rewrite *rw, *lo, *hi; in find_op_rw() local
3221 for (rw = lo; rw <= hi; rw++) { in find_op_rw()
3222 if (rw->classifier(cmd, &uidx, &subtype) == 0) { in find_op_rw()
3227 return (rw); in find_op_rw()
3245 struct opcode_obj_rewrite *rw; in update_opcode_kidx() local
3247 rw = find_op_rw(cmd, NULL, NULL); in update_opcode_kidx()
3248 KASSERT(rw != NULL, ("No handler to update opcode %d", cmd->opcode)); in update_opcode_kidx()
3249 rw->update(cmd, idx); in update_opcode_kidx()
3275 ipfw_add_obj_rewriter(struct opcode_obj_rewrite *rw, size_t count) in ipfw_add_obj_rewriter() argument
3285 tmp = malloc(sizeof(*rw) * sz, M_IPFW, M_WAITOK | M_ZERO); in ipfw_add_obj_rewriter()
3296 memcpy(tmp, ctl3_rewriters, ctl3_rsize * sizeof(*rw)); in ipfw_add_obj_rewriter()
3297 memcpy(&tmp[ctl3_rsize], rw, count * sizeof(*rw)); in ipfw_add_obj_rewriter()
3298 qsort(tmp, sz, sizeof(*rw), compare_opcodes); in ipfw_add_obj_rewriter()
3312 ipfw_del_obj_rewriter(struct opcode_obj_rewrite *rw, size_t count) in ipfw_del_obj_rewriter() argument
3321 if (find_op_rw_range(rw[i].opcode, &lo, &hi) != 0) in ipfw_del_obj_rewriter()
3325 if (ktmp->classifier != rw[i].classifier) in ipfw_del_obj_rewriter()