Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to get/set TOS field on sockets #84627

Closed
wants to merge 2 commits into from

Conversation

aym-v
Copy link

@aym-v aym-v commented Apr 27, 2021

Some network applications depend on proper marking of outgoing packets with ToS/DSCP fields. Routing protocols, management traffic, VoIP applications, etc., all depend on the ToS field.

ToS can be set at the socket level using the setsockopt call, using the IPPROTO_IP level and the IP_TOS option. TCPStream and UDPSocket already have ttl and set_ttl methods to get and set the TTL field. This PR adds a tos and set_tos methods.

This is an intermediate step to close this ticket: tokio-rs/tokio#3545

update test values

fix oversight in example naming

remove hermit calls

use unsupported fn instead of custom err

idem

wip

wip
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @yaahc (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 27, 2021
@the8472
Copy link
Member

the8472 commented Apr 28, 2021

I wonder what the policy is whether something should go into std or socket2.

@aym-v
Copy link
Author

aym-v commented Apr 28, 2021

I'm closing this to create a feature request instead, sorry for the noise

@aym-v aym-v closed this Apr 28, 2021
@aym-v aym-v deleted the add-tos-support branch April 28, 2021 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants