| /kernel/liteos_a/testsuites/unittest/net/socket/smoke/ |
| D | net_socket_test_012.cpp | 42 static int SocketNullTestInternal(int sfd) in SocketNullTestInternal() argument 55 ret = accept(sfd, NULL, NULL); in SocketNullTestInternal() 59 ret = accept(sfd, NULL, &addrlen); in SocketNullTestInternal() 63 ret = accept(sfd, bad, &zero); in SocketNullTestInternal() 67 ret = accept(sfd, &addr, NULL); in SocketNullTestInternal() 74 ret = bind(sfd, NULL, addrlen); in SocketNullTestInternal() 78 ret = bind(sfd, bad, 0); in SocketNullTestInternal() 85 ret = getpeername(sfd, NULL, NULL); in SocketNullTestInternal() 89 ret = getpeername(sfd, NULL, &addrlen); in SocketNullTestInternal() 93 ret = getpeername(sfd, &addr, NULL); in SocketNullTestInternal() [all …]
|
| D | net_socket_test_003.cpp | 55 int sfd = -1, lsfd = -1; in SampleTcpServer() local 81 sfd = accept(lsfd, reinterpret_cast<struct sockaddr *>(&clnAddr), &clnAddrLen); in SampleTcpServer() 82 …LogPrintln("accept socket %d: %d <%s:%d>", lsfd, sfd, inet_ntoa(clnAddr.sin_addr), ntohs(clnAddr.s… in SampleTcpServer() 83 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, sfd); in SampleTcpServer() 92 ret = send(sfd, gBuf, strlen(SRV_MSG), 0); in SampleTcpServer() 93 LogPrintln("send on socket %d: %d", sfd, ret); in SampleTcpServer() 100 ret = recv(sfd, gBuf, sizeof(gBuf), 0); in SampleTcpServer() 101 LogPrintln("recv on socket %d: %d", sfd, ret); in SampleTcpServer() 124 ret = sendmsg(sfd, &msg, 0); in SampleTcpServer() 125 LogPrintln("sendmsg on socket %d: %d", sfd, ret); in SampleTcpServer() [all …]
|
| D | net_socket_test_010.cpp | 88 static int IoctlTestInternal(int sfd) in IoctlTestInternal() argument 98 p = IfIndex2Name(sfd, i, ifName); in IoctlTestInternal() 112 p = IfIndex2Name(sfd, loIndex, ifName); in IoctlTestInternal() 116 p = IfIndex2Name(sfd, lanIndex, ifName); in IoctlTestInternal() 124 ret = static_cast<int>(IfName2Index(sfd, p)); in IoctlTestInternal() 129 ret = ioctl(sfd, SIOCGIFNAME, &ifr); in IoctlTestInternal() 134 ret = ioctl(sfd, SIOCGIFINDEX, &ifr); in IoctlTestInternal() 139 ret = ioctl(sfd, SIOCGIFHWADDR, &ifr); in IoctlTestInternal() 144 ret = ioctl(sfd, SIOCGIFFLAGS, &ifr); in IoctlTestInternal() 154 ret = ioctl(sfd, SIOCSIFFLAGS, &ifr); in IoctlTestInternal() [all …]
|
| D | net_socket_test_002.cpp | 52 int sfd; in UdpTest() local 61 sfd = socket(AF_INET, SOCK_DGRAM, 0); in UdpTest() 62 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, sfd); in UdpTest() 67 ret = bind(sfd, reinterpret_cast<struct sockaddr *>(&srvAddr), sizeof(srvAddr)); in UdpTest() 78 ret = sendto(sfd, g_buf, strlen(MSG), 0, reinterpret_cast<struct sockaddr *>(&clnAddr), in UdpTest() 85 ret = recvfrom(sfd, g_buf, sizeof(g_buf), 0, reinterpret_cast<struct sockaddr *>(&clnAddr), in UdpTest() 105 ret = sendmsg(sfd, &msg, 0); in UdpTest() 119 ret = recvmsg(sfd, &msg, 0); in UdpTest() 123 ret = close(sfd); in UdpTest()
|
| /kernel/linux/linux-6.6/tools/testing/selftests/filesystems/epoll/ |
| D | epoll_wakeup_test.c | 19 int sfd[4]; member 136 write(ctx->sfd[1], "w", 1); in emitter_entry1() 148 write(ctx->sfd[1], "w", 1); in emitter_entry2() 149 write(ctx->sfd[3], "w", 1); in emitter_entry2() 166 int sfd[2]; in TEST() local 169 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, sfd), 0); in TEST() 175 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST() 177 ASSERT_EQ(write(sfd[1], "w", 1), 1); in TEST() 183 close(sfd[0]); in TEST() 184 close(sfd[1]); in TEST() [all …]
|
| /kernel/linux/linux-5.10/tools/testing/selftests/filesystems/epoll/ |
| D | epoll_wakeup_test.c | 17 int sfd[4]; member 121 write(ctx->sfd[1], "w", 1); in emitter_entry1() 133 write(ctx->sfd[1], "w", 1); in emitter_entry2() 134 write(ctx->sfd[3], "w", 1); in emitter_entry2() 151 int sfd[2]; in TEST() local 154 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, sfd), 0); in TEST() 160 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST() 162 ASSERT_EQ(write(sfd[1], "w", 1), 1); in TEST() 168 close(sfd[0]); in TEST() 169 close(sfd[1]); in TEST() [all …]
|
| /kernel/liteos_m/components/net/test/ |
| D | net_socket_test_003.c | 46 int sfd, lsfd; in SampleTcpServer() local 70 sfd = accept(lsfd, (struct sockaddr*)&clnAddr, &clnAddrLen); in SampleTcpServer() 71 …LogPrintln("accept socket %d: %d <%s:%d>", lsfd, sfd, inet_ntoa(clnAddr.sin_addr), ntohs(clnAddr.s… in SampleTcpServer() 72 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, 4); in SampleTcpServer() 77 ret = send(sfd, g_buf, strlen(SRV_MSG), 0); in SampleTcpServer() 78 LogPrintln("server send on socket %d: %d", sfd, ret); in SampleTcpServer() 83 ret = recv(sfd, g_buf, sizeof(g_buf), 0); in SampleTcpServer() 84 LogPrintln("server recv on socket %d: %d", sfd, ret); in SampleTcpServer() 102 ret = sendmsg(sfd, &msg, 0); in SampleTcpServer() 103 LogPrintln("sendmsg on socket %d: %d", sfd, ret); in SampleTcpServer() [all …]
|
| D | net_socket_test_008.c | 59 int sfd, lsfd; in SampleTcpServer() local 82 sfd = accept(lsfd, (struct sockaddr*)&clnAddr, &clnAddrLen); in SampleTcpServer() 83 …LogPrintln("accept socket %d: %d <%s:%d>", lsfd, sfd, inet_ntoa(clnAddr.sin_addr), ntohs(clnAddr.s… in SampleTcpServer() 84 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, 4); in SampleTcpServer() 88 ret = send(sfd, g_serverSendBuf, BUF_SIZE, 0); in SampleTcpServer() 91 ret = closesocket(sfd); in SampleTcpServer() 101 int sfd; in SampleTcpClient() local 110 sfd = socket(AF_INET, SOCK_STREAM, 0); in SampleTcpClient() 111 LogPrintln("create client socket inet stream: %d", sfd); in SampleTcpClient() 112 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, 7); in SampleTcpClient() [all …]
|
| D | net_socket_test_009.c | 50 int sfd, lsfd; in SampleTcpServer() local 89 sfd = accept(lsfd, (struct sockaddr*)&clnAddr, &clnAddrLen); in SampleTcpServer() 90 …LogPrintln("accept socket %d: %d <%s:%d>", lsfd, sfd, inet_ntoa(clnAddr.sin_addr), ntohs(clnAddr.s… in SampleTcpServer() 91 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, 6); in SampleTcpServer() 96 ret = send(sfd, g_buf, strlen(SRV_MSG), 0); in SampleTcpServer() 97 LogPrintln("server send on socket %d: %d", sfd, ret); in SampleTcpServer() 100 ret = closesocket(sfd); in SampleTcpServer() 112 int sfd; in SampleTcpClient() local 117 sfd = socket(AF_INET, SOCK_STREAM, 0); in SampleTcpClient() 118 LogPrintln("create client socket inet stream: %d", sfd); in SampleTcpClient() [all …]
|
| D | net_socket_test_010.c | 50 int sfd, lsfd; in SampleTcpServer() local 84 sfd = accept(lsfd, (struct sockaddr*)&clnAddr, &clnAddrLen); in SampleTcpServer() 85 …LogPrintln("accept socket %d: %d <%s:%d>", lsfd, sfd, inet_ntoa(clnAddr.sin_addr), ntohs(clnAddr.s… in SampleTcpServer() 86 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, 6); in SampleTcpServer() 90 ret = recv(sfd, g_buf, sizeof(g_buf), 0); in SampleTcpServer() 91 LogPrintln("server recv on socket %d: %d", sfd, ret); in SampleTcpServer() 95 ret = closesocket(sfd); in SampleTcpServer() 107 int sfd; in SampleTcpClient() local 112 sfd = socket(AF_INET, SOCK_STREAM, 0); in SampleTcpClient() 113 LogPrintln("create client socket inet stream: %d", sfd); in SampleTcpClient() [all …]
|
| D | net_socket_test_013.c | 43 int sfd, lsfd; in SampleTcpServer() local 63 sfd = accept(lsfd, (struct sockaddr*)&clnAddr, &clnAddrLen); in SampleTcpServer() 64 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, 4); in SampleTcpServer() 67 ret = send(sfd, serverBuf, TCP_LONG_BUF_SIZE, 0); in SampleTcpServer() 70 ret = closesocket(sfd); in SampleTcpServer() 80 int sfd; in SampleTcpClient() local 87 sfd = socket(AF_INET, SOCK_STREAM, 0); in SampleTcpClient() 88 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, 9); in SampleTcpClient() 93 ret = connect(sfd, (struct sockaddr*)&srvAddr, sizeof(srvAddr)); in SampleTcpClient() 98 ret = recv(sfd, clientBuf, TCP_LONG_BUF_SIZE, 0); in SampleTcpClient() [all …]
|
| D | net_socket_test_012.c | 51 int sfd, lsfd; in SampleTcpServer() local 71 sfd = accept(lsfd, (struct sockaddr*)&clnAddr, &clnAddrLen); in SampleTcpServer() 72 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, 4); in SampleTcpServer() 77 ret = send(sfd, g_bufServer, strlen(SRV_MSG), 0); in SampleTcpServer() 80 ret = closesocket(sfd); in SampleTcpServer() 90 int sfd; in SampleTcpClient() local 95 sfd = socket(AF_INET, SOCK_STREAM, 0); in SampleTcpClient() 96 ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, 10); in SampleTcpClient() 102 ret = connect(sfd, (struct sockaddr*)&srvAddr, sizeof(srvAddr)); in SampleTcpClient() 107 ret = recv(sfd, g_bufClient, sizeof(g_bufClient), 0); in SampleTcpClient() [all …]
|
| D | net_socket_test_002.c | 47 int sfd; in UdpTestTask() local 57 sfd = socket(AF_INET, SOCK_DGRAM, 0); in UdpTestTask() 58 LWIP_ASSERT("socket invalid param.", sfd != -1); in UdpTestTask() 63 ret = bind(sfd, (struct sockaddr*)&srvAddr, sizeof(srvAddr)); in UdpTestTask() 72 ret = sendto(sfd, g_buf, strlen(MSG), 0, (struct sockaddr*)&clnAddr, in UdpTestTask() 76 ret = ioctlsocket(sfd, FIONREAD, &recvCount); in UdpTestTask() 82 ret = recvfrom(sfd, g_buf, sizeof(g_buf), 0, (struct sockaddr*)&clnAddr, in UdpTestTask() 100 ret = sendmsg(sfd, &msg, 0); in UdpTestTask() 112 ret = recvmsg(sfd, &msg, 0); in UdpTestTask() 116 ret = closesocket(sfd); in UdpTestTask()
|
| D | net_socket_test_007.c | 53 int sfd; in UdpTestMoreTask() local 61 sfd = socket(AF_INET, SOCK_DGRAM, 0); in UdpTestMoreTask() 62 LWIP_ASSERT("socket invalid param.", sfd != -1); in UdpTestMoreTask() 67 ret = bind(sfd, (struct sockaddr*)&srvAddr, sizeof(srvAddr)); in UdpTestMoreTask() 85 … ret = sendto(sfd, g_buf, BUF_SIZE, 0, (struct sockaddr*)&clnAddr, (socklen_t)sizeof(clnAddr)); in UdpTestMoreTask() 90 ret = recvfrom(sfd, g_buf, sizeof(g_buf), 0, (struct sockaddr*)&clnAddr, in UdpTestMoreTask() 97 ret = closesocket(sfd); in UdpTestMoreTask()
|
| /kernel/linux/linux-6.6/tools/testing/selftests/bpf/prog_tests/ |
| D | setget_sockopt.c | 45 int sfd, cfd; in test_tcp() local 49 sfd = start_server(family, SOCK_STREAM, in test_tcp() 51 if (!ASSERT_GE(sfd, 0, "start_server")) in test_tcp() 54 cfd = connect_to_fd(sfd, 0); in test_tcp() 56 close(sfd); in test_tcp() 59 close(sfd); in test_tcp() 73 int sfd; in test_udp() local 77 sfd = start_server(family, SOCK_DGRAM, in test_udp() 79 if (!ASSERT_GE(sfd, 0, "start_server")) in test_udp() 81 close(sfd); in test_udp() [all …]
|
| /kernel/linux/linux-6.6/ipc/ |
| D | shm.c | 278 static int __shm_open(struct shm_file_data *sfd) in __shm_open() argument 282 shp = shm_lock(sfd->ns, sfd->id); in __shm_open() 287 if (shp->shm_file != sfd->file) { in __shm_open() 304 struct shm_file_data *sfd = shm_file_data(file); in shm_open() local 308 if (sfd->vm_ops->open) in shm_open() 309 sfd->vm_ops->open(vma); in shm_open() 311 err = __shm_open(sfd); in shm_open() 368 static void __shm_close(struct shm_file_data *sfd) in __shm_close() argument 371 struct ipc_namespace *ns = sfd->ns; in __shm_close() 375 shp = shm_lock(ns, sfd->id); in __shm_close() [all …]
|
| /kernel/linux/linux-6.6/net/mptcp/ |
| D | sockopt.c | 992 static int mptcp_put_subflow_data(struct mptcp_subflow_data *sfd, in mptcp_put_subflow_data() argument 997 u32 copylen = min_t(u32, sfd->size_subflow_data, sizeof(*sfd)); in mptcp_put_subflow_data() 1000 copied += sfd->size_subflow_data; in mptcp_put_subflow_data() 1007 if (copy_to_user(optval, sfd, copylen)) in mptcp_put_subflow_data() 1013 static int mptcp_get_subflow_data(struct mptcp_subflow_data *sfd, in mptcp_get_subflow_data() argument 1025 BUILD_BUG_ON(sizeof(*sfd) != MIN_INFO_OPTLEN_SIZE); in mptcp_get_subflow_data() 1030 memset(sfd, 0, sizeof(*sfd)); in mptcp_get_subflow_data() 1032 copylen = min_t(unsigned int, len, sizeof(*sfd)); in mptcp_get_subflow_data() 1033 if (copy_from_user(sfd, optval, copylen)) in mptcp_get_subflow_data() 1037 if (sfd->size_subflow_data > INT_MAX || in mptcp_get_subflow_data() [all …]
|
| /kernel/linux/linux-5.10/ipc/ |
| D | shm.c | 281 struct shm_file_data *sfd = shm_file_data(file); in __shm_open() local 284 shp = shm_lock(sfd->ns, sfd->id); in __shm_open() 289 if (shp->shm_file != sfd->file) { in __shm_open() 368 struct shm_file_data *sfd = shm_file_data(file); in shm_close() local 370 struct ipc_namespace *ns = sfd->ns; in shm_close() 374 shp = shm_lock(ns, sfd->id); in shm_close() 527 struct shm_file_data *sfd = shm_file_data(file); in shm_fault() local 529 return sfd->vm_ops->fault(vmf); in shm_fault() 535 struct shm_file_data *sfd = shm_file_data(file); in shm_split() local 537 if (sfd->vm_ops->split) in shm_split() [all …]
|
| /kernel/liteos_m/testsuites/unittest/fuzz/src/socket/ |
| D | net_fuzz.c | 204 int sfd; in SampleTcpServer() local 222 sfd = accept(lsfd, (struct sockaddr *)&clnAddr, &num2); in SampleTcpServer() 228 ret = shutdown(sfd, num4); in SampleTcpServer() 230 shutdown(sfd, SHUT_RDWR); in SampleTcpServer() 233 close(sfd); in SampleTcpServer() 241 int sfd = -1; in SampleTcpClient() local 248 sfd = socket(AF_INET, SOCK_STREAM, 0); in SampleTcpClient() 252 connect(sfd, (struct sockaddr *)&srvAddr, sizeof(srvAddr)); in SampleTcpClient() 261 close(sfd); in SampleTcpClient() 269 ret = shutdown(sfd, SHUT_RDWR); in SampleTcpClient() [all …]
|
| /kernel/linux/linux-5.10/tools/testing/selftests/bpf/ |
| D | test_maps.c | 654 int err, i, fd, udp, sfd[6] = {0xdeadbeef}; in test_sockmap() local 667 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap() 668 if (sfd[i] < 0) in test_sockmap() 670 err = setsockopt(sfd[i], SOL_SOCKET, SO_REUSEADDR, in test_sockmap() 676 err = ioctl(sfd[i], FIONBIO, (char *)&one); in test_sockmap() 685 err = bind(sfd[i], (struct sockaddr *)&addr, sizeof(addr)); in test_sockmap() 688 err, i, sfd[i]); in test_sockmap() 691 err = listen(sfd[i], 32); in test_sockmap() 699 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap() 700 if (sfd[i] < 0) in test_sockmap() [all …]
|
| /kernel/linux/linux-6.6/tools/testing/selftests/bpf/ |
| D | test_maps.c | 664 int err, i, fd, udp, sfd[6] = {0xdeadbeef}; in test_sockmap() local 676 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap() 677 if (sfd[i] < 0) in test_sockmap() 679 err = setsockopt(sfd[i], SOL_SOCKET, SO_REUSEADDR, in test_sockmap() 685 err = ioctl(sfd[i], FIONBIO, (char *)&one); in test_sockmap() 694 err = bind(sfd[i], (struct sockaddr *)&addr, sizeof(addr)); in test_sockmap() 697 err, i, sfd[i]); in test_sockmap() 700 err = listen(sfd[i], 32); in test_sockmap() 708 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap() 709 if (sfd[i] < 0) in test_sockmap() [all …]
|
| /kernel/linux/linux-6.6/arch/um/drivers/ |
| D | slip_user.c | 130 int sfd, mfd, err; in slip_open() local 146 sfd = err; in slip_open() 148 err = set_up_tty(sfd); in slip_open() 152 pri->slave = sfd; in slip_open() 159 err = slip_tramp(argv, sfd); in slip_open() 175 err = os_set_slip(sfd); in slip_open() 184 close(sfd); in slip_open()
|
| /kernel/linux/linux-5.10/arch/um/drivers/ |
| D | slip_user.c | 130 int sfd, mfd, err; in slip_open() local 146 sfd = err; in slip_open() 148 err = set_up_tty(sfd); in slip_open() 152 pri->slave = sfd; in slip_open() 159 err = slip_tramp(argv, sfd); in slip_open() 175 err = os_set_slip(sfd); in slip_open() 184 close(sfd); in slip_open()
|
| /kernel/linux/linux-5.10/tools/testing/selftests/net/ |
| D | tls.c | 38 int sfd, ret; in FIXTURE_SETUP() local 48 sfd = socket(AF_INET, SOCK_STREAM, 0); in FIXTURE_SETUP() 50 ret = bind(sfd, &addr, sizeof(addr)); in FIXTURE_SETUP() 52 ret = listen(sfd, 10); in FIXTURE_SETUP() 55 ret = getsockname(sfd, &addr, &len); in FIXTURE_SETUP() 61 self->cfd = accept(sfd, &addr, &len); in FIXTURE_SETUP() 64 close(sfd); in FIXTURE_SETUP() 124 int sfd, ret; in FIXTURE_SETUP() local 138 sfd = socket(AF_INET, SOCK_STREAM, 0); in FIXTURE_SETUP() 140 ret = bind(sfd, &addr, sizeof(addr)); in FIXTURE_SETUP() [all …]
|
| /kernel/linux/linux-5.10/Documentation/devicetree/bindings/net/ieee802154/ |
| D | cc2520.txt | 12 - sfd-gpio: GPIO spec for the SFD pin 29 sfd-gpio = <&gpio1 13 0>;
|