Lines Matching full:family
358 #define ADDR_SIZE(family) ((family == AF_INET) ? \ argument
362 void test_getpeername(int family) in test_getpeername() argument
371 srv_addr.sa_family = family; in test_getpeername()
372 if (family == AF_INET) { in test_getpeername()
384 sock_c = zsock_socket(family, SOCK_DGRAM, IPPROTO_UDP); in test_getpeername()
387 peer_addr_len = ADDR_SIZE(family); in test_getpeername()
392 ret = zsock_connect(sock_c, &srv_addr, ADDR_SIZE(family)); in test_getpeername()
396 peer_addr_len = ADDR_SIZE(family); in test_getpeername()
399 zassert_mem_equal(&peer_addr, &srv_addr, ADDR_SIZE(family), in test_getpeername()
406 sock_c = zsock_socket(family, SOCK_STREAM, IPPROTO_TCP); in test_getpeername()
408 sock_s = zsock_socket(family, SOCK_STREAM, IPPROTO_TCP); in test_getpeername()
411 ret = zsock_bind(sock_s, &srv_addr, ADDR_SIZE(family)); in test_getpeername()
417 peer_addr_len = ADDR_SIZE(family); in test_getpeername()
422 ret = zsock_connect(sock_c, &srv_addr, ADDR_SIZE(family)); in test_getpeername()
426 peer_addr_len = ADDR_SIZE(family); in test_getpeername()
429 zassert_mem_equal(&peer_addr, &srv_addr, ADDR_SIZE(family), in test_getpeername()
451 void test_getsockname_tcp(int family) in test_getsockname_tcp() argument
457 socklen_t local_addr_len = ADDR_SIZE(family); in test_getsockname_tcp()
460 srv_addr.sa_family = family; in test_getsockname_tcp()
461 if (family == AF_INET) { in test_getsockname_tcp()
472 sock_c = zsock_socket(family, SOCK_STREAM, IPPROTO_TCP); in test_getsockname_tcp()
474 sock_s = zsock_socket(family, SOCK_STREAM, IPPROTO_TCP); in test_getsockname_tcp()
486 ret = zsock_bind(sock_s, &srv_addr, ADDR_SIZE(family)); in test_getsockname_tcp()
490 local_addr_len = ADDR_SIZE(family); in test_getsockname_tcp()
493 zassert_mem_equal(&local_addr, &srv_addr, ADDR_SIZE(family), in test_getsockname_tcp()
500 ret = zsock_connect(sock_c, &srv_addr, ADDR_SIZE(family)); in test_getsockname_tcp()
504 local_addr_len = ADDR_SIZE(family); in test_getsockname_tcp()
507 zassert_equal(local_addr.sa_family, family, "wrong family"); in test_getsockname_tcp()
520 void test_getsockname_udp(int family) in test_getsockname_udp() argument
526 socklen_t local_addr_len = ADDR_SIZE(family); in test_getsockname_udp()
529 srv_addr.sa_family = family; in test_getsockname_udp()
530 if (family == AF_INET) { in test_getsockname_udp()
541 sock_c = zsock_socket(family, SOCK_DGRAM, IPPROTO_UDP); in test_getsockname_udp()
543 sock_s = zsock_socket(family, SOCK_DGRAM, IPPROTO_UDP); in test_getsockname_udp()
555 ret = zsock_bind(sock_s, &srv_addr, ADDR_SIZE(family)); in test_getsockname_udp()
559 local_addr_len = ADDR_SIZE(family); in test_getsockname_udp()
562 zassert_mem_equal(&local_addr, &srv_addr, ADDR_SIZE(family), in test_getsockname_udp()
566 ret = zsock_connect(sock_c, &srv_addr, ADDR_SIZE(family)); in test_getsockname_udp()
570 local_addr_len = ADDR_SIZE(family); in test_getsockname_udp()
573 zassert_equal(local_addr.sa_family, family, "wrong family"); in test_getsockname_udp()
791 zassert_equal(addr.sa_family, AF_INET6, "wrong family"); in test_ipv4_mapped_to_ipv6_server()