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

Add the ability to set the TTL value for a UDP/TCP socket #58

Closed
dlrobertson opened this issue Oct 14, 2017 · 0 comments
Closed

Add the ability to set the TTL value for a UDP/TCP socket #58

dlrobertson opened this issue Oct 14, 2017 · 0 comments

Comments

@dlrobertson
Copy link
Collaborator

I've recently started to look into adding the ability to set the TTL value for a socket.

This should be a trivial change. The following is my plan of attack.

  • Add a Option<u8> to Ipv4Repr and the Unspecified Repr
    • Corresponds to TTL for ipv4 and the hop limit for ipv6 (when ipv6 is implemented)
    • On lower ensure that the ttl is not lost
    • Add getters and setters.
  • Add a Option<u8> member to TcpSocket
  • Use the configured value On emiting the ipv4 packet
    • set the TTL to the recommended value of 64 if the optional value is None
    • use the configured value if Some

Due to the simplicity of this change there are minimal open questions.

  • Is hop limit (ipv6) or ttl (ipv4) a better/more readable name? At the moment I'm thinking I'll go with TTL.

Comments and critiques are welcomed!

Related to: #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants