summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/network_helpers.h
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-10-11 21:51:11 +0300
committerMartin KaFai Lau <martin.lau@kernel.org>2023-10-12 03:27:55 +0300
commit82ab6b505e8199cc4537f00025a7391973c3847e (patch)
tree6d8e18abf80ef20cdea6a941fc05c032b19190a9 /tools/testing/selftests/bpf/network_helpers.h
parentaf2752ed450e71fc0bd596d0b4b9b805a64ae2c1 (diff)
downloadlinux-82ab6b505e8199cc4537f00025a7391973c3847e.tar.xz
selftests/bpf: Add tests for cgroup unix socket address hooks
These selftests are written in prog_tests style instead of adding them to the existing test_sock_addr tests. Migrating the existing sock addr tests to prog_tests style is left for future work. This commit adds support for testing bind() sockaddr hooks, even though there's no unix socket sockaddr hook for bind(). We leave this code intact for when the INET and INET6 tests are migrated in the future which do support intercepting bind(). Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com> Link: https://lore.kernel.org/r/20231011185113.140426-10-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/network_helpers.h')
-rw-r--r--tools/testing/selftests/bpf/network_helpers.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/network_helpers.h b/tools/testing/selftests/bpf/network_helpers.h
index 5eccc67d1a99..34f1200a781b 100644
--- a/tools/testing/selftests/bpf/network_helpers.h
+++ b/tools/testing/selftests/bpf/network_helpers.h
@@ -51,6 +51,7 @@ int *start_reuseport_server(int family, int type, const char *addr_str,
__u16 port, int timeout_ms,
unsigned int nr_listens);
void free_fds(int *fds, unsigned int nr_close_fds);
+int connect_to_addr(const struct sockaddr_storage *addr, socklen_t len, int type);
int connect_to_fd(int server_fd, int timeout_ms);
int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts);
int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);