Lines Matching refs:sock_s

169 void test_so_bindtodevice(int sock_c, int sock_s, struct sockaddr *peer_addr_1,  in test_so_bindtodevice()  argument
184 ret = zsock_bind(sock_s, bind_addr, bind_addrlen); in test_so_bindtodevice()
190 ret = zsock_setsockopt(sock_s, SOL_SOCKET, SO_BINDTODEVICE, &ifreq, in test_so_bindtodevice()
246 ret = zsock_recv(sock_s, recv_buf, sizeof(recv_buf), ZSOCK_MSG_DONTWAIT); in test_so_bindtodevice()
254 ret = zsock_setsockopt(sock_s, SOL_SOCKET, SO_BINDTODEVICE, &ifreq, in test_so_bindtodevice()
283 ret = zsock_recv(sock_s, recv_buf, sizeof(recv_buf), ZSOCK_MSG_DONTWAIT); in test_so_bindtodevice()
290 ret = zsock_close(sock_s); in test_so_bindtodevice()
299 int sock_s; in test_ipv4_so_bindtodevice() local
318 sock_s = zsock_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); in test_ipv4_so_bindtodevice()
319 zassert_true(sock_s >= 0, "socket open failed"); in test_ipv4_so_bindtodevice()
321 test_so_bindtodevice(sock_c, sock_s, (struct sockaddr *)&peer_addr_1, in test_ipv4_so_bindtodevice()
329 int sock_s; in test_ipv6_so_bindtodevice() local
350 sock_s = zsock_socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); in test_ipv6_so_bindtodevice()
351 zassert_true(sock_s >= 0, "socket open failed"); in test_ipv6_so_bindtodevice()
353 test_so_bindtodevice(sock_c, sock_s, (struct sockaddr *)&peer_addr_1, in test_ipv6_so_bindtodevice()
366 int sock_s; in test_getpeername() local
408 sock_s = zsock_socket(family, SOCK_STREAM, IPPROTO_TCP); in test_getpeername()
409 zassert_true(sock_s >= 0, "socket open failed"); in test_getpeername()
411 ret = zsock_bind(sock_s, &srv_addr, ADDR_SIZE(family)); in test_getpeername()
414 ret = zsock_listen(sock_s, 1); in test_getpeername()
434 ret = zsock_close(sock_s); in test_getpeername()
455 int sock_s; in test_getsockname_tcp() local
474 sock_s = zsock_socket(family, SOCK_STREAM, IPPROTO_TCP); in test_getsockname_tcp()
475 zassert_true(sock_s >= 0, "socket open failed"); in test_getsockname_tcp()
481 ret = zsock_getsockname(sock_s, &local_addr, &local_addr_len); in test_getsockname_tcp()
486 ret = zsock_bind(sock_s, &srv_addr, ADDR_SIZE(family)); in test_getsockname_tcp()
491 ret = zsock_getsockname(sock_s, &local_addr, &local_addr_len); in test_getsockname_tcp()
496 ret = zsock_listen(sock_s, 1); in test_getsockname_tcp()
514 ret = zsock_close(sock_s); in test_getsockname_tcp()
524 int sock_s; in test_getsockname_udp() local
543 sock_s = zsock_socket(family, SOCK_DGRAM, IPPROTO_UDP); in test_getsockname_udp()
544 zassert_true(sock_s >= 0, "socket open failed"); in test_getsockname_udp()
550 ret = zsock_getsockname(sock_s, &local_addr, &local_addr_len); in test_getsockname_udp()
555 ret = zsock_bind(sock_s, &srv_addr, ADDR_SIZE(family)); in test_getsockname_udp()
560 ret = zsock_getsockname(sock_s, &local_addr, &local_addr_len); in test_getsockname_udp()
580 ret = zsock_close(sock_s); in test_getsockname_udp()