/linux-master/tools/testing/selftests/bpf/prog_tests/ |
H A D | netns_cookie.c | 15 int server_fd = -1, client_fd = -1, cgroup_fd = -1; local 45 client_fd = connect_to_fd(server_fd, 0); 46 if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno)) 49 ret = send(client_fd, send_msg, sizeof(send_msg), 0); 54 &client_fd, &val); 58 err = getsockopt(client_fd, SOL_SOCKET, SO_NETNS_COOKIE, 66 &client_fd, &val); 75 if (client_fd != -1) 76 close(client_fd);
|
H A D | socket_cookie.c | 18 int server_fd = 0, client_fd = 0, cgroup_fd = 0, err = 0; local 52 client_fd = connect_to_fd(server_fd, 0); 53 if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno)) 57 &client_fd, &val); 61 err = getsockname(client_fd, (struct sockaddr *)&addr, &addr_len); 69 close(client_fd);
|
H A D | tcp_rtt.c | 46 static int verify_sk(int map_fd, int client_fd, const char *msg, __u32 invoked, argument 53 if (!ASSERT_GE(bpf_map_lookup_elem(map_fd, &client_fd, &val), 0, "read socket storage")) 93 int client_fd; local 111 client_fd = connect_to_fd(server_fd, 0); 112 if (client_fd < 0) { 117 err += verify_sk(map_fd, client_fd, "syn-ack", 124 send_byte(client_fd); 125 if (wait_for_ack(client_fd, 100) < 0) { 131 err += verify_sk(map_fd, client_fd, "first payload byte", 139 close(client_fd); [all...] |
H A D | sockopt_inherit.c | 72 int client_fd; local 88 client_fd = accept(fd, (struct sockaddr *)&addr, &len); 89 if (!ASSERT_GE(client_fd, 0, "accept client")) 92 err += verify_sockopt(client_fd, CUSTOM_INHERIT1, "accept", 1); 93 err += verify_sockopt(client_fd, CUSTOM_INHERIT2, "accept", 1); 94 err += verify_sockopt(client_fd, CUSTOM_LISTENER, "accept", 0); 96 close(client_fd); 141 int server_fd = -1, client_fd; local 176 client_fd = connect_to_server(server_fd); 177 if (!ASSERT_GE(client_fd, [all...] |
H A D | cgroup_tcp_skb.c | 63 static int talk_to_cgroup(int *client_fd, int *listen_fd, int *service_fd, argument 74 *client_fd = create_client_sock_v6(); 75 if (!ASSERT_GE(*client_fd, 0, "client_fd")) 89 err = connect_fd_to_fd(*client_fd, *listen_fd, 0); 98 cp = write(*client_fd, "hello", 5); 109 static int talk_to_outside(int *client_fd, int *listen_fd, int *service_fd, argument 127 *client_fd = create_client_sock_v6(); 128 if (!ASSERT_GE(*client_fd, 0, "client_fd")) 239 int client_fd = -1, listen_fd = -1; local [all...] |
H A D | mptcp.c | 85 static int verify_tsk(int map_fd, int client_fd) argument 87 int err, cfd = client_fd; 123 static int verify_msk(int map_fd, int client_fd, __u32 token) argument 126 int err, cfd = client_fd; 158 int client_fd, prog_fd, map_fd, err; local 175 client_fd = connect_to_fd(server_fd, 0); 176 if (!ASSERT_GE(client_fd, 0, "connect to fd")) { 181 err += is_mptcp ? verify_msk(map_fd, client_fd, sock_skel->bss->token) : 182 verify_tsk(map_fd, client_fd); 184 close(client_fd); 235 verify_mptcpify(int server_fd, int client_fd) argument 269 int server_fd, client_fd, err = 0; local [all...] |
H A D | load_bytes_relative.c | 12 int server_fd, cgroup_fd, prog_fd, map_fd, client_fd; local 52 client_fd = connect_to_fd(server_fd, 0); 53 if (CHECK_FAIL(client_fd < 0)) 55 close(client_fd);
|
H A D | cgroup_v1v2.c | 48 int server_fd, client_fd, cgroup_fd; local 55 client_fd = connect_to_fd_opts(server_fd, &opts); 56 if (!ASSERT_GE(client_fd, 0, "client_fd")) { 60 close(client_fd);
|
H A D | sk_lookup.c | 436 static int tcp_echo_test(int client_fd, int server_fd) argument 440 err = send_byte(client_fd); 446 err = recv_byte(client_fd); 453 static int udp_echo_test(int client_fd, int server_fd) argument 457 err = send_byte(client_fd); 463 err = recv_byte(client_fd); 601 int client_fd, reuse_conn_fd = -1; local 651 client_fd = make_client(t->sotype, t->connect_to.ip, t->connect_to.port); 652 if (client_fd < 0) 656 tcp_echo_test(client_fd, server_fd 868 int client_fd, server_fd, err; local 1150 int err, client_fd, connected_fd, server_fd; local 1221 int map_fd, server_fd, client_fd; local [all...] |
H A D | bpf_nf.c | 53 int srv_fd = -1, client_fd = -1, srv_client_fd = -1; local 80 client_fd = connect_to_server(srv_fd); 81 if (!ASSERT_GE(client_fd, 0, "connect_to_server")) 126 if (client_fd != -1) 127 close(client_fd);
|
H A D | cgrp_local_storage.c | 87 int server_fd = 0, client_fd = 0, err = 0; local 117 client_fd = connect_to_fd(server_fd, 0); 118 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) 126 err = getsockname(client_fd, (struct sockaddr *)&addr, &addr_len); 134 close(client_fd);
|
H A D | lsm_cgroup.c | 70 int listen_fd, client_fd, accepted_fd; local 222 client_fd = connect_to_fd(listen_fd, 0); 223 ASSERT_GE(client_fd, 0, "connect_to_fd"); 241 * client_fd 264 * client_fd 270 close(client_fd);
|
H A D | cg_storage_multi.c | 59 int server_fd = -1, client_fd = -1; local 70 client_fd = connect_to_fd(server_fd, 0); 71 if (client_fd < 0) 74 if (send(client_fd, &message, sizeof(message), 0) < 0) 83 close(client_fd);
|
H A D | tc_redirect.c | 394 int listen_fd = -1, accept_fd = -1, client_fd = -1; local 412 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); 413 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) 423 n = write(client_fd, buf, sizeof(buf)); 437 if (client_fd >= 0) 438 close(client_fd); 610 int opt = 1, accept_fd = -1, client_fd = -1, listen_fd, err; local 642 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); 645 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) 655 n = write(client_fd, bu [all...] |
/linux-master/tools/testing/selftests/net/ |
H A D | bind_timewait.c | 45 int server_fd, client_fd, child_fd, ret; local 61 client_fd = socket(AF_INET, SOCK_STREAM, 0); 62 ASSERT_GT(client_fd, 0); 64 ret = connect(client_fd, (struct sockaddr *)&self->addr, self->addrlen); 72 close(client_fd);
|
/linux-master/tools/testing/vsock/ |
H A D | util.c | 113 int client_fd, ret; local 115 client_fd = socket(AF_VSOCK, type, 0); 116 if (client_fd < 0) { 121 if (bind(client_fd, (struct sockaddr *)&sa_client, sizeof(sa_client))) { 128 ret = connect(client_fd, (struct sockaddr *)&sa_server, sizeof(sa_server)); 138 return client_fd; 237 int fd, client_fd, old_errno; local 245 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); 247 } while (client_fd < 0 && errno == EINTR); 254 if (client_fd < [all...] |
H A D | vsock_perf.c | 142 int client_fd; local 179 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); 181 if (client_fd < 0) 184 vsock_increase_buf_size(client_fd); 186 if (setsockopt(client_fd, SOL_SOCKET, SO_RCVLOWAT, 206 fds.fd = client_fd; 250 close(client_fd);
|
H A D | vsock_diag_test.c | 406 int client_fd; local 408 client_fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); 409 if (client_fd < 0) { 417 st = find_vsock_stat(&sockets, client_fd); 423 close(client_fd);
|
H A D | vsock_test.c | 1192 int listen_fd, client_fd, i; local 1203 client_fd = accept(listen_fd, (struct sockaddr *)&sa_client, 1206 } while (client_fd < 0 && errno == EINTR); 1209 if (client_fd < 0) { 1215 vsock_wait_remote_close(client_fd); 1223 int i, client_fd; local 1234 client_fd = vsock_bind_connect(opts->peer_cid, opts->peer_port, 1237 close(client_fd);
|
/linux-master/tools/testing/selftests/landlock/ |
H A D | net_test.c | 446 int inval_fd, bind_fd, client_fd, status, ret; local 547 client_fd = bind_fd; 550 client_fd = accept(bind_fd, NULL, 0); 551 ASSERT_LE(0, client_fd); 554 EXPECT_EQ(1, read(client_fd, &buf, 1)); 563 if (client_fd != bind_fd) 564 EXPECT_LE(0, close(client_fd)); 756 int bind_fd, client_fd, status; local 841 client_fd = bind_fd; 843 client_fd [all...] |
/linux-master/tools/testing/selftests/bpf/ |
H A D | network_helpers.c | 354 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) argument 359 if (settimeo(client_fd, timeout_ms)) 367 if (connect_fd_to_addr(client_fd, &addr, len, false))
|
H A D | network_helpers.h | 57 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
|
/linux-master/fs/notify/fanotify/ |
H A D | fanotify_user.c | 254 int client_fd; local 257 client_fd = get_unused_fd_flags(group->fanotify_data.f_flags); 258 if (client_fd < 0) 259 return client_fd; 276 put_unused_fd(client_fd); 277 client_fd = PTR_ERR(new_file); 282 return client_fd;
|