Home
last modified time | relevance | path

Searched refs:optval (Results 1 – 25 of 47) sorted by relevance

12

/Zephyr-latest/tests/net/socket/tcp/src/
Dmain.c504 struct timeval optval = { in ZTEST() local
530 rv = zsock_setsockopt(new_sock, SOL_SOCKET, SO_RCVTIMEO, &optval, in ZTEST()
531 sizeof(optval)); in ZTEST()
1266 int optval; in ZTEST() local
1267 socklen_t optlen = sizeof(optval); in ZTEST()
1276 rv = zsock_getsockopt(sock1, SOL_SOCKET, SO_TYPE, &optval, &optlen); in ZTEST()
1278 zassert_equal(optval, SOCK_STREAM, "getsockopt got invalid type"); in ZTEST()
1279 zassert_equal(optlen, sizeof(optval), "getsockopt got invalid size"); in ZTEST()
1281 rv = zsock_getsockopt(sock2, SOL_SOCKET, SO_TYPE, &optval, &optlen); in ZTEST()
1283 zassert_equal(optval, SOCK_STREAM, "getsockopt got invalid type"); in ZTEST()
[all …]
/Zephyr-latest/subsys/net/lib/sockets/
Dsockets_tls.c761 int optval; in wait() local
762 socklen_t optlen = sizeof(optval); in wait()
765 &optval, &optlen) == 0) { in wait()
767 -optval); in wait()
768 return -optval; in wait()
1456 const void *optval, socklen_t optlen) in tls_opt_sec_tag_list_set() argument
1460 if (!optval) { in tls_opt_sec_tag_list_set()
1474 memcpy(context->options.sec_tag_list.sec_tags, optval, optlen); in tls_opt_sec_tag_list_set()
1481 void *optval, socklen_t *optlen) in sock_opt_protocol_get() argument
1489 *(int *)optval = protocol; in sock_opt_protocol_get()
[all …]
Dsockets_inet.c1615 static int ipv4_multicast_if(struct net_context *ctx, const void *optval, in ipv4_multicast_if() argument
1625 if (optval == NULL || (optlen != sizeof(struct in_addr))) { in ipv4_multicast_if()
1639 ((struct in_addr *)optval)->s_addr = INADDR_ANY; in ipv4_multicast_if()
1649 net_ipaddr_copy((struct in_addr *)optval, &ifaddr->address.in_addr); in ipv4_multicast_if()
1657 if (optval == NULL || (optlen != sizeof(struct ip_mreqn) && in ipv4_multicast_if()
1664 struct ip_mreqn *mreqn = (struct ip_mreqn *)optval; in ipv4_multicast_if()
1679 struct ip_mreq *mreq = (struct ip_mreq *)optval; in ipv4_multicast_if()
1709 void *optval, socklen_t *optlen) in zsock_getsockopt_ctx() argument
1722 *(int *)optval = POINTER_TO_INT(ctx->user_data); in zsock_getsockopt_ctx()
1735 *(int *)optval = type; in zsock_getsockopt_ctx()
[all …]
Dsockets_net_mgmt.c227 int optname, void *optval, socklen_t *optlen) in znet_mgmt_getsockopt() argument
229 if (level != SOL_NET_MGMT_RAW || !optval || !optlen) { in znet_mgmt_getsockopt()
244 mgmt->iface, (void *)optval, *optlen); in znet_mgmt_getsockopt()
263 int optname, const void *optval, in znet_mgmt_setsockopt() argument
266 if (level != SOL_NET_MGMT_RAW || !optval || !optlen) { in znet_mgmt_setsockopt()
281 mgmt->iface, (void *)optval, optlen); in znet_mgmt_setsockopt()
361 void *optval, socklen_t *optlen) in net_mgmt_sock_getsockopt() argument
363 return znet_mgmt_getsockopt(obj, level, optname, optval, optlen); in net_mgmt_sock_getsockopt()
367 const void *optval, socklen_t optlen) in net_mgmt_sock_setsockopt() argument
369 return znet_mgmt_setsockopt(obj, level, optname, optval, optlen); in net_mgmt_sock_setsockopt()
Dsockets_can.c348 void *optval, socklen_t *optlen) in zcan_getsockopt_ctx() argument
350 if (!optval || !optlen) { in zcan_getsockopt_ctx()
356 optval, optlen); in zcan_getsockopt_ctx()
360 const void *optval, socklen_t optlen) in zcan_setsockopt_ctx() argument
363 optval, optlen); in zcan_setsockopt_ctx()
515 void *optval, socklen_t *optlen) in can_sock_getsockopt_vmeth() argument
522 if (optval == NULL) { in can_sock_getsockopt_vmeth()
536 return api->getsockopt(dev, obj, level, optname, optval, in can_sock_getsockopt_vmeth()
540 return zcan_getsockopt_ctx(obj, level, optname, optval, optlen); in can_sock_getsockopt_vmeth()
625 const void *optval, socklen_t optlen) in can_sock_setsockopt_vmeth() argument
[all …]
Dsockets_packet.c364 void *optval, socklen_t *optlen) in zpacket_getsockopt_ctx() argument
366 if (!optval || !optlen) { in zpacket_getsockopt_ctx()
372 optval, optlen); in zpacket_getsockopt_ctx()
376 const void *optval, socklen_t optlen) in zpacket_setsockopt_ctx() argument
379 optval, optlen); in zpacket_setsockopt_ctx()
454 void *optval, socklen_t *optlen) in packet_sock_getsockopt_vmeth() argument
456 return zpacket_getsockopt_ctx(obj, level, optname, optval, optlen); in packet_sock_getsockopt_vmeth()
460 const void *optval, socklen_t optlen) in packet_sock_setsockopt_vmeth() argument
462 return zpacket_setsockopt_ctx(obj, level, optname, optval, optlen); in packet_sock_setsockopt_vmeth()
Dsocket_dispatcher.c303 void *optval, socklen_t *optlen) in sock_dispatch_getsockopt_vmeth() argument
311 return zsock_getsockopt(fd, level, optname, optval, optlen); in sock_dispatch_getsockopt_vmeth()
315 const void *optval, socklen_t optlen) in sock_dispatch_setsockopt_vmeth() argument
321 const struct ifreq *ifreq = optval; in sock_dispatch_setsockopt_vmeth()
366 const int *tls_native = optval; in sock_dispatch_setsockopt_vmeth()
393 return zsock_setsockopt(fd, level, optname, optval, optlen); in sock_dispatch_setsockopt_vmeth()
Dsockets.c848 void *optval, socklen_t *optlen) in z_impl_zsock_getsockopt() argument
854 ret = VTABLE_CALL(getsockopt, sock, level, optname, optval, optlen); in z_impl_zsock_getsockopt()
857 optval, *optlen, ret < 0 ? -errno : ret); in z_impl_zsock_getsockopt()
863 void *optval, socklen_t *optlen) in z_vrfy_zsock_getsockopt() argument
869 if (K_SYSCALL_MEMORY_WRITE(optval, kernel_optlen)) { in z_vrfy_zsock_getsockopt()
874 kernel_optval = k_usermode_alloc_from_copy((const void *)optval, in z_vrfy_zsock_getsockopt()
881 K_OOPS(k_usermode_to_copy((void *)optval, kernel_optval, kernel_optlen)); in z_vrfy_zsock_getsockopt()
893 const void *optval, socklen_t optlen) in z_impl_zsock_setsockopt() argument
898 level, optname, optval, optlen); in z_impl_zsock_setsockopt()
900 ret = VTABLE_CALL(setsockopt, sock, level, optname, optval, optlen); in z_impl_zsock_setsockopt()
[all …]
/Zephyr-latest/tests/net/socket/udp/src/
Dmain.c330 uint8_t optval; in ZTEST() local
341 optval = 2; in ZTEST()
342 rv = zsock_setsockopt(sock1, SOL_SOCKET, SO_PRIORITY, &optval, in ZTEST()
343 sizeof(optval)); in ZTEST()
346 optval = 6; in ZTEST()
347 rv = zsock_setsockopt(sock2, SOL_SOCKET, SO_PRIORITY, &optval, in ZTEST()
348 sizeof(optval)); in ZTEST()
710 int optval; in ZTEST() local
711 socklen_t optsize = sizeof(optval); in ZTEST()
716 rv = zsock_getsockopt(sock1, SOL_SOCKET, SO_TYPE, &optval, &optsize); in ZTEST()
[all …]
/Zephyr-latest/tests/net/pmtu/src/
Dmain.c788 int optval; in ZTEST() local
799 optval = 0; optlen = sizeof(int); in ZTEST()
800 ret = zsock_getsockopt(client_sock, IPPROTO_IP, IP_MTU, &optval, &optlen); in ZTEST()
804 zexpect_equal(optval, 4096, "setsockopt mtu (%d)", optval); in ZTEST()
806 optval = 0; optlen = sizeof(int); in ZTEST()
807 ret = zsock_setsockopt(client_sock, IPPROTO_IP, IP_MTU, &optval, optlen); in ZTEST()
811 zexpect_equal(optval, 0, "setsockopt mtu (%d)", optval); in ZTEST()
827 int optval; in ZTEST() local
838 optval = 0; optlen = sizeof(int); in ZTEST()
839 ret = zsock_getsockopt(client_sock, IPPROTO_IPV6, IPV6_MTU, &optval, &optlen); in ZTEST()
[all …]
/Zephyr-latest/include/zephyr/net/
Dcanbus.h42 const void *optval, socklen_t optlen);
47 const void *optval, socklen_t *optlen);
Dconn_mgr_connectivity.h166 int conn_mgr_if_set_opt(struct net_if *iface, int optname, const void *optval, size_t optlen);
194 int conn_mgr_if_get_opt(struct net_if *iface, int optname, void *optval, size_t *optlen);
Dconn_mgr_connectivity_impl.h97 int optname, const void *optval, size_t optlen);
115 int optname, void *optval, size_t *optlen);
/Zephyr-latest/drivers/net/
Dnsos_sockets.c1024 void *optval, socklen_t *optlen) in nsos_getsockopt_int() argument
1035 NSOS_MID_SO_KEEPALIVE, optval, &nsos_mid_optlen); in nsos_getsockopt_int()
1047 void *optval, socklen_t *optlen) in nsos_getsockopt() argument
1070 *(int *)optval = errno_from_nsos_mid(nsos_mid_err); in nsos_getsockopt()
1090 err = socket_type_from_nsos_mid(nsos_mid_type, optval); in nsos_getsockopt()
1114 err = socket_proto_from_nsos_mid(nsos_mid_proto, optval); in nsos_getsockopt()
1138 err = socket_family_from_nsos_mid(nsos_mid_family, optval); in nsos_getsockopt()
1149 optval, optlen); in nsos_getsockopt()
1153 optval, optlen); in nsos_getsockopt()
1157 optval, optlen); in nsos_getsockopt()
[all …]
Dcanbus.c60 int optname, const void *optval, socklen_t optlen) in net_canbus_setsockopt() argument
74 ret = can_add_rx_filter(cfg->can_dev, net_canbus_recv, context, optval); in net_canbus_setsockopt()
/Zephyr-latest/samples/net/sockets/echo_server/src/
Dudp.c39 int optval; in start_udp_proto() local
83 optval = IPV6_PREFER_SRC_PUBLIC; in start_udp_proto()
86 &optval, sizeof(optval)); in start_udp_proto()
92 optval = 1; in start_udp_proto()
94 &optval, sizeof(optval)); in start_udp_proto()
Dtcp.c71 int optval; in start_tcp_proto() local
106 optval = IPV6_PREFER_SRC_PUBLIC; in start_tcp_proto()
109 &optval, sizeof(optval)); in start_tcp_proto()
115 optval = 1; in start_tcp_proto()
117 &optval, sizeof(optval)); in start_tcp_proto()
/Zephyr-latest/subsys/net/lib/mqtt_sn/
Dmqtt_sn_transport_udp.c49 int optval; in tp_udp_init() local
59 optval = 1; in tp_udp_init()
60 err = zsock_setsockopt(udp->sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)); in tp_udp_init()
132 optval = CONFIG_MQTT_SN_LIB_BROADCAST_RADIUS; in tp_udp_init()
133 err = zsock_setsockopt(udp->sock, IPPROTO_IP, IP_MULTICAST_TTL, &optval, sizeof(optval)); in tp_udp_init()
/Zephyr-latest/tests/net/conn_mgr_conn/src/
Dtest_conn_impl.c151 const void *optval, size_t optlen) in test_set_opt_a() argument
169 (void)memcpy(target, optval, len); in test_set_opt_a()
175 void *optval, size_t *optlen) in test_get_opt_a() argument
196 (void)memset(optval, 0, len); in test_get_opt_a()
197 (void)memcpy(optval, target, len-1); in test_get_opt_a()
/Zephyr-latest/subsys/net/conn_mgr/
Dconn_mgr_connectivity.c103 int conn_mgr_if_get_opt(struct net_if *iface, int optname, void *optval, size_t *optlen) in conn_mgr_if_get_opt() argument
113 if (!optval) { in conn_mgr_if_get_opt()
132 status = api->get_opt(binding, optname, optval, optlen); in conn_mgr_if_get_opt()
139 int conn_mgr_if_set_opt(struct net_if *iface, int optname, const void *optval, size_t optlen) in conn_mgr_if_set_opt() argument
145 if (!optval) { in conn_mgr_if_set_opt()
161 status = api->set_opt(binding, optname, optval, optlen); in conn_mgr_if_set_opt()
/Zephyr-latest/tests/net/socket/tls/src/
Dmain.c208 int optval; in ZTEST() local
209 socklen_t optlen = sizeof(optval); in ZTEST()
214 rv = zsock_getsockopt(sock1, SOL_SOCKET, SO_TYPE, &optval, &optlen); in ZTEST()
216 zassert_equal(optval, SOCK_STREAM, "getsockopt got invalid type"); in ZTEST()
217 zassert_equal(optlen, sizeof(optval), "getsockopt got invalid size"); in ZTEST()
219 rv = zsock_getsockopt(sock2, SOL_SOCKET, SO_TYPE, &optval, &optlen); in ZTEST()
221 zassert_equal(optval, SOCK_STREAM, "getsockopt got invalid type"); in ZTEST()
222 zassert_equal(optlen, sizeof(optval), "getsockopt got invalid size"); in ZTEST()
233 int optval; in ZTEST() local
234 socklen_t optlen = sizeof(optval); in ZTEST()
[all …]
/Zephyr-latest/include/zephyr/posix/sys/
Dsocket.h35 int getsockopt(int sock, int level, int optname, void *optval, socklen_t *optlen);
45 int setsockopt(int sock, int level, int optname, const void *optval, socklen_t optlen);
/Zephyr-latest/drivers/wifi/simplelink/
Dsimplelink_sockets.c650 static int map_credentials(int sd, const void *optval, socklen_t optlen) in map_credentials() argument
652 sec_tag_t *sec_tags = (sec_tag_t *)optval; in map_credentials()
706 static int map_credentials(int sd, const void *optval, socklen_t optlen) in map_credentials() argument
716 const void *optval, socklen_t optlen) in simplelink_setsockopt() argument
726 retval = map_credentials(sd, optval, optlen); in simplelink_setsockopt()
735 (const char *)optval, optlen); in simplelink_setsockopt()
738 if (optval) { in simplelink_setsockopt()
749 if (*(uint32_t *)optval != 2U) { in simplelink_setsockopt()
775 if (optval) { in simplelink_setsockopt()
779 if (*(uint32_t *)optval) { in simplelink_setsockopt()
[all …]
/Zephyr-latest/tests/net/socket/offload_dispatcher/src/
Dmain.c192 void *optval, socklen_t *optlen) in offload_getsockopt() argument
198 ARG_UNUSED(optval); in offload_getsockopt()
207 const void *optval, socklen_t optlen) in offload_setsockopt() argument
213 ARG_UNUSED(optval); in offload_setsockopt()
604 struct timeval optval = { 0 }; in ZTEST() local
605 socklen_t optlen = sizeof(optval); in ZTEST()
608 &optval, &optlen); in ZTEST()
622 struct timeval optval = { 0 }; in ZTEST() local
625 &optval, sizeof(optval)); in ZTEST()
/Zephyr-latest/samples/net/sockets/echo_client/src/
Dtcp.c93 int optval; in start_tcp_proto() local
167 optval = IPV6_PREFER_SRC_TMP; in start_tcp_proto()
170 &optval, sizeof(optval)); in start_tcp_proto()

12