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

feat: field views and iterators #109

Merged
merged 4 commits into from
Dec 20, 2023
Merged

Conversation

jpcsmith
Copy link
Contributor

@jpcsmith jpcsmith commented Dec 19, 2023

This adds utility methods to the standard path for iterating and modifying info and hop fields, as well as determining the expiry time from the path.

Tasks:

  • Implement iterators
  • Implement expiry time calculation.
  • Implement setters for relevant flags.
  • Add more tests

Depends on #106
Contributes to #107, #108.

@jpcsmith
Copy link
Contributor Author

@mlegner Still need to add more test, but this provides a possibility to set the router alert flag for the traceroute. Depending on your needs we can also add *Mut variants of the iterators.

Copy link
Contributor

github-actions bot commented Dec 19, 2023

Code Coverage

Package Line Rate Health
crates/scion-proto/src/path 83%
crates/scion-proto/src/packet 83%
crates/scion-proto/src 80%
crates/scion/src/daemon 95%
crates/scion-proto/src/address 67%
crates/scion/src 79%
crates/scion-proto/src/path/metadata 100%
crates/scion/src/pan 49%
crates/scion-proto/src/path/standard 90%
crates/scion-proto/src/packet/headers 86%
crates/scion-proto/src/reliable 95%
Summary 80% (1260 / 1584)

@jpcsmith jpcsmith force-pushed the feat/field-views-and-iterators branch from 206acc5 to f8d431a Compare December 20, 2023 10:55
@jpcsmith jpcsmith marked this pull request as ready for review December 20, 2023 10:56
@jpcsmith jpcsmith self-assigned this Dec 20, 2023
Copy link
Contributor

@mlegner mlegner left a comment

Choose a reason for hiding this comment

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

Cool unsafe magic, @jpcsmith! 💯

This will be very valuable to manipulate paths in various ways. I only have a few nits and probably one issue for unsetting flags.

crates/scion-proto/src/path/standard/fields.rs Outdated Show resolved Hide resolved
crates/scion-proto/src/path/standard/fields.rs Outdated Show resolved Hide resolved
crates/scion-proto/src/path/standard/fields.rs Outdated Show resolved Hide resolved
crates/scion-proto/src/path/standard/fields.rs Outdated Show resolved Hide resolved
crates/scion-proto/src/path/standard/fields.rs Outdated Show resolved Hide resolved
crates/scion-proto/src/path/standard/meta_header.rs Outdated Show resolved Hide resolved
crates/scion-proto/src/path/standard.rs Outdated Show resolved Hide resolved
crates/scion-proto/src/path/standard.rs Outdated Show resolved Hide resolved
@mlegner mlegner merged commit b7c0e40 into main Dec 20, 2023
11 checks passed
@mlegner mlegner deleted the feat/field-views-and-iterators branch December 20, 2023 16:07
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