Lines Matching refs:optval

199 #define LWIP_SO_SNDRCVTIMEO_SET(optval, val) (*(int *)(optval) = (val))
200 #define LWIP_SO_SNDRCVTIMEO_GET_MS(optval) ((long)*(const int*)(optval))
203 #define LWIP_SO_SNDRCVTIMEO_SET(optval, val) do { \
205 ((struct timeval *)(optval))->tv_sec = (long)((loc) / 1000U); \
206 ((struct timeval *)(optval))->tv_usec = (long)(((loc) % 1000U) * 1000U); }while(0)
207 #define LWIP_SO_SNDRCVTIMEO_GET_MS(optval) ((((const struct timeval *)(optval))->tv_sec * 1000) + (((const struct timeval *)(optval))->tv_usec / 1000))
306 static int lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *optlen);
307 static int lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_t optlen);
2837 lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
2850 if ((NULL == optval) || (NULL == optlen)) {
2859 err = lwip_getsockopt_impl(s, level, optname, optval, optlen);
2865 /* MPU_COMPATIBLE copies the optval data, so check for max size here */
2879 LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optval.p = optval;
2896 /* write back optlen and optval */
2899 MEMCPY(optval, LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optval,
2926 data->optval,
2928 data->optval.p,
2960 lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *optlen)
2969 if (LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, &err)) {
2988 *(int *)optval = 1;
2990 *(int *)optval = 0;
3010 *(int *)optval = ip_get_option(sock->conn->pcb.ip, optname);
3012 s, optname, (*(int *)optval ? "on" : "off")));
3019 *(int *)optval = SOCK_RAW;
3022 *(int *)optval = SOCK_STREAM;
3025 *(int *)optval = SOCK_DGRAM;
3028 *(int *)optval = netconn_type(sock->conn);
3031 s, *(int *)optval));
3034 s, *(int *)optval));
3039 *(int *)optval = err_to_errno(netconn_err(sock->conn));
3041 s, *(int *)optval));
3047 LWIP_SO_SNDRCVTIMEO_SET(optval, netconn_get_sendtimeout(sock->conn));
3053 LWIP_SO_SNDRCVTIMEO_SET(optval, netconn_get_recvtimeout(sock->conn));
3059 *(int *)optval = netconn_get_recvbufsize(sock->conn);
3065 struct linger *linger = (struct linger *)optval;
3088 *(int *)optval = udp_is_flag_set(sock->conn->pcb.udp, UDP_FLAGS_NOCHKSUM) ? 1 : 0;
3104 *(int *)optval = sock->conn->pcb.ip->ttl;
3106 s, *(int *)optval));
3110 *(int *)optval = sock->conn->pcb.ip->tos;
3112 s, *(int *)optval));
3121 *(u8_t *)optval = udp_get_multicast_ttl(sock->conn->pcb.udp);
3123 s, *(int *)optval));
3131 inet_addr_from_ip4addr((struct in_addr *)optval, udp_get_multicast_netif_addr(sock->conn->pcb.udp));
3133 s, *(u32_t *)optval));
3138 *(u8_t *)optval = 1;
3140 *(u8_t *)optval = 0;
3143 s, *(int *)optval));
3165 *(int *)optval = tcp_nagle_disabled(sock->conn->pcb.tcp);
3167 s, (*(int *)optval) ? "on" : "off") );
3170 *(int *)optval = (int)sock->conn->pcb.tcp->keep_idle;
3172 s, *(int *)optval));
3177 *(int *)optval = (int)(sock->conn->pcb.tcp->keep_idle / 1000);
3179 s, *(int *)optval));
3182 *(int *)optval = (int)(sock->conn->pcb.tcp->keep_intvl / 1000);
3184 s, *(int *)optval));
3187 *(int *)optval = (int)sock->conn->pcb.tcp->keep_cnt;
3189 s, *(int *)optval));
3207 *(int *)optval = (netconn_get_ipv6only(sock->conn) ? 1 : 0);
3209 s, *(int *)optval));
3232 *(int *)optval = sock->conn->pcb.udp->chksum_len_tx;
3234 s, (*(int *)optval)) );
3237 *(int *)optval = sock->conn->pcb.udp->chksum_len_rx;
3239 s, (*(int *)optval)) );
3256 *(int *)optval = -1;
3258 *(int *)optval = sock->conn->pcb.raw->chksum_offset;
3261 s, (*(int *)optval)) );
3283 lwip_setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen)
3296 if (NULL == optval) {
3305 err = lwip_setsockopt_impl(s, level, optname, optval, optlen);
3314 /* MPU_COMPATIBLE copies the optval data, so check for max size here */
3328 MEMCPY(LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optval, optval, optlen);
3330 LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optval.pc = (const void *)optval;
3370 data->optval,
3372 data->optval.pc,
3384 lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_t optlen)
3393 if (LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, &err)) {
3421 if (*(const int *)optval) {
3427 s, optname, (*(const int *)optval ? "on" : "off")));
3437 ms_long = LWIP_SO_SNDRCVTIMEO_GET_MS(optval);
3450 ms_long = LWIP_SO_SNDRCVTIMEO_GET_MS(optval);
3462 netconn_set_recvbufsize(sock->conn, *(const int *)optval);
3467 const struct linger *linger = (const struct linger *)optval;
3495 if (*(const int *)optval) {
3508 iface = (const struct ifreq *)optval;
3552 sock->conn->pcb.ip->ttl = (u8_t)(*(const int *)optval);
3558 sock->conn->pcb.ip->tos = (u8_t)(*(const int *)optval);
3565 if (*(const int *)optval) {
3575 udp_set_multicast_ttl(sock->conn->pcb.udp, (u8_t)(*(const u8_t *)optval));
3580 inet_addr_to_ip4addr(&if_addr, (const struct in_addr *)optval);
3586 if (*(const u8_t *)optval) {
3598 const struct ip_mreq *imr = (const struct ip_mreq *)optval;
3641 if (*(const int *)optval) {
3647 s, (*(const int *)optval) ? "on" : "off") );
3650 sock->conn->pcb.tcp->keep_idle = (u32_t)(*(const int *)optval);
3657 sock->conn->pcb.tcp->keep_idle = 1000 * (u32_t)(*(const int *)optval);
3662 sock->conn->pcb.tcp->keep_intvl = 1000 * (u32_t)(*(const int *)optval);
3667 sock->conn->pcb.tcp->keep_cnt = (u32_t)(*(const int *)optval);
3687 if (*(const int *)optval) {
3702 const struct ipv6_mreq *imr = (const struct ipv6_mreq *)optval;
3755 if ((*(const int *)optval != 0) && ((*(const int *)optval < 8) || (*(const int *)optval > 0xffff))) {
3759 sock->conn->pcb.udp->chksum_len_tx = (u16_t) * (const int *)optval;
3762 s, (*(const int *)optval)) );
3765 if ((*(const int *)optval != 0) && ((*(const int *)optval < 8) || (*(const int *)optval > 0xffff))) {
3769 sock->conn->pcb.udp->chksum_len_rx = (u16_t) * (const int *)optval;
3772 s, (*(const int *)optval)) );
3795 if (*(const int *)optval < 0) {
3797 } else if (*(const int *)optval & 1) {
3803 sock->conn->pcb.raw->chksum_offset = (u16_t) * (const int *)optval;