• Home
  • Raw
  • Download

Lines Matching refs:f

216 static void bpf_disasm(const struct sock_filter f, unsigned int i)  in bpf_disasm()  argument
219 int val = f.k; in bpf_disasm()
222 switch (f.code) { in bpf_disasm()
302 val = i + 1 + f.k; in bpf_disasm()
423 val = f.code; in bpf_disasm()
431 if ((BPF_CLASS(f.code) == BPF_JMP && BPF_OP(f.code) != BPF_JA)) in bpf_disasm()
433 i + 1 + f.jt, i + 1 + f.jf); in bpf_disasm()
438 static void bpf_dump_curr(struct bpf_regs *r, struct sock_filter *f) in bpf_dump_curr() argument
444 f->code, f->jt, f->jf, f->k); in bpf_dump_curr()
446 bpf_disasm(*f, r->Pc); in bpf_dump_curr()
448 if (f->jt || f->jf) { in bpf_dump_curr()
450 bpf_disasm(*(f + f->jt + 1), r->Pc + f->jt + 1); in bpf_dump_curr()
452 bpf_disasm(*(f + f->jf + 1), r->Pc + f->jf + 1); in bpf_dump_curr()
480 static void bpf_disasm_all(const struct sock_filter *f, unsigned int len) in bpf_disasm_all() argument
485 bpf_disasm(f[i], i); in bpf_disasm_all()
488 static void bpf_dump_all(const struct sock_filter *f, unsigned int len) in bpf_dump_all() argument
495 f[i].code, f[i].jt, f[i].jf, f[i].k); in bpf_dump_all()
498 static bool bpf_runnable(struct sock_filter *f, unsigned int len) in bpf_runnable() argument
502 .filter = f, in bpf_runnable()
518 if (BPF_CLASS(f[i].code) == BPF_LD && in bpf_runnable()
519 f[i].k > SKF_AD_OFF) { in bpf_runnable()
632 static void bpf_single_step(struct bpf_regs *r, struct sock_filter *f, in bpf_single_step() argument
636 uint32_t K = f->k; in bpf_single_step()
639 switch (f->code) { in bpf_single_step()
734 r->Pc += r->A > r->X ? f->jt : f->jf; in bpf_single_step()
737 r->Pc += r->A > K ? f->jt : f->jf; in bpf_single_step()
740 r->Pc += r->A >= r->X ? f->jt : f->jf; in bpf_single_step()
743 r->Pc += r->A >= K ? f->jt : f->jf; in bpf_single_step()
746 r->Pc += r->A == r->X ? f->jt : f->jf; in bpf_single_step()
749 r->Pc += r->A == K ? f->jt : f->jf; in bpf_single_step()
752 r->Pc += r->A & r->X ? f->jt : f->jf; in bpf_single_step()
755 r->Pc += r->A & K ? f->jt : f->jf; in bpf_single_step()
804 switch (f->code) { in bpf_single_step()
854 static bool bpf_handle_breakpoint(struct bpf_regs *r, struct sock_filter *f, in bpf_handle_breakpoint() argument
859 bpf_dump_curr(r, &f[r->Pc]); in bpf_handle_breakpoint()
866 static int bpf_run_all(struct sock_filter *f, uint16_t bpf_len, uint8_t *pkt, in bpf_run_all() argument
875 stop = bpf_handle_breakpoint(&bpf_curr, f, pkt, in bpf_run_all()
878 bpf_single_step(&bpf_curr, &f[bpf_curr.Pc], pkt, pkt_caplen, in bpf_run_all()
886 static int bpf_run_stepping(struct sock_filter *f, uint16_t bpf_len, in bpf_run_stepping() argument
897 stop = bpf_handle_breakpoint(&bpf_curr, f, pkt, in bpf_run_stepping()
900 bpf_single_step(&bpf_curr, &f[bpf_curr.Pc], pkt, pkt_caplen, in bpf_run_stepping()