mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
Within Firezone's Rust codebase, we use the `etherparse` crate extensively to parse network packets. To provide a more ergonomic API, this is all encapsulated in our `ip-packet` crate. For #7518, we need to write an eBPF kernel that parses and manipulates network packets. Etherparse itself doesn't provide any facilities to manipulate network packets. That is an open feature request: https://github.com/JulianSchmid/etherparse/issues/9. For the packet manipulation that we are doing in `connlib`, we already wrote certain extensions to the `etherparse` crate but today, those are all within the `ip-packet` crate. In order to reuse that within the eBPF kernel, we cannot just depend on `ip-packet` directly because eBPF is a no-std and no-alloc environment, thus no crate in the dependency tree is allowed to depend on Rust's std-lib. `etherparse` itself actually has an `std` feature flag that we can turn off. Introducing the same in `ip-packet` would require a lot of conditional-compilation gates using `#[cfg]`. it is much easier to just introduce a new crate that houses all our in-house extensions to `etherparse`. Eventually, we can hopefully upstream those which is another motivator to separate this out.
12 lines
216 B
TOML
12 lines
216 B
TOML
[package]
|
|
name = "etherparse-ext"
|
|
version = "0.1.0"
|
|
edition = { workspace = true }
|
|
license = { workspace = true }
|
|
|
|
[dependencies]
|
|
etherparse = { workspace = true, default-features = false }
|
|
|
|
[lints]
|
|
workspace = true
|