set ip type of service to set specific precedence for QoS

pull/13671/head
Balaji Subramanyam 2020-09-25 14:57:55 -07:00
parent 66423948e0
commit fcb3889445
2 changed files with 7 additions and 0 deletions

View File

@ -664,6 +664,12 @@ nsapi_error_t LWIP::setsockopt(nsapi_socket_t handle, int level, int optname, co
return err_remap(igmp_err);
}
case NSAPI_IPTOS:
if (optlen != sizeof(int)) {
return NSAPI_ERROR_UNSUPPORTED;
}
s->conn->pcb.ip->tos = (u8_t)(*(const int *)optval);
return 0;
default:
return NSAPI_ERROR_UNSUPPORTED;
}

View File

@ -272,6 +272,7 @@ typedef enum nsapi_socket_option {
NSAPI_BIND_TO_DEVICE, /*!< Bind socket network interface name*/
NSAPI_LATENCY, /*!< Read estimated latency to destination */
NSAPI_STAGGER, /*!< Read estimated stagger value to destination */
NSAPI_IPTOS, /*!< Set IP type of service to set specific precedence */
} nsapi_socket_option_t;
typedef enum nsapi_tlssocket_level {