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 TCP4 and IP4 protocols #39
Conversation
Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! I merged this manually and fixed the things I mentioned inline. I also added the CONNECTION_FIN/RESET/REFUSED status codes.
| r#type: u8, | ||
| code: u8, | ||
| pub r#type: u8, | ||
| pub code: u8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pulled this out into its own commit.
| pub header_length: u8, | ||
| pub version: u8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are bitfields in the spec (4-bits each). Since rust has no stable representation of bitfields, I merged them so far and simply concatenated the names. So in this case it would be:
| pub header_length: u8, | |
| pub version: u8, | |
| pub header_length_version: u8, |
| #[repr(C)] | ||
| #[derive(Clone, Copy, Debug)] | ||
| pub struct TransmitData { | ||
| pub destination_address: *mut crate::base::Ipv6Address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| pub destination_address: *mut crate::base::Ipv6Address, | |
| pub destination_address: crate::base::Ipv4Address, |
No pointer, and 4 instead of 6.
Signed-off-by: Ayush Singh ayushsingh1325@gmail.com