- Add `medium` in `DeviceCapabilities`.
- Rename EthernetInterface to Interface.
- Add support to Interface for both Ethernet and IP mediums. The medium to use is detected from `device.capabilities().medium`.
- Ethernet-only features are gated behind the "ethernet" feature, as before.
- IP features are always enabled for now.
The actual header length may be larger than the bpf_hdr struct due to aligning:
37ecb4d066/sys/net/bpf.c (L1649)8f02f2a044/bsd/net/bpf.c (L3580)
Tests are only valid for 32 and 64 bit architectures. I did not bother
guarding them with additional cfg flags.
This was flagged by `cargo clippy`:
warning: field assignment outside of initializer for an instance
created with Default::default()
This changes the visibility of the dummy field to be public, but only to
the crate.
These were flagged by `cargo clippy`:
warning: the operation is ineffective. Consider reducing it to `number`
warning: this function has too many arguments (8/7)
warning: you should consider adding a `Default` implementation for
`phy::loopback::Loopback`
I like the code better as it is.
These were flagged by `cargo clippy`:
warning: redundant field names in struct initialization
There are plenty more redundant field names, but I only changed the ones
where the initialization was a single line of code. I still prefer the
redundant style for multi-line initializations (and I'm under the
impression that others agree), so I've also disabled the warning.
Disable ethernet-related features and framing based on a feature gate.
Add a no-ethernet option to Travis.
notes:
- allow(unused) is added when not using ethernet feature
- Don't run pretty-print doctest, ethernet is optional.
Closes: #308
Approved by: whitequark
Actually, this is not a new requirement at all; because we do not
check the minimum version on CI, some dependencies on 1.28 have
already sneaked in. In particular, our required version of the crate
managed only works on 1.28+.
This allows us to use:
(1.28)
- ops::RangeBounds
- num::NonZero
Some trait bounds were added to make sure everything builds on 1.28.
This allows us to use:
(1.26)
- impl Trait
- autoderef in pattern matching
- fixed slice patterns
- inclusive ranges
(1.27)
- dyn Trait
- #[must_use] on functions
To prepare for edition change, dyn is added where applicable. Other
edition changes would require bumping the requirement even higher,
and so they are not applied for now.
This cargo feature only exists because (a) ARTIQ uses a fork of Rust,
(b) Rust has some ridiculous renaming going on in the alloc crate,
(c) smoltcp exists because of ARTIQ.
Such features will not be ordinarily provided by smoltcp.