• Home
  • Raw
  • Download

Lines Matching full:foo

36 #define FOO		"/foo"  macro
37 #define BAR "/foo/bar/"
65 int drop_prog, allow_prog, foo = 0, bar = 0, rc = 0; in test_foo_bar() local
78 /* Create cgroup /foo, get fd, and join it */ in test_foo_bar()
79 foo = create_and_get_cgroup(FOO); in test_foo_bar()
80 if (!foo) in test_foo_bar()
83 if (join_cgroup(FOO)) in test_foo_bar()
86 if (bpf_prog_attach(drop_prog, foo, BPF_CGROUP_INET_EGRESS, in test_foo_bar()
88 log_err("Attaching prog to /foo"); in test_foo_bar()
92 printf("Attached DROP prog. This ping in cgroup /foo should fail...\n"); in test_foo_bar()
95 /* Create cgroup /foo/bar, get fd, and join it */ in test_foo_bar()
103 printf("Attached DROP prog. This ping in cgroup /foo/bar should fail...\n"); in test_foo_bar()
108 log_err("Attaching prog to /foo/bar"); in test_foo_bar()
112 printf("Attached PASS prog. This ping in cgroup /foo/bar should pass...\n"); in test_foo_bar()
116 log_err("Detaching program from /foo/bar"); in test_foo_bar()
120 printf("Detached PASS from /foo/bar while DROP is attached to /foo.\n" in test_foo_bar()
121 "This ping in cgroup /foo/bar should fail...\n"); in test_foo_bar()
126 log_err("Attaching prog to /foo/bar"); in test_foo_bar()
130 if (bpf_prog_detach(foo, BPF_CGROUP_INET_EGRESS)) { in test_foo_bar()
131 log_err("Detaching program from /foo"); in test_foo_bar()
135 printf("Attached PASS from /foo/bar and detached DROP from /foo.\n" in test_foo_bar()
136 "This ping in cgroup /foo/bar should pass...\n"); in test_foo_bar()
141 log_err("Attaching prog to /foo/bar"); in test_foo_bar()
147 log_err("Unexpected success attaching prog to /foo/bar"); in test_foo_bar()
152 log_err("Detaching program from /foo/bar"); in test_foo_bar()
156 if (!bpf_prog_detach(foo, BPF_CGROUP_INET_EGRESS)) { in test_foo_bar()
158 log_err("Unexpected success in double detach from /foo"); in test_foo_bar()
162 if (bpf_prog_attach(allow_prog, foo, BPF_CGROUP_INET_EGRESS, 0)) { in test_foo_bar()
163 log_err("Attaching non-overridable prog to /foo"); in test_foo_bar()
169 log_err("Unexpected success attaching non-overridable prog to /foo/bar"); in test_foo_bar()
176 log_err("Unexpected success attaching overridable prog to /foo/bar"); in test_foo_bar()
180 if (!bpf_prog_attach(allow_prog, foo, BPF_CGROUP_INET_EGRESS, in test_foo_bar()
183 log_err("Unexpected success attaching overridable prog to /foo"); in test_foo_bar()
187 if (bpf_prog_attach(drop_prog, foo, BPF_CGROUP_INET_EGRESS, 0)) { in test_foo_bar()
188 log_err("Attaching different non-overridable prog to /foo"); in test_foo_bar()
198 close(foo); in test_foo_bar()