/Zephyr-latest/tests/net/socket/select/src/ |
D | main.c | 72 int s_sock; in ZTEST_USER() local 82 prepare_sock_udp_v6(MY_IPV6_ADDR, SERVER_PORT, &s_sock, &s_addr); in ZTEST_USER() 84 res = zsock_bind(s_sock, (struct sockaddr *)&s_addr, sizeof(s_addr)); in ZTEST_USER() 92 ZSOCK_FD_SET(s_sock, &readfds); in ZTEST_USER() 97 res = zsock_select(s_sock + 1, &readfds, NULL, NULL, &tval); in ZTEST_USER() 107 zassert_false(ZSOCK_FD_ISSET(s_sock, &readfds), ""); in ZTEST_USER() 111 ZSOCK_FD_SET(s_sock, &readfds); in ZTEST_USER() 115 res = zsock_select(s_sock + 1, &readfds, NULL, NULL, &tval); in ZTEST_USER() 126 ZSOCK_FD_SET(s_sock, &readfds); in ZTEST_USER() 130 res = zsock_select(s_sock + 1, &readfds, NULL, NULL, &tval); in ZTEST_USER() [all …]
|
/Zephyr-latest/tests/net/socket/tcp/src/ |
D | main.c | 234 int s_sock; in ZTEST_USER() local 242 prepare_sock_tcp_v4(MY_IPV4_ADDR, SERVER_PORT, &s_sock, &s_saddr); in ZTEST_USER() 244 test_bind(s_sock, (struct sockaddr *)&s_saddr, sizeof(s_saddr)); in ZTEST_USER() 245 test_listen(s_sock); in ZTEST_USER() 250 test_accept(s_sock, &new_sock, &addr, &addrlen); in ZTEST_USER() 260 test_close(s_sock); in ZTEST_USER() 269 int s_sock; in ZTEST_USER() local 277 prepare_sock_tcp_v6(MY_IPV6_ADDR, SERVER_PORT, &s_sock, &s_saddr); in ZTEST_USER() 279 test_bind(s_sock, (struct sockaddr *)&s_saddr, sizeof(s_saddr)); in ZTEST_USER() 280 test_listen(s_sock); in ZTEST_USER() [all …]
|
/Zephyr-latest/tests/net/socket/poll/src/ |
D | main.c | 38 int s_sock; in ZTEST() local 50 prepare_sock_udp_v6(MY_IPV6_ADDR, SERVER_PORT, &s_sock, &s_addr); in ZTEST() 54 res = zsock_bind(s_sock, (struct sockaddr *)&s_addr, sizeof(s_addr)); in ZTEST() 63 pollfds[1].fd = s_sock; in ZTEST() 75 zassert_equal(pollfds[1].fd, s_sock, ""); in ZTEST() 101 zassert_equal(pollfds[1].fd, s_sock, ""); in ZTEST() 107 len = zsock_recv(s_sock, BUF_AND_SIZE(buf), 0); in ZTEST() 170 res = zsock_close(s_sock); in ZTEST() 182 int s_sock; in ZTEST() local 190 prepare_sock_tcp_v6(MY_IPV6_ADDR, SERVER_PORT, &s_sock, &s_addr); in ZTEST() [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 75 if (s_sock >= 0) { in test_config_psk() 76 zassert_equal(zsock_setsockopt(s_sock, SOL_TLS, TLS_SEC_TAG_LIST, in test_config_psk() 173 if (s_sock >= 0) { in test_sockets_close() 174 test_close(s_sock); in test_sockets_close() 175 s_sock = -1; in test_sockets_close() 320 prepare_sock_tls_v6(MY_IPV6_ADDR, ANY_PORT, &s_sock, in test_prepare_tls_connection() 327 prepare_sock_tls_v4(MY_IPV4_ADDR, ANY_PORT, &s_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 127 s_sock = zsock_socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); in broker_init() 128 if (s_sock < 0) { in broker_init() 132 ret = zsock_setsockopt(s_sock, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, in broker_init() 138 ret = zsock_bind(s_sock, (struct sockaddr *)&bind_addr, sizeof(bind_addr)); in broker_init() 143 ret = zsock_listen(s_sock, 1); in broker_init() 151 if (s_sock >= 0) { in broker_destroy() 152 zsock_close(s_sock); in broker_destroy() 153 s_sock = -1; in broker_destroy() 385 { s_sock, ZSOCK_POLLIN, 0}, in broker_process() [all …]
|
/Zephyr-latest/tests/net/pmtu/src/ |
D | main.c | 484 int s_sock; in get_v6_send_recv_sock() local 486 prepare_sock_tcp_v6(PEER_IPV6_ADDR, peer_port, &s_sock, peer_saddr); in get_v6_send_recv_sock() 487 test_bind(s_sock, (struct sockaddr *)peer_saddr, sizeof(*peer_saddr)); in get_v6_send_recv_sock() 488 test_listen(s_sock); in get_v6_send_recv_sock() 494 test_accept(s_sock, &new_sock, &addr, &addrlen); in get_v6_send_recv_sock() 610 int s_sock; in get_v4_send_recv_sock() local 612 prepare_sock_tcp_v4(PEER_IPV4_ADDR, peer_port, &s_sock, peer_saddr); in get_v4_send_recv_sock() 613 test_bind(s_sock, (struct sockaddr *)peer_saddr, sizeof(*peer_saddr)); in get_v4_send_recv_sock() 614 test_listen(s_sock); in get_v4_send_recv_sock() 620 test_accept(s_sock, &new_sock, &addr, &addrlen); in get_v4_send_recv_sock()
|