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

Packet parser part 1 #167

Merged
merged 16 commits into from
Feb 1, 2025
Merged

Packet parser part 1 #167

merged 16 commits into from
Feb 1, 2025

Conversation

daniel-noland
Copy link
Collaborator

@daniel-noland daniel-noland commented Jan 24, 2025

Introduce part 1 of the packet parsing and manipulation framework.

@daniel-noland daniel-noland added the dont-merge Do not merge this Pull Request label Jan 24, 2025
@daniel-noland daniel-noland self-assigned this Jan 24, 2025
@daniel-noland daniel-noland force-pushed the pr/daniel-noland/parser-part-1 branch 3 times, most recently from ecf6ab1 to 262b21d Compare January 25, 2025 17:47
@daniel-noland daniel-noland linked an issue Jan 26, 2025 that may be closed by this pull request
@daniel-noland daniel-noland force-pushed the pr/daniel-noland/parser-part-1 branch 22 times, most recently from de5a252 to 77e6ca8 Compare January 31, 2025 08:04
Now that we have selected a license it should be reflected in the Cargo.toml file

Signed-off-by: Daniel Noland <[email protected]>
This is bother easier to maintain and more friendly to deny.toml.

Signed-off-by: Daniel Noland <[email protected]>
@daniel-noland daniel-noland added the enhancement New feature or request label Jan 31, 2025
Cargo.toml Show resolved Hide resolved
justfile Show resolved Hide resolved
scripts/rust.env Show resolved Hide resolved
Cargo.toml Show resolved Hide resolved
net/src/parse.rs Show resolved Hide resolved
net/src/ipv4/mod.rs Show resolved Hide resolved
net/src/ipv4/mod.rs Outdated Show resolved Hide resolved
net/src/ipv4/mod.rs Outdated Show resolved Hide resolved
net/src/packet.rs Outdated Show resolved Hide resolved
net/src/vxlan/vni.rs Show resolved Hide resolved
net/src/parse.rs Outdated Show resolved Hide resolved
net/src/packet.rs Show resolved Hide resolved
net/src/ipv4/mod.rs Outdated Show resolved Hide resolved
@daniel-noland daniel-noland force-pushed the pr/daniel-noland/parser-part-1 branch from d133341 to 92f4364 Compare February 1, 2025 00:31
This commit changes the default build to only include packages which don't require the sysroot.

This should ease development on developer machines using operating systems other than linux or processors which are not x86_64.

Ordinary `cargo build` should function on such machines after this commit.

In order to build dpdk-sys based packages, run

```
just cargo build --package=dpdk-sys
```

or

```
just cargo build --package=dpdk
```
or

```
just cargo build --package=dataplane
```

Signed-off-by: Daniel Noland <[email protected]>
The big change is that `forbid(unsafe_code)` and `no_std` are not viable modes after the upcomming expansion.

The primary reason for this is that we will make significant use of const-evaluated unsafe code (which is benign) but which will offend the linter.

no_std was always just a crude means of forbidding IO and discouraging memory allocations in the net crate.
Given that the etherparse error handling requires std, this is no longer useful.

Signed-off-by: Daniel Noland <[email protected]>
@daniel-noland daniel-noland force-pushed the pr/daniel-noland/parser-part-1 branch 5 times, most recently from f5d570f to 4d1ff39 Compare February 1, 2025 01:22
@daniel-noland daniel-noland force-pushed the pr/daniel-noland/parser-part-1 branch from 6376955 to b33d91b Compare February 1, 2025 04:44
I'm sorry this is such a large commit!

The problem with breaking it into smaller parts is that the headers frequently depend on each other.
Also, given that all of this code shares a common objective, I'm not convinced that breaking the commit into smaller components will aid review.

Of (arguably) more significant note, this commit is decidedly incomplete (in spite of its massive size).

It explicitly does not include parsing and manipulation of some of the less immediately needed header types (ICMPv4/6).
This is mostly due to time constraints.

The remaining parts (and tests) should be done in part two (ideally after other developers have had a chance to use and criticize the API I have cooked up here)

Signed-off-by: Daniel Noland <[email protected]>
This new just recipe compiles all commits between the current commit and ths commit labeled start.
The goal is to speed up development by making sure your commits build before you send them to CI.

Signed-off-by: Daniel Noland <[email protected]>
As of rust 1.84 the new resolver is available.

May as well jump to it

Signed-off-by: Daniel Noland <[email protected]>
rust.env was requiring static linking with libc.

That works until you need a sanitizer (which doesn't currently support static libc build).

Since the fuzz tests use sanitizers, adjust rust.env to allow fuzz tests to be built with dynamic libc.
Debug builds use the default (i.e., static for musl and dynamic for glibc).

Release builds still require static linking.

Signed-off-by: Daniel Noland <[email protected]>
For unknown reasons, nextest is hanging in the CI.

I don't have time to debug that so fall back to cargo test.

Signed-off-by: Daniel Noland <[email protected]>
These files are created by the fuzzer to help guide it over as many code paths as possible.

Technically, we could check them in, but I think that is silly at this point.

Signed-off-by: Daniel Noland <[email protected]>
profraw files are generated by programs instrumented by LLVM to track performance and coverage.
They are useful for the fuzzer but not useful to check in to git.

Signed-off-by: Daniel Noland <[email protected]>
@mvachhar mvachhar added this pull request to the merge queue Feb 1, 2025
@daniel-noland daniel-noland removed this pull request from the merge queue due to a manual request Feb 1, 2025
@daniel-noland daniel-noland force-pushed the pr/daniel-noland/parser-part-1 branch from b33d91b to 6aec261 Compare February 1, 2025 04:51
@daniel-noland daniel-noland added this pull request to the merge queue Feb 1, 2025
Merged via the queue into main with commit 7391cde Feb 1, 2025
14 checks passed
@daniel-noland daniel-noland deleted the pr/daniel-noland/parser-part-1 branch February 1, 2025 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

packet parser framework
2 participants