| /tools/usb/usbip/src/ |
| A D | usbip_network.c | 106 nbytes = send(sockfd, buff, bufflen, 0); in usbip_net_xmit() 210 int usbip_net_set_reuseaddr(int sockfd) in usbip_net_set_reuseaddr() argument 222 int usbip_net_set_nodelay(int sockfd) in usbip_net_set_nodelay() argument 234 int usbip_net_set_keepalive(int sockfd) in usbip_net_set_keepalive() argument 246 int usbip_net_set_v6only(int sockfd) in usbip_net_set_v6only() argument 264 int sockfd; in usbip_net_tcp_connect() local 283 if (sockfd < 0) in usbip_net_tcp_connect() 287 usbip_net_set_nodelay(sockfd); in usbip_net_tcp_connect() 289 usbip_net_set_keepalive(sockfd); in usbip_net_tcp_connect() 294 close(sockfd); in usbip_net_tcp_connect() [all …]
|
| A D | usbip_attach.c | 102 rc = usbip_vhci_attach_device(port, sockfd, udev->busnum, in import_device() 120 static int query_import_device(int sockfd, char *busid) in query_import_device() argument 132 rc = usbip_net_send_op_common(sockfd, OP_REQ_IMPORT, 0); in query_import_device() 149 rc = usbip_net_recv_op_common(sockfd, &code, &status); in query_import_device() 156 rc = usbip_net_recv(sockfd, (void *) &reply, sizeof(reply)); in query_import_device() 171 return import_device(sockfd, &reply.udev); in query_import_device() 176 int sockfd; in attach_device() local 180 sockfd = usbip_net_tcp_connect(host, usbip_port_string); in attach_device() 181 if (sockfd < 0) { in attach_device() 186 rhport = query_import_device(sockfd, busid); in attach_device() [all …]
|
| A D | usbip_network.h | 168 ssize_t usbip_net_recv(int sockfd, void *buff, size_t bufflen); 169 ssize_t usbip_net_send(int sockfd, void *buff, size_t bufflen); 170 int usbip_net_send_op_common(int sockfd, uint32_t code, uint32_t status); 171 int usbip_net_recv_op_common(int sockfd, uint16_t *code, int *status); 172 int usbip_net_set_reuseaddr(int sockfd); 173 int usbip_net_set_nodelay(int sockfd); 174 int usbip_net_set_keepalive(int sockfd); 175 int usbip_net_set_v6only(int sockfd);
|
| A D | usbip_list.c | 44 static int get_exported_devices(char *host, int sockfd) in get_exported_devices() argument 56 rc = usbip_net_send_op_common(sockfd, OP_REQ_DEVLIST, 0); in get_exported_devices() 62 rc = usbip_net_recv_op_common(sockfd, &code, &status); in get_exported_devices() 70 rc = usbip_net_recv(sockfd, &reply, sizeof(reply)); in get_exported_devices() 89 rc = usbip_net_recv(sockfd, &udev, sizeof(udev)); in get_exported_devices() 106 rc = usbip_net_recv(sockfd, &uintf, sizeof(uintf)); in get_exported_devices() 131 int sockfd; in list_exported_devices() local 134 if (sockfd < 0) { in list_exported_devices() 136 usbip_port_string, gai_strerror(sockfd)); in list_exported_devices() 141 rc = get_exported_devices(host, sockfd); in list_exported_devices() [all …]
|
| A D | usbipd.c | 91 static int recv_request_import(int sockfd) in recv_request_import() argument 103 rc = usbip_net_recv(sockfd, &req, sizeof(req)); in recv_request_import() 121 usbip_net_set_nodelay(sockfd); in recv_request_import() 124 status = usbip_export_device(edev, sockfd); in recv_request_import() 132 rc = usbip_net_send_op_common(sockfd, OP_REP_IMPORT, status); in recv_request_import() 146 rc = usbip_net_send(sockfd, &pdu_udev, sizeof(pdu_udev)); in recv_request_import()
|
| /tools/testing/selftests/bpf/prog_tests/ |
| A D | skc_to_unix_sock.c | 14 int err, sockfd = 0; in test_skc_to_unix_sock() local 31 sockfd = socket(AF_UNIX, SOCK_STREAM, 0); in test_skc_to_unix_sock() 32 if (!ASSERT_GT(sockfd, 0, "socket failed")) in test_skc_to_unix_sock() 40 err = bind(sockfd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); in test_skc_to_unix_sock() 44 err = listen(sockfd, 1); in test_skc_to_unix_sock() 51 if (sockfd) in test_skc_to_unix_sock() 52 close(sockfd); in test_skc_to_unix_sock()
|
| A D | decap_sanity.c | 25 int sockfd, err; in test_decap_sanity() local 57 sockfd = socket(AF_INET6, SOCK_DGRAM, 0); in test_decap_sanity() 58 if (!ASSERT_NEQ(sockfd, -1, "socket")) in test_decap_sanity() 60 err = sendto(sockfd, buf, sizeof(buf), 0, (void *)&addr, addrlen); in test_decap_sanity() 61 close(sockfd); in test_decap_sanity()
|
| A D | crypto_sanity.c | 91 int sockfd, err, pfd; in test_crypto_sanity() local 147 sockfd = socket(AF_INET6, SOCK_DGRAM, 0); in test_crypto_sanity() 148 if (!ASSERT_NEQ(sockfd, -1, "encrypt socket")) in test_crypto_sanity() 150 err = sendto(sockfd, plain_text, sizeof(plain_text), 0, (void *)&addr, addrlen); in test_crypto_sanity() 151 close(sockfd); in test_crypto_sanity() 172 sockfd = socket(AF_INET6, SOCK_DGRAM, 0); in test_crypto_sanity() 173 if (!ASSERT_NEQ(sockfd, -1, "decrypt socket")) in test_crypto_sanity() 175 err = sendto(sockfd, afalg_dst, sizeof(afalg_dst), 0, (void *)&addr, addrlen); in test_crypto_sanity() 176 close(sockfd); in test_crypto_sanity()
|
| A D | d_path.c | 43 int sockfd = -1, procfd = -1, devfd = -1; in trigger_fstat_events() local 53 sockfd = socket(AF_INET, SOCK_STREAM, 0); in trigger_fstat_events() 54 if (CHECK(sockfd < 0, "trigger", "socket failed\n")) in trigger_fstat_events() 78 ret = set_pathname(sockfd, pid); in trigger_fstat_events() 97 fstat(sockfd, &fileStat); in trigger_fstat_events() 111 close(sockfd); in trigger_fstat_events()
|
| A D | sock_post_bind.c | 311 int sockfd = -1; in bind_sock() local 315 sockfd = socket(domain, type, 0); in bind_sock() 316 if (sockfd < 0) in bind_sock() 339 if (bind(sockfd, (const struct sockaddr *)&addr, len) == -1) { in bind_sock() 357 if (bind(sockfd, (const struct sockaddr *)&addr, len) == -1) { in bind_sock() 368 close(sockfd); in bind_sock()
|
| A D | token.c | 143 static int sendfd(int sockfd, int fd) in sendfd() argument 168 err = sendmsg(sockfd, &msg, 0); in sendfd() 178 static int recvfd(int sockfd, int *fd) in recvfd() argument 198 err = recvmsg(sockfd, &msg, 0); in recvfd()
|
| A D | sockmap_listen.c | 475 int sockfd; member 493 s = ctx->sockfd; in connect_accept_thread() 557 ctx.sockfd = s; in test_syn_recv_insert_delete() 586 s = ctx->sockfd; in listen_thread() 619 ctx.sockfd = s; in test_race_insert_listen()
|
| /tools/testing/selftests/bpf/ |
| A D | xdp_features.c | 247 close(sockfd); in dut_echo_thread() 258 if (!sockfd) { in dut_run_echo_thread() 370 if (!sockfd) { in dut_run() 490 free_fds(sockfd, 1); in dut_run() 553 int sockfd, n; in send_echo_msg() local 556 if (sockfd < 0) { in send_echo_msg() 568 close(sockfd); in send_echo_msg() 579 int i, err, sockfd; in tester_run() local 583 if (sockfd < 0) { in tester_run() 603 close(sockfd); in tester_run() [all …]
|
| A D | network_helpers.c | 622 int sockfd, err; in get_hw_ring_size() local 624 sockfd = socket(AF_INET, SOCK_DGRAM, 0); in get_hw_ring_size() 625 if (sockfd < 0) in get_hw_ring_size() 633 if (ioctl(sockfd, SIOCETHTOOL, &ifr) < 0) { in get_hw_ring_size() 635 close(sockfd); in get_hw_ring_size() 639 close(sockfd); in get_hw_ring_size() 646 int sockfd, err; in set_hw_ring_size() local 648 sockfd = socket(AF_INET, SOCK_DGRAM, 0); in set_hw_ring_size() 649 if (sockfd < 0) in set_hw_ring_size() 659 close(sockfd); in set_hw_ring_size() [all …]
|
| /tools/testing/selftests/net/ |
| A D | busy_poller.c | 191 static void setnonblock(int sockfd) in setnonblock() argument 195 flags = fcntl(sockfd, F_GETFL, 0); in setnonblock() 197 if (fcntl(sockfd, F_SETFL, flags | O_NONBLOCK) == -1) in setnonblock() 268 int sockfd; in run_poller() local 276 sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); in run_poller() 277 if (sockfd == -1) in run_poller() 296 setnonblock(sockfd); in run_poller() 298 if (bind(sockfd, (struct sockaddr *)&server_addr, in run_poller() 302 if (listen(sockfd, 1)) in run_poller() 314 if (events[i].data.fd == sockfd) { in run_poller() [all …]
|
| /tools/usb/usbip/libsrc/ |
| A D | vhci_driver.h | 56 int usbip_vhci_attach_device2(uint8_t port, int sockfd, uint32_t devid, 60 int usbip_vhci_attach_device(uint8_t port, int sockfd, uint8_t busnum,
|
| A D | vhci_driver.c | 53 int sockfd; in parse_status() local 60 &devid, &sockfd, lbusid); in parse_status() 69 dbg("sockfd %u lbusid %s", sockfd, lbusid); in parse_status() 357 int usbip_vhci_attach_device2(uint8_t port, int sockfd, uint32_t devid, in usbip_vhci_attach_device2() argument 366 port, sockfd, devid, speed); in usbip_vhci_attach_device2() 391 int usbip_vhci_attach_device(uint8_t port, int sockfd, uint8_t busnum, in usbip_vhci_attach_device() argument 396 return usbip_vhci_attach_device2(port, sockfd, devid, speed); in usbip_vhci_attach_device()
|
| A D | usbip_host_common.h | 88 int usbip_export_device(struct usbip_exported_device *edev, int sockfd);
|
| A D | usbip_host_common.c | 212 int usbip_export_device(struct usbip_exported_device *edev, int sockfd) in usbip_export_device() argument 247 size = snprintf(sockfd_buff, sizeof(sockfd_buff), "%d\n", sockfd); in usbip_export_device()
|
| /tools/testing/selftests/net/netfilter/ |
| A D | udpclash.c | 29 int sockfd; member 45 if (sendto(args->sockfd, msg, strlen(msg), MSG_NOSIGNAL, in thread_main() 56 .sockfd = fd, in run_test()
|
| /tools/include/io_uring/ |
| A D | mini_liburing.h | 231 int sockfd, in io_uring_prep_cmd() argument 238 sqe->fd = sockfd; in io_uring_prep_cmd() 258 static inline void io_uring_prep_send(struct io_uring_sqe *sqe, int sockfd, in io_uring_prep_send() argument 263 sqe->fd = sockfd; in io_uring_prep_send() 269 static inline void io_uring_prep_sendzc(struct io_uring_sqe *sqe, int sockfd, in io_uring_prep_sendzc() argument 273 io_uring_prep_send(sqe, sockfd, buf, len, flags); in io_uring_prep_sendzc()
|
| /tools/testing/selftests/drivers/net/hw/ |
| A D | iou-zcrx.c | 181 static void add_accept(struct io_uring *ring, int sockfd) in add_accept() argument 187 io_uring_prep_accept(sqe, sockfd, NULL, NULL, 0); in add_accept() 191 static void add_recvzc(struct io_uring *ring, int sockfd) in add_recvzc() argument 197 io_uring_prep_rw(IORING_OP_RECV_ZC, sqe, sockfd, NULL, 0, 0); in add_recvzc() 202 static void add_recvzc_oneshot(struct io_uring *ring, int sockfd, size_t len) in add_recvzc_oneshot() argument 208 io_uring_prep_rw(IORING_OP_RECV_ZC, sqe, sockfd, NULL, len, 0); in add_recvzc_oneshot()
|
| /tools/virtio/ |
| A D | vhost_net_test.c | 124 int sockfd = dev->sock; in vdev_send_packet() local 132 ret = sendto(sockfd, sendbuf, TEST_BUF_LEN, 0, in vdev_send_packet()
|