Lines Matching refs:allow_prog

74 	int drop_prog, allow_prog, foo = 0, bar = 0, rc = 0;  in test_foo_bar()  local
76 allow_prog = prog_load(1); in test_foo_bar()
77 if (!allow_prog) in test_foo_bar()
115 if (bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, in test_foo_bar()
133 if (bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, in test_foo_bar()
148 if (bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, in test_foo_bar()
154 if (!bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, 0)) { in test_foo_bar()
171 if (bpf_prog_attach(allow_prog, foo, BPF_CGROUP_INET_EGRESS, 0)) { in test_foo_bar()
176 if (!bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, 0)) { in test_foo_bar()
182 if (!bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, in test_foo_bar()
189 if (!bpf_prog_attach(allow_prog, foo, BPF_CGROUP_INET_EGRESS, in test_foo_bar()
293 int drop_prog, allow_prog[6] = {}, rc = 0; in test_multiprog() local
298 allow_prog[i] = prog_load_cnt(1, 1 << i); in test_multiprog()
299 if (!allow_prog[i]) in test_multiprog()
328 if (bpf_prog_attach(allow_prog[0], cg1, BPF_CGROUP_INET_EGRESS, in test_multiprog()
333 if (!bpf_prog_attach(allow_prog[0], cg1, BPF_CGROUP_INET_EGRESS, in test_multiprog()
338 if (bpf_prog_attach(allow_prog[1], cg1, BPF_CGROUP_INET_EGRESS, in test_multiprog()
343 if (bpf_prog_attach(allow_prog[2], cg2, BPF_CGROUP_INET_EGRESS, in test_multiprog()
348 if (bpf_prog_attach(allow_prog[3], cg3, BPF_CGROUP_INET_EGRESS, in test_multiprog()
353 if (bpf_prog_attach(allow_prog[4], cg4, BPF_CGROUP_INET_EGRESS, in test_multiprog()
358 if (bpf_prog_attach(allow_prog[5], cg5, BPF_CGROUP_INET_EGRESS, 0)) { in test_multiprog()
409 if (bpf_prog_detach2(allow_prog[3], cg3, BPF_CGROUP_INET_EGRESS)) { in test_multiprog()
444 if (allow_prog[i] > 0) in test_multiprog()
445 close(allow_prog[i]); in test_multiprog()
462 int allow_prog[2] = {0}; in test_autodetach() local
468 for (i = 0; i < ARRAY_SIZE(allow_prog); i++) { in test_autodetach()
469 allow_prog[i] = prog_load_cnt(1, 1 << i); in test_autodetach()
470 if (!allow_prog[i]) in test_autodetach()
485 for (i = 0; i < ARRAY_SIZE(allow_prog); i++) { in test_autodetach()
486 if (bpf_prog_attach(allow_prog[i], cg, BPF_CGROUP_INET_EGRESS, in test_autodetach()
504 for (i = 0; i < ARRAY_SIZE(allow_prog); i++) { in test_autodetach()
505 close(allow_prog[i]); in test_autodetach()
506 allow_prog[i] = 0; in test_autodetach()
537 for (i = 0; i < ARRAY_SIZE(allow_prog); i++) in test_autodetach()
538 if (allow_prog[i] > 0) in test_autodetach()
539 close(allow_prog[i]); in test_autodetach()