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

Enhance support for TSCH IEs #34

Merged
merged 5 commits into from
Jan 20, 2025

Conversation

jeremydub
Copy link
Contributor

@jeremydub jeremydub commented Jan 16, 2025

This PR consists of enhancing the support of IE used by TSCH.

Enhance support for TSCH Tmeslot IE

  • Support for optional timeslot timings with variable values width (2/3 byte).
  • Support Parsing/emitting/repr

Enhance support for TSCH Slotframe and Link Nested IE with support for representation/emitting/parsing of the following :

  • TSCH Slotframe and Link Nested IE
  • Slotframe descriptor
  • Link Information

Support for fuzzing of the new representations.

Update test 'emit_enhanced_beacon'.

Update dot15d4-cat with new IEs.

Comment on lines 162 to 195
0x40, 0xeb, 0xcd, 0xab, 0xff, 0xff, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
0x00, 0x3f, 0x11, 0x88, 0x06, 0x1a, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1c,
0x00, 0x01, 0xc8, 0x00, 0x01, 0x1b, 0x00
],
64, 235, 205, 171, 255, 255, 1, 0, 1, 0, 1, 0, 1, 0, 0, 63, 55, 136, 6, 26, 17, 0, 0,
0, 0, 0, 25, 28, 1, 8, 7, 128, 0, 72, 8, 252, 3, 32, 3, 232, 3, 152, 8, 144, 1, 192, 0,
96, 9, 160, 16, 16, 39, 1, 200, 0, 15, 27, 1, 0, 17, 0, 2, 0, 0, 1, 0, 6, 1, 0, 2, 0,
7
]
Copy link
Owner

Choose a reason for hiding this comment

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

Could you use hex formatting for the values for consistency?

dot15d4-frame/src/repr/ie/nested.rs Show resolved Hide resolved
Comment on lines 237 to 242
{
break;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe here is a good place to also log the error or something? This might help us in the future.

Comment on lines 921 to 927

/// Return the content of the TSCH slotframe and link IE.
pub fn content_mut(&mut self) -> &mut [u8] {
&mut self.data.as_mut()[1..]
}
Copy link
Owner

Choose a reason for hiding this comment

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

I think content_mut should be implemented for T: AsRef<[u8]> + AsMut<[u8]> + ?Sized. Can you take a look at an implementation of payload_mut.

dot15d4-frame/src/ie/nested.rs Show resolved Hide resolved
dot15d4-frame/src/repr/ie/nested.rs Show resolved Hide resolved
@thvdveld
Copy link
Owner

I did some modifications to dot15d4-cat, where I split src/main.rs into src/main.rs and src/lib.rs, such that we can add tests for the output of dot15d4-cat. That's why there is a conflict now.

Support for optional timeslot timings with variable values width (2/3 byte).
Support Parsing/emitting/repr
Support for representation/emitting/parsing of the following :
- TSCH Slotframe and Link Nested IE
- Slotframe descriptor
- Link Information

Support for fuzzing of the new representations
- Add TODO for supporting customizable size for Vec
- Add new impl block for getting mutable content for ?Sized
- Adapted dot15d4-cat for new options
@jeremydub jeremydub force-pushed the enhance-support-tsch-ies branch from 98af939 to b17bbf6 Compare January 20, 2025 09:51
@jeremydub
Copy link
Contributor Author

Great ! I pushed changes, it should be good now.

@thvdveld thvdveld merged commit 6017125 into thvdveld:main Jan 20, 2025
7 checks passed
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.

2 participants