Lines Matching refs:obj
17 static struct socket_bind_bpf *socket_bind_bpf_free(struct socket_bind_bpf *obj) { in socket_bind_bpf_free() argument
19 (void) socket_bind_bpf__destroy(obj); in socket_bind_bpf_free()
57 _cleanup_(socket_bind_bpf_freep) struct socket_bind_bpf *obj = NULL; in prepare_socket_bind_bpf() local
77 obj = socket_bind_bpf__open(); in prepare_socket_bind_bpf()
78 if (!obj) in prepare_socket_bind_bpf()
81 if (sym_bpf_map__resize(obj->maps.sd_bind_allow, MAX(allow_count, 1u)) != 0) in prepare_socket_bind_bpf()
83 … "Failed to resize BPF map '%s': %m", sym_bpf_map__name(obj->maps.sd_bind_allow)); in prepare_socket_bind_bpf()
85 if (sym_bpf_map__resize(obj->maps.sd_bind_deny, MAX(deny_count, 1u)) != 0) in prepare_socket_bind_bpf()
87 … "Failed to resize BPF map '%s': %m", sym_bpf_map__name(obj->maps.sd_bind_deny)); in prepare_socket_bind_bpf()
89 if (socket_bind_bpf__load(obj) != 0) in prepare_socket_bind_bpf()
93 allow_map_fd = sym_bpf_map__fd(obj->maps.sd_bind_allow); in prepare_socket_bind_bpf()
100 sym_bpf_map__name(obj->maps.sd_bind_allow)); in prepare_socket_bind_bpf()
102 deny_map_fd = sym_bpf_map__fd(obj->maps.sd_bind_deny); in prepare_socket_bind_bpf()
109 sym_bpf_map__name(obj->maps.sd_bind_deny)); in prepare_socket_bind_bpf()
111 *ret_obj = TAKE_PTR(obj); in prepare_socket_bind_bpf()
116 _cleanup_(socket_bind_bpf_freep) struct socket_bind_bpf *obj = NULL; in bpf_socket_bind_supported() local
135 r = prepare_socket_bind_bpf(/*unit=*/NULL, /*allow_rules=*/NULL, /*deny_rules=*/NULL, &obj); in bpf_socket_bind_supported()
141 return bpf_can_link_program(obj->progs.sd_bind4); in bpf_socket_bind_supported()
164 _cleanup_(socket_bind_bpf_freep) struct socket_bind_bpf *obj = NULL; in socket_bind_install_impl() local
183 r = prepare_socket_bind_bpf(u, cc->socket_bind_allow, cc->socket_bind_deny, &obj); in socket_bind_install_impl()
191 ipv4 = sym_bpf_program__attach_cgroup(obj->progs.sd_bind4, cgroup_fd); in socket_bind_install_impl()
195 sym_bpf_program__name(obj->progs.sd_bind4)); in socket_bind_install_impl()
197 ipv6 = sym_bpf_program__attach_cgroup(obj->progs.sd_bind6, cgroup_fd); in socket_bind_install_impl()
201 sym_bpf_program__name(obj->progs.sd_bind6)); in socket_bind_install_impl()