TCPStream/UDPSocket tos/set_tos methods #3545
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-net
Module: tokio/net
Is your feature request related to a problem? Please describe.
Some network applications rely on proper marking of egress packets using ToS/DSCP fields. Routing protocols,
management traffic, VoIP applications and so on.
ToS can be set on socket level using
setsockopt
call, usingIPPROTO_IP
level andIP_TOS
option.TCPStream and UDPSocket already have functions:
ttl
set_ttl
for getting an setting TTL field. TTL is manipulated via the same
setsockopt
/getsockopt
calls.Describe the solution you'd like
Adding methods
tos
set_tos
for getting socket's ToS settings will be good addition for a large spectre of network applications.
Describe alternatives you've considered
Direct usage of setsockopt on raw socket handle still possible, and can be used as workaround.
Additional context
N/A
The text was updated successfully, but these errors were encountered: