mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-28 02:18:50 +00:00
This PR introduces the `etherparse` dependency for parsing and generating IP packets. Using `etherparse`, we can implement the NAT46 & NAT64 implementations for the gateway more elegantly because it allows us to parse the IP and protocol headers into a static and much richer representation. The conversion to the IPv4/IPv6 equivalent is then just a question of transforming one data structure into another and writing it to the correct place in the buffer. We extract this functionality into dedicated `nat64` and `nat46` modules. Furthermore, we implement the various functions in `ip_packet::make` using `etherparse` too. Following that, we also overhaul the NAT translation tests that we have in `ip_packet::proptests`. Those now use the more low-level `consume_to_ipX` APIs which makes the tests more ergonomic to write. In the future, we should upstream `Ipv4HeaderSliceMut` and `Ipv6HeaderSliceMut` to `etherparse`. Moving all of this functionality to `etherparse` will make it easier to write tests that involve more IP packets as well as customise the behaviour of our NAT. Related: #5614. Related: #6371. Related: #6353.
Connlib
Firezone's connectivity library shared by all clients.
Building Connlib
You shouldn't need to build connlib directly; it's typically built as a dependency of one of the other Firezone components. See READMEs in those directories for relevant instructions.