/linux-master/tools/testing/selftests/bpf/prog_tests/ |
H A D | cgroup_tcp_skb.c | 63 static int talk_to_cgroup(int *client_fd, int *listen_fd, int *service_fd, argument 80 *listen_fd = start_server(AF_INET6, SOCK_STREAM, NULL, 0, 0); 81 if (!ASSERT_GE(*listen_fd, 0, "listen_fd")) 83 port = get_socket_local_port(*listen_fd); 89 err = connect_fd_to_fd(*client_fd, *listen_fd, 0); 92 *service_fd = accept(*listen_fd, NULL, NULL); 109 static int talk_to_outside(int *client_fd, int *listen_fd, int *service_fd, argument 121 *listen_fd = start_server(AF_INET6, SOCK_STREAM, NULL, 0, 0); 122 if (!ASSERT_GE(*listen_fd, 155 close_connection(int *closing_fd, int *peer_fd, int *listen_fd, struct cgroup_tcp_skb *skel) argument 239 int client_fd = -1, listen_fd = -1; local [all...] |
H A D | sk_storage_tracing.c | 50 int listen_fd = -1, passive_fd = -1, active_fd = -1, value = 1, err; local 53 listen_fd = start_server(AF_INET6, SOCK_STREAM, LO_ADDR6, 0, 0); 54 if (CHECK(listen_fd == -1, "start_server", 55 "listen_fd:%d errno:%d\n", listen_fd, errno)) 58 active_fd = connect_to_fd(listen_fd, 0); 68 passive_fd = accept(listen_fd, NULL, 0); 88 err = check_sk_stg(listen_fd, BPF_TCP_LISTEN); 89 if (!ASSERT_OK(err, "listen_fd sk_stg")) 104 if (listen_fd ! [all...] |
H A D | bpf_iter_setsockopt.c | 51 static int *make_established(int listen_fd, unsigned int nr_est, argument 68 est_fds[i] = connect_to_fd(listen_fd, 0); 76 accepted_fds[i] = accept(listen_fd, NULL, 0); 109 int err, iter_fd = -1, listen_fd = -1; local 112 /* Prepare non-reuseport listen_fd */ 113 listen_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); 114 if (!ASSERT_GE(listen_fd, 0, "start_server")) 116 if (!ASSERT_EQ(set_bpf_cubic(&listen_fd, 1), 1, 117 "set listen_fd to cubic")) 119 iter_skel->bss->listen_hport = get_local_port(listen_fd); [all...] |
H A D | btf_skc_cls_ingress.c | 76 int listen_fd = -1, cli_fd = -1, srv_fd = -1, err; local 83 listen_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); 84 if (CHECK_FAIL(listen_fd == -1)) 87 err = getsockname(listen_fd, (struct sockaddr *)&srv_sa6, &addrlen); 88 if (CHECK(err, "getsockname(listen_fd)", "err:%d errno:%d\n", err, 94 cli_fd = connect_to_fd(listen_fd, 0); 98 srv_fd = accept(listen_fd, NULL, NULL); 120 if (listen_fd != -1) 121 close(listen_fd); 130 int listen_fd local [all...] |
H A D | tcpbpf_user.c | 49 int listen_fd = -1, cli_fd = -1, accept_fd = -1; local 54 listen_fd = start_server(AF_INET6, SOCK_STREAM, LO_ADDR6, 0, 0); 55 if (!ASSERT_NEQ(listen_fd, -1, "start_server")) 58 cli_fd = connect_to_fd(listen_fd, 0); 59 if (!ASSERT_NEQ(cli_fd, -1, "connect_to_fd(listen_fd)")) 62 accept_fd = accept(listen_fd, NULL, NULL); 63 if (!ASSERT_NEQ(accept_fd, -1, "accept(listen_fd)")) 107 if (listen_fd != -1) 108 close(listen_fd);
|
H A D | lsm_cgroup.c | 70 int listen_fd, client_fd, accepted_fd; local 220 listen_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0); 221 ASSERT_GE(listen_fd, 0, "start_server"); 222 client_fd = connect_to_fd(listen_fd, 0); 224 accepted_fd = accept(listen_fd, NULL, NULL); 240 * listen_fd 263 * listen_fd 269 close(listen_fd);
|
H A D | sock_fields.c | 276 int listen_fd = -1, cli_fd = -1, accept_fd = -1, err, i; local 280 /* Prepare listen_fd */ 281 listen_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0xcafe, 0); 283 if (CHECK_FAIL(listen_fd == -1)) 286 err = getsockname(listen_fd, (struct sockaddr *)&srv_sa6, &addrlen); 287 if (CHECK(err, "getsockname(listen_fd)", "err:%d errno:%d\n", err, 292 cli_fd = connect_to_fd(listen_fd, 0); 301 accept_fd = accept(listen_fd, NULL, NULL); 302 if (CHECK(accept_fd == -1, "accept(listen_fd)", 343 if (listen_fd ! [all...] |
H A D | tc_redirect.c | 394 int listen_fd = -1, accept_fd = -1, client_fd = -1; local 403 listen_fd = start_server(family, SOCK_STREAM, addr, port, 0); 404 if (!ASSERT_GE(listen_fd, 0, "listen")) 412 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); 416 accept_fd = accept(listen_fd, NULL, NULL); 433 if (listen_fd >= 0) 434 close(listen_fd); 610 int opt = 1, accept_fd = -1, client_fd = -1, listen_fd, err; local 617 listen_fd = start_server(family, type, addr, port, 0); 620 if (!ASSERT_GE(listen_fd, [all...] |
/linux-master/tools/testing/vsock/ |
H A D | vsock_test.c | 1192 int listen_fd, client_fd, i; local 1196 listen_fd = vsock_stream_listen(VMADDR_CID_ANY, opts->peer_port); 1203 client_fd = accept(listen_fd, (struct sockaddr *)&sa_client, 1218 close(listen_fd);
|