MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pf_step_into_anchor

Function pf_step_into_anchor

freebsd/netpfil/pf/pf.c:2948–2982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2946} while (0)
2947
2948void
2949pf_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
2984int
2985pf_step_out_of_anchor(struct pf_kanchor_stackframe *stack, int *depth,

Callers 3

pf_match_translationFunction · 0.85
pf_test_ruleFunction · 0.85
pf_test_fragmentFunction · 0.85

Calls 1

printfFunction · 0.50

Tested by

no test coverage detected