Home
last modified time | relevance | path

Searched refs:client_fd (Results 1 – 24 of 24) sorted by relevance

/openbmc/linux/tools/testing/selftests/bpf/prog_tests/
H A Dcgroup_tcp_skb.c74 *client_fd = create_client_sock_v6(); in talk_to_cgroup()
75 if (!ASSERT_GE(*client_fd, 0, "client_fd")) in talk_to_cgroup()
89 err = connect_fd_to_fd(*client_fd, *listen_fd, 0); in talk_to_cgroup()
98 cp = write(*client_fd, "hello", 5); in talk_to_cgroup()
127 *client_fd = create_client_sock_v6(); in talk_to_outside()
128 if (!ASSERT_GE(*client_fd, 0, "client_fd")) in talk_to_outside()
139 err = connect_fd_to_fd(*client_fd, *listen_fd, 0); in talk_to_outside()
145 cp = write(*client_fd, "hello", 5); in talk_to_outside()
239 int client_fd = -1, listen_fd = -1; in test_cgroup_tcp_skb() local
265 err = talk_to_cgroup(&client_fd, &listen_fd, &service_fd, skel); in test_cgroup_tcp_skb()
[all …]
H A Dmptcp.c87 int err, cfd = client_fd; in verify_tsk()
126 int err, cfd = client_fd; in verify_msk()
158 int client_fd, prog_fd, map_fd, err; in run_test() local
175 client_fd = connect_to_fd(server_fd, 0); in run_test()
182 verify_tsk(map_fd, client_fd); in run_test()
184 close(client_fd); in run_test()
269 int server_fd, client_fd, err = 0; in run_mptcpify() local
287 client_fd = connect_to_fd(server_fd, 0); in run_mptcpify()
293 send_byte(client_fd); in run_mptcpify()
295 err = verify_mptcpify(server_fd, client_fd); in run_mptcpify()
[all …]
H A Dsockopt_inherit.c72 int client_fd; in server_thread() local
88 client_fd = accept(fd, (struct sockaddr *)&addr, &len); in server_thread()
89 if (!ASSERT_GE(client_fd, 0, "accept client")) in server_thread()
92 err += verify_sockopt(client_fd, CUSTOM_INHERIT1, "accept", 1); in server_thread()
93 err += verify_sockopt(client_fd, CUSTOM_INHERIT2, "accept", 1); in server_thread()
94 err += verify_sockopt(client_fd, CUSTOM_LISTENER, "accept", 0); in server_thread()
96 close(client_fd); in server_thread()
141 int server_fd = -1, client_fd; in run_test() local
176 client_fd = connect_to_server(server_fd); in run_test()
177 if (!ASSERT_GE(client_fd, 0, "connect_to_server")) in run_test()
[all …]
H A Dnetns_cookie.c15 int server_fd = -1, client_fd = -1, cgroup_fd = -1; in test_netns_cookie() local
45 client_fd = connect_to_fd(server_fd, 0); in test_netns_cookie()
46 if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno)) in test_netns_cookie()
49 ret = send(client_fd, send_msg, sizeof(send_msg), 0); in test_netns_cookie()
54 &client_fd, &val); in test_netns_cookie()
58 err = getsockopt(client_fd, SOL_SOCKET, SO_NETNS_COOKIE, in test_netns_cookie()
66 &client_fd, &val); in test_netns_cookie()
75 if (client_fd != -1) in test_netns_cookie()
76 close(client_fd); in test_netns_cookie()
H A Dtcp_rtt.c46 static int verify_sk(int map_fd, int client_fd, const char *msg, __u32 invoked, in verify_sk() argument
53 if (!ASSERT_GE(bpf_map_lookup_elem(map_fd, &client_fd, &val), 0, "read socket storage")) in verify_sk()
93 int client_fd; in run_test() local
111 client_fd = connect_to_fd(server_fd, 0); in run_test()
112 if (client_fd < 0) { in run_test()
117 err += verify_sk(map_fd, client_fd, "syn-ack", in run_test()
124 send_byte(client_fd); in run_test()
125 if (wait_for_ack(client_fd, 100) < 0) { in run_test()
131 err += verify_sk(map_fd, client_fd, "first payload byte", in run_test()
139 close(client_fd); in run_test()
H A Dsocket_cookie.c18 int server_fd = 0, client_fd = 0, cgroup_fd = 0, err = 0; in test_socket_cookie() local
52 client_fd = connect_to_fd(server_fd, 0); in test_socket_cookie()
53 if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno)) in test_socket_cookie()
57 &client_fd, &val); in test_socket_cookie()
61 err = getsockname(client_fd, (struct sockaddr *)&addr, &addr_len); in test_socket_cookie()
69 close(client_fd); in test_socket_cookie()
H A Dload_bytes_relative.c12 int server_fd, cgroup_fd, prog_fd, map_fd, client_fd; in test_load_bytes_relative() local
52 client_fd = connect_to_fd(server_fd, 0); in test_load_bytes_relative()
53 if (CHECK_FAIL(client_fd < 0)) in test_load_bytes_relative()
55 close(client_fd); in test_load_bytes_relative()
H A Dcgroup_v1v2.c48 int server_fd, client_fd, cgroup_fd; in test_cgroup_v1v2() local
55 client_fd = connect_to_fd_opts(server_fd, &opts); in test_cgroup_v1v2()
56 if (!ASSERT_GE(client_fd, 0, "client_fd")) { in test_cgroup_v1v2()
60 close(client_fd); in test_cgroup_v1v2()
H A Dsk_lookup.c440 err = send_byte(client_fd); in tcp_echo_test()
446 err = recv_byte(client_fd); in tcp_echo_test()
652 if (client_fd < 0) in run_lookup_prog()
660 close(client_fd); in run_lookup_prog()
883 if (client_fd < 0) in drop_on_lookup()
901 close(client_fd); in drop_on_lookup()
1172 if (client_fd < 0) in run_sk_assign_connected()
1175 send_byte(client_fd); in run_sk_assign_connected()
1179 close(client_fd); in run_sk_assign_connected()
1254 if (client_fd < 0) in run_multi_prog_lookup()
[all …]
H A Dxdp_synproxy.c60 int server_fd = -1, client_fd = -1, accept_fd = -1; in test_synproxy() local
135 client_fd = connect_to_fd(server_fd, 10000); in test_synproxy()
136 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_synproxy()
161 if (client_fd >= 0) in test_synproxy()
162 close(client_fd); in test_synproxy()
H A Dbpf_nf.c53 int srv_fd = -1, client_fd = -1, srv_client_fd = -1; in test_bpf_nf_ct() local
80 client_fd = connect_to_server(srv_fd); in test_bpf_nf_ct()
81 if (!ASSERT_GE(client_fd, 0, "connect_to_server")) in test_bpf_nf_ct()
126 if (client_fd != -1) in test_bpf_nf_ct()
127 close(client_fd); in test_bpf_nf_ct()
H A Dcgrp_local_storage.c70 int server_fd = 0, client_fd = 0, err = 0; in test_attach_cgroup() local
100 client_fd = connect_to_fd(server_fd, 0); in test_attach_cgroup()
101 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_attach_cgroup()
109 err = getsockname(client_fd, (struct sockaddr *)&addr, &addr_len); in test_attach_cgroup()
117 close(client_fd); in test_attach_cgroup()
H A Dtc_redirect.c344 int listen_fd = -1, accept_fd = -1, client_fd = -1; in test_tcp() local
362 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); in test_tcp()
363 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_tcp()
373 n = write(client_fd, buf, sizeof(buf)); in test_tcp()
387 if (client_fd >= 0) in test_tcp()
388 close(client_fd); in test_tcp()
595 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_inet_dtime()
605 n = write(client_fd, buf, sizeof(buf)); in test_inet_dtime()
610 snd_tstamp(client_fd, buf, sizeof(buf)); in test_inet_dtime()
618 if (client_fd != -1) in test_inet_dtime()
[all …]
H A Dcg_storage_multi.c59 int server_fd = -1, client_fd = -1; in connect_send() local
70 client_fd = connect_to_fd(server_fd, 0); in connect_send()
71 if (client_fd < 0) in connect_send()
74 if (send(client_fd, &message, sizeof(message), 0) < 0) in connect_send()
83 close(client_fd); in connect_send()
H A Dlsm_cgroup.c70 int listen_fd, client_fd, accepted_fd; in test_lsm_cgroup_functional() local
222 client_fd = connect_to_fd(listen_fd, 0); in test_lsm_cgroup_functional()
223 ASSERT_GE(client_fd, 0, "connect_to_fd"); in test_lsm_cgroup_functional()
270 close(client_fd); in test_lsm_cgroup_functional()
/openbmc/linux/tools/testing/selftests/net/
H A Dbind_timewait.c45 int server_fd, client_fd, child_fd, ret; in create_timewait_socket() local
61 client_fd = socket(AF_INET, SOCK_STREAM, 0); in create_timewait_socket()
62 ASSERT_GT(client_fd, 0); in create_timewait_socket()
64 ret = connect(client_fd, (struct sockaddr *)&self->addr, self->addrlen); in create_timewait_socket()
72 close(client_fd); in create_timewait_socket()
/openbmc/linux/tools/testing/vsock/
H A Dvsock_perf.c138 int client_fd; in run_receiver() local
175 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); in run_receiver()
177 if (client_fd < 0) in run_receiver()
180 vsock_increase_buf_size(client_fd); in run_receiver()
182 if (setsockopt(client_fd, SOL_SOCKET, SO_RCVLOWAT, in run_receiver()
202 fds.fd = client_fd; in run_receiver()
246 close(client_fd); in run_receiver()
H A Dutil.c155 int client_fd; in vsock_accept() local
174 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); in vsock_accept()
176 } while (client_fd < 0 && errno == EINTR); in vsock_accept()
183 if (client_fd < 0) in vsock_accept()
184 return client_fd; in vsock_accept()
199 return client_fd; in vsock_accept()
H A Dvsock_diag_test.c404 int client_fd; in test_connect_server() local
406 client_fd = vsock_stream_accept(VMADDR_CID_ANY, 1234, NULL); in test_connect_server()
407 if (client_fd < 0) { in test_connect_server()
415 st = find_vsock_stat(&sockets, client_fd); in test_connect_server()
421 close(client_fd); in test_connect_server()
/openbmc/qemu/qga/
H A Dchannel-posix.c29 int ret, client_fd; in ga_channel_listen_accept() local
34 client_fd = qemu_accept(g_io_channel_unix_get_fd(channel), NULL, NULL); in ga_channel_listen_accept()
35 if (client_fd == -1) { in ga_channel_listen_accept()
39 qemu_socket_set_nonblock(client_fd); in ga_channel_listen_accept()
40 ret = ga_channel_client_add(c, client_fd); in ga_channel_listen_accept()
43 close(client_fd); in ga_channel_listen_accept()
/openbmc/qemu/tests/tcg/multiarch/linux/
H A Dlinux-test.c289 int server_fd, client_fd, fd, pid, ret, val; in test_socket() local
311 client_fd = client_socket(server_port); in test_socket()
312 send(client_fd, socket_msg, sizeof(socket_msg), 0); in test_socket()
313 close(client_fd); in test_socket()
/openbmc/linux/tools/testing/selftests/bpf/
H A Dnetwork_helpers.c333 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) in connect_fd_to_fd() argument
338 if (settimeo(client_fd, timeout_ms)) in connect_fd_to_fd()
346 if (connect_fd_to_addr(client_fd, &addr, len, false)) in connect_fd_to_fd()
H A Dnetwork_helpers.h56 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
/openbmc/linux/fs/notify/fanotify/
H A Dfanotify_user.c255 int client_fd; in create_fd() local
258 client_fd = get_unused_fd_flags(group->fanotify_data.f_flags); in create_fd()
259 if (client_fd < 0) in create_fd()
260 return client_fd; in create_fd()
277 put_unused_fd(client_fd); in create_fd()
278 client_fd = PTR_ERR(new_file); in create_fd()
283 return client_fd; in create_fd()