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 TCP4 and IP4 protocols #39

Closed
wants to merge 1 commit into from
Closed

Add TCP4 and IP4 protocols #39

wants to merge 1 commit into from

Conversation

Ayush1325
Copy link
Contributor

Signed-off-by: Ayush Singh ayushsingh1325@gmail.com

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
Copy link
Member

@dvdhrm dvdhrm left a 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.

Comment on lines -95 to +96
r#type: u8,
code: u8,
pub r#type: u8,
pub code: u8,
Copy link
Member

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.

Comment on lines +117 to +118
pub header_length: u8,
pub version: u8,
Copy link
Member

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:

Suggested change
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub destination_address: *mut crate::base::Ipv6Address,
pub destination_address: crate::base::Ipv4Address,

No pointer, and 4 instead of 6.

@dvdhrm dvdhrm closed this Jul 11, 2022
@Ayush1325 Ayush1325 deleted the tcp4 branch July 11, 2022 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants