Home
last modified time | relevance | path

Searched refs:sockaddr (Results 1 – 25 of 202) sorted by relevance

123456789

/Zephyr-Core-3.6.0/tests/net/socket/
Dsocket_helpers.h32 ret = bind(sock, (struct sockaddr *)addr, sizeof(*addr)); in prepare_listen_sock_udp_v4()
51 ret = bind(sock, (struct sockaddr *)addr, sizeof(*addr)); in prepare_listen_sock_udp_v6()
58 int *sock, struct sockaddr_in *sockaddr) in prepare_sock_udp_v4() argument
64 zassert_not_null(sockaddr, "null sockaddr"); in prepare_sock_udp_v4()
69 sockaddr->sin_family = AF_INET; in prepare_sock_udp_v4()
70 sockaddr->sin_port = htons(port); in prepare_sock_udp_v4()
71 rv = inet_pton(AF_INET, addr, &sockaddr->sin_addr); in prepare_sock_udp_v4()
76 int *sock, struct sockaddr_in6 *sockaddr) in prepare_sock_udp_v6() argument
82 zassert_not_null(sockaddr, "null sockaddr"); in prepare_sock_udp_v6()
87 (void)memset(sockaddr, 0, sizeof(*sockaddr)); in prepare_sock_udp_v6()
[all …]
/Zephyr-Core-3.6.0/samples/net/sockets/net_mgmt/src/
Dmain.c91 struct sockaddr_nm sockaddr; in listener() local
104 memset(&sockaddr, 0, sizeof(sockaddr)); in listener()
106 sockaddr.nm_family = AF_NET_MGMT; in listener()
107 sockaddr.nm_ifindex = 0; /* Any network interface */ in listener()
108 sockaddr.nm_pid = (uintptr_t)k_current_get(); in listener()
109 sockaddr.nm_mask = NET_EVENT_IPV6_DAD_SUCCEED | in listener()
113 ret = bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); in listener()
126 (struct sockaddr *)&event_addr, in listener()
/Zephyr-Core-3.6.0/tests/net/socket/af_packet/src/
Dmain.c125 return bind(sock, (struct sockaddr *)&addr, sizeof(addr)); in bind_socket()
175 static int prepare_udp_socket(struct sockaddr_in *sockaddr, uint16_t local_port) in prepare_udp_socket() argument
182 sockaddr->sin_family = AF_INET; in prepare_udp_socket()
183 sockaddr->sin_port = htons(local_port); in prepare_udp_socket()
184 ret = inet_pton(AF_INET, IPV4_ADDR, &sockaddr->sin_addr); in prepare_udp_socket()
188 ret = bind(sock, (struct sockaddr *) sockaddr, sizeof(*sockaddr)); in prepare_udp_socket()
225 struct sockaddr_in sockaddr; in ZTEST() local
233 sock3 = prepare_udp_socket(&sockaddr, DST_PORT); in ZTEST()
236 sock4 = prepare_udp_socket(&sockaddr, SRC_PORT); in ZTEST()
238 sockaddr.sin_port = htons(DST_PORT); in ZTEST()
[all …]
/Zephyr-Core-3.6.0/tests/net/socket/udp/src/
Dmain.c60 struct sockaddr *client_addr, in comm_sendto_recvfrom()
63 struct sockaddr *server_addr, in comm_sendto_recvfrom()
69 struct sockaddr addr; in comm_sendto_recvfrom()
71 struct sockaddr addr2; in comm_sendto_recvfrom()
181 (struct sockaddr *)&server_addr, in ZTEST()
186 (struct sockaddr *)&client_addr, in ZTEST()
189 (struct sockaddr *)&server_addr, in ZTEST()
210 (struct sockaddr *)&server_addr, sizeof(server_addr)); in ZTEST()
214 (struct sockaddr *)&client_addr, in ZTEST()
217 (struct sockaddr *)&server_addr, in ZTEST()
[all …]
/Zephyr-Core-3.6.0/tests/net/socket/reuseaddr_reuseport/src/
Dmain.c72 int *sock, struct sockaddr *addr) in prepare_sock_tcp()
88 int *sock, struct sockaddr *addr) in prepare_sock_udp()
145 static void test_bind_success(int sock, const struct sockaddr *addr, socklen_t addrlen) in test_bind_success()
152 static void test_bind_fail(int sock, const struct sockaddr *addr, socklen_t addrlen) in test_bind_fail()
168 static void test_connect_success(int sock, const struct sockaddr *addr, socklen_t addrlen) in test_connect_success()
180 static void test_connect_fail(int sock, const struct sockaddr *addr, socklen_t addrlen) in test_connect_fail()
189 static int test_accept(int sock, struct sockaddr *addr, socklen_t *addrlen) in test_accept()
199 const struct sockaddr *dest_addr, socklen_t addrlen) in test_sendto()
207 struct sockaddr *src_addr, socklen_t *addrlen) in test_recvfrom_success()
215 struct sockaddr *src_addr, socklen_t *addrlen) in test_recvfrom_fail()
[all …]
/Zephyr-Core-3.6.0/subsys/net/ip/
Dconnection.h58 struct sockaddr remote_addr;
61 struct sockaddr local_addr;
107 const struct sockaddr *remote_addr,
108 const struct sockaddr *local_addr,
117 const struct sockaddr *remote_addr, in net_conn_register()
118 const struct sockaddr *local_addr, in net_conn_register()
/Zephyr-Core-3.6.0/include/zephyr/posix/sys/
Dsocket.h47 static inline int bind(int sock, const struct sockaddr *addr, socklen_t addrlen) in bind()
52 static inline int connect(int sock, const struct sockaddr *addr, in connect()
63 static inline int accept(int sock, struct sockaddr *addr, socklen_t *addrlen) in accept()
79 const struct sockaddr *dest_addr, in sendto()
92 struct sockaddr *src_addr, socklen_t *addrlen) in recvfrom()
109 static inline int getpeername(int sock, struct sockaddr *addr, in getpeername()
115 static inline int getsockname(int sock, struct sockaddr *addr, in getsockname()
/Zephyr-Core-3.6.0/tests/net/socket/tcp/src/
Dmain.c37 static void test_bind(int sock, struct sockaddr *addr, socklen_t addrlen) in test_bind()
51 static void test_connect(int sock, struct sockaddr *addr, socklen_t addrlen) in test_connect()
71 const struct sockaddr *addr, socklen_t addrlen) in test_sendto()
78 static void test_accept(int sock, int *new_sock, struct sockaddr *addr, in test_accept()
87 static void test_accept_timeout(int sock, int *new_sock, struct sockaddr *addr, in test_accept_timeout()
118 struct sockaddr *addr, in test_recvfrom()
242 struct sockaddr addr; in ZTEST_USER()
248 test_bind(s_sock, (struct sockaddr *)&s_saddr, sizeof(s_saddr)); in ZTEST_USER()
251 test_connect(c_sock, (struct sockaddr *)&s_saddr, sizeof(s_saddr)); in ZTEST_USER()
277 struct sockaddr addr; in ZTEST_USER()
[all …]
/Zephyr-Core-3.6.0/subsys/net/lib/sockets/
Dsockets_internal.h59 int (*bind)(void *obj, const struct sockaddr *addr, socklen_t addrlen);
60 int (*connect)(void *obj, const struct sockaddr *addr,
63 int (*accept)(void *obj, struct sockaddr *addr, socklen_t *addrlen);
65 const struct sockaddr *dest_addr, socklen_t addrlen);
67 struct sockaddr *src_addr, socklen_t *addrlen);
74 int (*getpeername)(void *obj, struct sockaddr *addr,
76 int (*getsockname)(void *obj, struct sockaddr *addr,
/Zephyr-Core-3.6.0/include/zephyr/net/
Dsocket.h287 struct sockaddr *ai_addr; /**< Pointer to the address */
291 struct sockaddr _ai_addr;
407 __syscall int zsock_bind(int sock, const struct sockaddr *addr,
422 __syscall int zsock_connect(int sock, const struct sockaddr *addr,
451 __syscall int zsock_accept(int sock, struct sockaddr *addr, socklen_t *addrlen);
466 int flags, const struct sockaddr *dest_addr,
515 int flags, struct sockaddr *src_addr,
646 __syscall int zsock_getpeername(int sock, struct sockaddr *addr,
661 __syscall int zsock_getsockname(int sock, struct sockaddr *addr,
818 int zsock_getnameinfo(const struct sockaddr *addr, socklen_t addrlen,
[all …]
Dnet_offload.h63 const struct sockaddr *addr,
77 const struct sockaddr *addr,
104 const struct sockaddr *dst_addr,
170 const struct sockaddr *addr, in net_offload_bind()
234 const struct sockaddr *addr, in net_offload_connect()
365 const struct sockaddr *dst_addr, in net_offload_sendto()
468 const struct sockaddr *addr,
483 const struct sockaddr *addr,
512 const struct sockaddr *dst_addr,
Dcoap.h231 struct sockaddr *addr, socklen_t addr_len);
262 struct sockaddr addr;
310 const struct sockaddr *from);
328 struct sockaddr addr; /**< Remote address */
639 struct sockaddr *addr, socklen_t addr_len);
661 struct sockaddr *addr, socklen_t addr_len);
894 const struct sockaddr *addr);
935 const struct sockaddr *addr,
953 const struct sockaddr *addr);
1012 const struct sockaddr *addr,
[all …]
Ddns_resolve.h91 struct sockaddr ai_addr;
172 struct sockaddr dns_server;
278 const struct sockaddr *dns_servers_sa[]);
322 const struct sockaddr *servers_sa[]);
Dcoap_service.h242 const struct sockaddr *addr, socklen_t addr_len,
258 const struct sockaddr *addr, socklen_t addr_len,
275 const struct sockaddr *addr);
287 const struct sockaddr *addr);
/Zephyr-Core-3.6.0/tests/net/socket/socketpair/src/
Dunsupported_calls.c19 res = bind(fixture->sv[i], (struct sockaddr *)&addr, len); in ZTEST_USER_F()
25 res = connect(fixture->sv[i], (struct sockaddr *)&addr, len); in ZTEST_USER_F()
37 res = accept(fixture->sv[i], (struct sockaddr *)&addr, &len); in ZTEST_USER_F()
/Zephyr-Core-3.6.0/tests/net/lib/coap_client/src/
Dmain.c35 struct sockaddr *src_addr, socklen_t *addrlen) in z_impl_zsock_recvfrom_custom_fake()
61 int flags, const struct sockaddr *dest_addr, in z_impl_zsock_sendto_custom_fake()
83 int flags, const struct sockaddr *dest_addr, in z_impl_zsock_sendto_custom_fake_echo()
120 int flags, const struct sockaddr *dest_addr, in z_impl_zsock_sendto_custom_fake_echo_next_req()
165 int flags, struct sockaddr *src_addr, in z_impl_zsock_recvfrom_custom_fake_response()
192 struct sockaddr *src_addr, in z_impl_zsock_recvfrom_custom_fake_delayed_response()
219 int flags, struct sockaddr *src_addr, in z_impl_zsock_recvfrom_custom_fake_empty_ack()
247 int flags, struct sockaddr *src_addr, in z_impl_zsock_recvfrom_custom_fake_unmatching()
273 int flags, struct sockaddr *src_addr, in z_impl_zsock_recvfrom_custom_fake_echo()
303 int flags, struct sockaddr *src_addr, in z_impl_zsock_recvfrom_custom_fake_echo_next_req()
[all …]
Dstubs.h26 DECLARE_FAKE_VALUE_FUNC(ssize_t, z_impl_zsock_recvfrom, int, void *, size_t, int, struct sockaddr *,
29 const struct sockaddr *, socklen_t);
Dstubs.c14 DEFINE_FAKE_VALUE_FUNC(ssize_t, z_impl_zsock_recvfrom, int, void *, size_t, int, struct sockaddr *,
17 const struct sockaddr *, socklen_t);
/Zephyr-Core-3.6.0/tests/net/socket/getnameinfo/src/
Dmain.c25 ret = getnameinfo((struct sockaddr *)&saddr, sizeof(saddr), in ZTEST_USER()
36 ret = getnameinfo((struct sockaddr *)&saddr, sizeof(saddr), in ZTEST_USER()
55 ret = getnameinfo((struct sockaddr *)&saddr, sizeof(saddr), in ZTEST_USER()
68 ret = getnameinfo((struct sockaddr *)&saddr, sizeof(saddr), in ZTEST_USER()
/Zephyr-Core-3.6.0/subsys/net/lib/socks/
Dsocks.h24 const struct sockaddr *dest,
28 const struct sockaddr *dest, in net_socks5_connect()
/Zephyr-Core-3.6.0/subsys/mgmt/mcumgr/transport/src/
Dsmp_udp.c45 BUILD_ASSERT(sizeof(struct sockaddr) <= CONFIG_MCUMGR_TRANSPORT_NETBUF_USER_DATA_SIZE,
109 struct sockaddr *addr = net_buf_user_data(nb); in smp_udp4_tx()
133 struct sockaddr *addr = net_buf_user_data(nb); in smp_udp6_tx()
162 struct sockaddr *src_ud = net_buf_user_data(src); in smp_udp_ud_copy()
163 struct sockaddr *dst_ud = net_buf_user_data(dst); in smp_udp_ud_copy()
174 struct sockaddr *addr; in create_socket()
190 addr = (struct sockaddr *)&addr4; in create_socket()
200 addr = (struct sockaddr *)&addr6; in create_socket()
247 struct sockaddr addr; in smp_udp_receive_thread()
255 struct sockaddr *ud; in smp_udp_receive_thread()
/Zephyr-Core-3.6.0/tests/net/socket/offload_dispatcher/src/
Dmain.c96 static int offload_bind(void *obj, const struct sockaddr *addr, in offload_bind()
109 static int offload_connect(void *obj, const struct sockaddr *addr, in offload_connect()
133 static int offload_accept(void *obj, struct sockaddr *addr, socklen_t *addrlen) in offload_accept()
146 int flags, const struct sockaddr *dest_addr, in offload_sendto()
175 int flags, struct sockaddr *src_addr, in offload_recvfrom()
221 static int offload_getpeername(void *obj, struct sockaddr *addr, in offload_getpeername()
234 static int offload_getsockname(void *obj, struct sockaddr *addr, in offload_getsockname()
508 ret = zsock_bind(test_sock, (struct sockaddr *)&addr, sizeof(addr)); in ZTEST()
524 ret = zsock_connect(test_sock, (struct sockaddr *)&addr, sizeof(addr)); in ZTEST()
556 ret = zsock_accept(test_sock, (struct sockaddr *)&addr, &addrlen); in ZTEST()
[all …]
/Zephyr-Core-3.6.0/tests/net/socket/net_mgmt/src/
Dmain.c360 struct sockaddr_nm sockaddr; in test_net_mgmt_setup() local
379 memset(&sockaddr, 0, sizeof(sockaddr)); in test_net_mgmt_setup()
381 sockaddr.nm_family = AF_NET_MGMT; in test_net_mgmt_setup()
382 sockaddr.nm_ifindex = net_if_get_by_iface(default_iface); in test_net_mgmt_setup()
383 sockaddr.nm_pid = (uintptr_t)k_current_get(); in test_net_mgmt_setup()
384 sockaddr.nm_mask = NET_EVENT_IPV6_DAD_SUCCEED | in test_net_mgmt_setup()
388 ret = bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); in test_net_mgmt_setup()
410 (struct sockaddr *)&event_addr, in test_net_mgmt_catch_events()
472 (struct sockaddr *)&event_addr, in test_net_mgmt_catch_events_failure()
/Zephyr-Core-3.6.0/tests/net/lib/lwm2m/lwm2m_engine/src/
Dstubs.c29 struct sockaddr *);
94 DEFINE_FAKE_VALUE_FUNC(int, z_impl_zsock_connect, int, const struct sockaddr *, socklen_t);
97 const struct sockaddr *dest_addr, socklen_t addrlen) in z_impl_zsock_sendto()
110 struct sockaddr *src_addr, socklen_t *addrlen) in z_impl_zsock_recvfrom()
/Zephyr-Core-3.6.0/subsys/net/lib/zperf/
Dzperf_tcp_receiver.c37 static struct sockaddr tcp_server_addr;
40 static struct sockaddr sock_addr[SOCK_ID_MAX];
47 static void tcp_received(const struct sockaddr *addr, size_t datalen) in tcp_received()
114 memset(&sock_addr[i], 0, sizeof(struct sockaddr)); in tcp_receiver_cleanup()
129 struct sockaddr addr_incoming_conn; in tcp_recv_data()
131 socklen_t addrlen = sizeof(struct sockaddr); in tcp_recv_data()
217 memset(&sock_addr[i], 0, sizeof(struct sockaddr)); in tcp_recv_data()
247 struct sockaddr *address) in tcp_bind_listen_connection()
408 memcpy(&tcp_server_addr, &param->addr, sizeof(struct sockaddr)); in zperf_tcp_download()

123456789