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

Rework IpProtocol Type #178

Open
CollinValley opened this issue Oct 29, 2019 · 0 comments
Open

Rework IpProtocol Type #178

CollinValley opened this issue Oct 29, 2019 · 0 comments
Labels
Packet Work These issues relate to our packet library, and tend to be easier to manage

Comments

@CollinValley
Copy link
Contributor

Per Ethan
"""
Couple thoughts:

It feels wordy to have to do this twice
How do we turn an IpProtocol into a u8 when writing out a packet/overwriting the protocol field?

Have you seen the solution in libpnet? https://github.com/libpnet/libpnet/blob/master/pnet_packet/src/ip.rs It looks like the protocol is a struct with a single u8 field, then there are two mappings, one a list of constants, and one a display function.
"""

Regard in the line impl From<u8> for IpProtocol {

@CollinValley CollinValley added the Packet Work These issues relate to our packet library, and tend to be easier to manage label Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Packet Work These issues relate to our packet library, and tend to be easier to manage
Projects
None yet
Development

No branches or pull requests

1 participant