Add RTF_*, RTA_*, RTAX_*, RTM_* definitions on BSDs
Grep from:
- https://github.com/freebsd/freebsd-src/raw/main/sys/net/route.h
- https://github.com/DragonFlyBSD/DragonFlyBSD/raw/master/sys/net/route.h
- https://github.com/NetBSD/src/raw/trunk/sys/net/route.h
- https://github.com/openbsd/src/raw/master/sys/net/route.h
Closes #3711.
@rustbot review
r? @JohnTitor
rustbot has assigned @JohnTitor. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
Some changes occurred in OpenBSD module
cc @semarie
Some changes occurred in OpenBSD module
cc @semarie
Do you plan to unify with macOS (same ancestor) by moving RTM_ADD and other constants with same values to src/unix/bsd/mod.rs ?
Please, don't remove *_MAX unless applied to macOS as well:
error[E0425]: cannot find value `RTAX_MAX` in crate `libc`
--> cargo-crates/iroh-net-0.16.2/src/net/interfaces/bsd.rs:875:46
|
875 | let mut addrs = Vec::with_capacity(libc::RTAX_MAX as usize);
| ^^^^^^^^ not found in `libc`
error[E0425]: cannot find value `RTAX_MAX` in crate `libc`
--> cargo-crates/iroh-net-0.16.2/src/net/interfaces/bsd.rs:879:23
|
879 | for i in 0..libc::RTAX_MAX as usize {
| ^^^^^^^^ not found in `libc`
|
help: you might have meant to write `.` instead of `..`
|
879 - for i in 0..libc::RTAX_MAX as usize {
879 + for i in 0.libc::RTAX_MAX as usize {
|
At first glance this looks okay, but there are a couple things needed. Could you please do the following?
- Target
main - Squash the commits
- Update the
libc-test/semverfiles since this now affects more platforms. A couple lines were touched, but there were a lot of constants added.
@rustbot author
Some changes occurred in solarish module
cc @jclulow, @pfmooney
It'd be great to land this, so https://github.com/mozilla/mtu/pull/29 would work on the BSDs.
Going to wait on the backport until https://github.com/rust-lang/libc/pull/3970 is figured out.