Skip to content

Commit fcb3889

Browse files
committed
set ip type of service to set specific precedence for QoS
1 parent 6642394 commit fcb3889

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

connectivity/lwipstack/source/LWIPStack.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,12 @@ nsapi_error_t LWIP::setsockopt(nsapi_socket_t handle, int level, int optname, co
664664
return err_remap(igmp_err);
665665
}
666666

667+
case NSAPI_IPTOS:
668+
if (optlen != sizeof(int)) {
669+
return NSAPI_ERROR_UNSUPPORTED;
670+
}
671+
s->conn->pcb.ip->tos = (u8_t)(*(const int *)optval);
672+
return 0;
667673
default:
668674
return NSAPI_ERROR_UNSUPPORTED;
669675
}

connectivity/netsocket/include/netsocket/nsapi_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ typedef enum nsapi_socket_option {
272272
NSAPI_BIND_TO_DEVICE, /*!< Bind socket network interface name*/
273273
NSAPI_LATENCY, /*!< Read estimated latency to destination */
274274
NSAPI_STAGGER, /*!< Read estimated stagger value to destination */
275+
NSAPI_IPTOS, /*!< Set IP type of service to set specific precedence */
275276
} nsapi_socket_option_t;
276277

277278
typedef enum nsapi_tlssocket_level {

0 commit comments

Comments
 (0)