| 2946 | } while (0) |
| 2947 | |
| 2948 | void |
| 2949 | pf_step_into_anchor(struct pf_kanchor_stackframe *stack, int *depth, |
| 2950 | struct pf_kruleset **rs, int n, struct pf_krule **r, struct pf_krule **a, |
| 2951 | int *match) |
| 2952 | { |
| 2953 | struct pf_kanchor_stackframe *f; |
| 2954 | |
| 2955 | PF_RULES_RASSERT(); |
| 2956 | |
| 2957 | if (match) |
| 2958 | *match = 0; |
| 2959 | if (*depth >= PF_ANCHOR_STACKSIZE) { |
| 2960 | printf("%s: anchor stack overflow on %s\n", |
| 2961 | __func__, (*r)->anchor->name); |
| 2962 | *r = TAILQ_NEXT(*r, entries); |
| 2963 | return; |
| 2964 | } else if (*depth == 0 && a != NULL) |
| 2965 | *a = *r; |
| 2966 | f = stack + (*depth)++; |
| 2967 | f->rs = *rs; |
| 2968 | f->r = *r; |
| 2969 | if ((*r)->anchor_wildcard) { |
| 2970 | struct pf_kanchor_node *parent = &(*r)->anchor->children; |
| 2971 | |
| 2972 | if ((f->child = RB_MIN(pf_kanchor_node, parent)) == NULL) { |
| 2973 | *r = NULL; |
| 2974 | return; |
| 2975 | } |
| 2976 | *rs = &f->child->ruleset; |
| 2977 | } else { |
| 2978 | f->child = NULL; |
| 2979 | *rs = &(*r)->anchor->ruleset; |
| 2980 | } |
| 2981 | *r = TAILQ_FIRST((*rs)->rules[n].active.ptr); |
| 2982 | } |
| 2983 | |
| 2984 | int |
| 2985 | pf_step_out_of_anchor(struct pf_kanchor_stackframe *stack, int *depth, |
no test coverage detected