/Zephyr-latest/tests/net/socket/tcp/src/ |
D | main.c | 233 int c_sock; in ZTEST_USER() local 241 prepare_sock_tcp_v4(MY_IPV4_ADDR, ANY_PORT, &c_sock, &c_saddr); in ZTEST_USER() 247 test_connect(c_sock, (struct sockaddr *)&s_saddr, sizeof(s_saddr)); in ZTEST_USER() 248 test_send(c_sock, TEST_STR_SMALL, strlen(TEST_STR_SMALL), 0); in ZTEST_USER() 256 test_close(c_sock); in ZTEST_USER() 268 int c_sock; in ZTEST_USER() local 276 prepare_sock_tcp_v6(MY_IPV6_ADDR, ANY_PORT, &c_sock, &c_saddr); in ZTEST_USER() 282 test_connect(c_sock, (struct sockaddr *)&s_saddr, sizeof(s_saddr)); in ZTEST_USER() 283 test_send(c_sock, TEST_STR_SMALL, strlen(TEST_STR_SMALL), 0); in ZTEST_USER() 291 test_close(c_sock); in ZTEST_USER() [all …]
|
/Zephyr-latest/tests/net/socket/poll/src/ |
D | main.c | 37 int c_sock; in ZTEST() local 49 prepare_sock_udp_v6(MY_IPV6_ADDR, CLIENT_PORT, &c_sock, &c_addr); in ZTEST() 57 res = zsock_connect(c_sock, (struct sockaddr *)&s_addr, sizeof(s_addr)); in ZTEST() 61 pollfds[0].fd = c_sock; in ZTEST() 72 zassert_equal(pollfds[0].fd, c_sock, ""); in ZTEST() 89 len = zsock_send(c_sock, BUF_AND_SIZE(TEST_STR_SMALL), 0); in ZTEST() 98 zassert_equal(pollfds[0].fd, c_sock, ""); in ZTEST() 118 pollout[0].fd = c_sock; in ZTEST() 121 res = zsock_connect(c_sock, (const struct sockaddr *)&s_addr, in ZTEST() 160 res = zsock_close(c_sock); in ZTEST() [all …]
|
/Zephyr-latest/tests/net/socket/select/src/ |
D | main.c | 71 int c_sock; in ZTEST_USER() local 81 prepare_sock_udp_v6(MY_IPV6_ADDR, CLIENT_PORT, &c_sock, &c_addr); in ZTEST_USER() 87 res = zsock_connect(c_sock, (struct sockaddr *)&s_addr, sizeof(s_addr)); in ZTEST_USER() 91 ZSOCK_FD_SET(c_sock, &readfds); in ZTEST_USER() 106 zassert_false(ZSOCK_FD_ISSET(c_sock, &readfds), ""); in ZTEST_USER() 110 ZSOCK_FD_SET(c_sock, &readfds); in ZTEST_USER() 122 len = zsock_send(c_sock, BUF_AND_SIZE(TEST_STR_SMALL), 0); in ZTEST_USER() 125 ZSOCK_FD_SET(c_sock, &readfds); in ZTEST_USER() 135 zassert_false(ZSOCK_FD_ISSET(c_sock, &readfds), ""); in ZTEST_USER() 143 ZSOCK_FD_SET(c_sock, &readfds); in ZTEST_USER() [all …]
|
/Zephyr-latest/tests/net/socket/tls/src/ |
D | main.c | 38 int c_sock = -1, s_sock = -1, new_sock = -1; variable 59 static void test_config_psk(int s_sock, int c_sock) in test_config_psk() argument 81 if (c_sock >= 0) { in test_config_psk() 82 zassert_equal(zsock_setsockopt(c_sock, SOL_TLS, TLS_SEC_TAG_LIST, in test_config_psk() 168 if (c_sock >= 0) { in test_sockets_close() 169 test_close(c_sock); in test_sockets_close() 170 c_sock = -1; in test_sockets_close() 317 prepare_sock_tls_v6(MY_IPV6_ADDR, ANY_PORT, &c_sock, in test_prepare_tls_connection() 324 prepare_sock_tls_v4(MY_IPV4_ADDR, ANY_PORT, &c_sock, in test_prepare_tls_connection() 332 test_config_psk(s_sock, c_sock); in test_prepare_tls_connection() [all …]
|
/Zephyr-latest/tests/net/lib/mqtt/v3_1_1/mqtt_client/src/ |
D | main.c | 31 int s_sock = -1, c_sock = -1; variable 156 if (c_sock >= 0) { in broker_destroy() 157 zsock_close(c_sock); in broker_destroy() 158 c_sock = -1; in broker_destroy() 168 ssize_t out_len = zsock_send(c_sock, reply, len, 0); in test_send_reply() 313 zsock_close(c_sock); in broker_validate_packet() 314 c_sock = -1; in broker_validate_packet() 332 ret = zsock_recv(c_sock, broker_buf + broker_offset, in broker_receive() 386 { c_sock, ZSOCK_POLLIN, 0}, in broker_process() 390 if (c_sock >= 0 && broker_offset > 0) { in broker_process() [all …]
|
/Zephyr-latest/tests/net/pmtu/src/ |
D | main.c | 483 int c_sock; in get_v6_send_recv_sock() local 490 prepare_sock_tcp_v6(MY_IPV6_ADDR, my_port, &c_sock, my_saddr); in get_v6_send_recv_sock() 491 test_bind(c_sock, (struct sockaddr *)my_saddr, sizeof(*my_saddr)); in get_v6_send_recv_sock() 492 test_connect(c_sock, (struct sockaddr *)peer_saddr, sizeof(*peer_saddr)); in get_v6_send_recv_sock() 499 return c_sock; in get_v6_send_recv_sock() 609 int c_sock; in get_v4_send_recv_sock() local 616 prepare_sock_tcp_v4(MY_IPV4_ADDR, my_port, &c_sock, my_saddr); in get_v4_send_recv_sock() 617 test_bind(c_sock, (struct sockaddr *)my_saddr, sizeof(*my_saddr)); in get_v4_send_recv_sock() 618 test_connect(c_sock, (struct sockaddr *)peer_saddr, sizeof(*peer_saddr)); in get_v4_send_recv_sock() 625 return c_sock; in get_v4_send_recv_sock()
|