Commit Graph

91 Commits (a94f1b231cd051f3cbd7cf476cab937f666dbf23)

Author SHA1 Message Date
Dario Nieuwenhuis a94f1b231c Bump MSRV to 1.46 2021-08-18 15:19:38 +02:00
Dario Nieuwenhuis 98fe17890a rustfmt 2021-06-27 09:31:59 +02:00
Dario Nieuwenhuis 9965f09e02 Check that at least one medium is enabled if socket is enabled. 2021-06-17 03:22:02 +02:00
Gerd Zellweger e4d487d5fb Fix unused extern crate warning with certain build flags. 2021-06-14 15:16:15 -07:00
Gerd Zellweger bae279c3a8 Also import alloc crate for std. 2021-06-14 13:39:33 -07:00
qiujiangkun 0be1a76bc3 add std::error::Error to smoltcp::Error 2021-06-08 14:34:38 +08:00
Dario Nieuwenhuis 0d53163c55 dhcp: convert to socket 2021-04-07 19:00:36 +02:00
Dario Nieuwenhuis 77c46220a6 Document MSRV with the defmt exception, don't test defmt with 1.40 2021-04-01 02:15:35 +02:00
Dario Nieuwenhuis d64c8593f0 Add defmt logging support 2021-04-01 01:30:47 +02:00
Dario Nieuwenhuis af4a1e6436 Add medium-ip, medium-ethernet feature flags. 2021-03-31 17:05:09 +02:00
Dario Nieuwenhuis 8e86318a13 Fix feature-related compilation issues. 2021-03-24 02:28:55 +01:00
Dario Nieuwenhuis e40b1442ce Remove support table from docs. Fixes #361
The table is no longer very informative since it's all "yes" now.
2021-03-24 02:21:12 +01:00
Dario Nieuwenhuis 857c012f14 Fix build when with no socket features 2021-02-01 16:45:32 +01:00
Alex Crawford 0cf0a7e386 Clean up clippy warnings about if-else blocks
This de-duplicates and (hopefully) simplifies a few if-else blocks. The
others were given an exception because I thought they were more readable
as is. I've verified that these changes don't result in larger binaries.
2021-01-10 14:30:31 -08:00
Alex Crawford 06d128ad22 Use #[non_exhaustive] on structs as well
This builds on 633e7c25, adding the #[non_exhaustive] attribute to
applicable struct definitions.
2021-01-10 13:54:29 -08:00
Niclas Hoyer ad7795f996 Use #[non_exhaustive] instead of manual variant 2021-01-09 02:06:00 +01:00
Alex Crawford 6b524dc74d Various cleanups
These were flagged by `cargo clippy`:

    warning: using `clone` on a `Copy` type
    warning: passing a unit value to a function
    warning: redundant closure found
    warning: called `iter().cloned().collect()` on a slice to create a
             `Vec`. Calling `to_vec()` is both faster and more readable
2021-01-04 10:39:06 -08:00
Alex Crawford 0e21e8524f Silence warning about mapping to unit type
This was flagged by `cargo clippy`:

    warning: called `map(f)` on an `Option` value where `f` is a closure
             that returns the unit type `()`

I decided to disable this because it was suggesting changes like the
following and I prefer the original:

    @@ -1 +1 @@
    -self.waker.take().map(|w| w.wake());
    +if let Some(w) = self.waker.take() { w.wake() }
2020-12-28 23:10:05 -08:00
Alex Crawford 27232041e7 Silence a few warnings from clippy
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.
2020-12-28 23:09:53 -08:00
Alex Crawford e27f6cb564 Remove redundant field names from structs
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.
2020-12-28 22:27:24 -08:00
Alex Crawford a73c90ad08 Silence warning about matches macro
These were flagged by `cargo clippy`:

    warning: match expression looks like `matches!` macro

The matches! macro isn't stabilized until Rust 1.42.
2020-12-27 17:00:02 -08:00
Alex Crawford 1a1861721b Silence warning about non-exhaustive pattern
These were flagged by `cargo clippy`:

    warning: this seems like a manual implementation of the
             non-exhaustive pattern

The non_exhaustive attribute isn't available until we increase the
minimum Rust version to 1.40, so we should just silence these warnings
in the meantime.
2020-12-27 16:59:30 -08:00
Dario Nieuwenhuis 88256dbdcf Update to Rust 2018. Fixes #271 2020-12-27 17:54:56 +01:00
Alex Crawford c9f57150a8 Dereference match expressions to clean up patterns
These were flagged by `cargo clippy`:

    warning: you don't need to add `&` to all patterns
2020-12-26 10:32:51 -08:00
Dario Nieuwenhuis efbd3ec23d Add `Finished` error. 2020-06-12 09:43:44 +00:00
nabijaczleweli 41fe0f828a Fix support table in toplevel doc 2020-04-16 07:18:52 +00:00
Ruben De Smet eebd8e431a Add ethernet feature-gate as default.
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
2019-10-04 22:49:54 +08:00
whitequark 10e251b0aa Bump log dependency to version 0.4.4. NFC.
Since 0.4.4, log uses #[macro_export(local_inner_macros)], which is
the right thing to do, but it breaks our CI because of a now-unused
\#[macro_use(log)].
2019-07-23 12:10:38 +00:00
Astro 49f638e2d2 Implement DHCPv4 client + example.
Closes: #186
Approved by: whitequark
2019-05-14 00:37:43 +08:00
Dan Robertson eb078ecf63 Add clippy to CI
Closes: #240
Approved by: dlrobertson
2018-06-19 11:04:39 +08:00
Dan Robertson 126f144295 Update docs and fix warnings
Closes: #238
Approved by: dlrobertson
2018-06-18 10:49:16 +08:00
Dan Robertson bca0ff638b Add NDISC Option Type to wire
Add support for NDISC options parsing in wire.

Closes: #167
Approved by: whitequark
2018-03-12 06:08:58 +08:00
whitequark 6811a6bff1 Update Packet/Repr support table. 2018-03-11 18:18:31 +00:00
Dan Robertson 1097ba3110 Documentation updates
- Update documentation about current support in the wire module
 - Ensure the possible panic is documented for Ipv6Option::data_mut
 - Add a Repr structure for Ethernet II headers
2018-02-14 18:00:19 +00:00
Dan Robertson 4a78b02fcf Add process_ipv6 to EthernetInterface
- Add `process_ipv6` to `EthernetInterface`
 - Add basic test for `process_ipv6`
 - Add `deny(unused)` if either proto-ipv4 or proto-ipv6 is enabled
 - Add `cfg`s where needed to avoid compile time errors due to the above
2018-01-15 11:54:26 +00:00
Dan Robertson 7edb7ee93d Implement the time module. 2018-01-13 14:51:21 +00:00
Dan Robertson b653a6e421 Fix documentation warnings.
- There are several warnings that are thrown when running `cargo doc`. Fix
  these warnings.
- Convert all module documentation to use /*! for consistency.
2018-01-05 19:38:23 +00:00
Dan Robertson 439e0a2cc1 Add the proto-ipv4 feature. 2017-12-24 13:28:59 +00:00
whitequark fec3bb32eb Make the log crate properly optional. 2017-12-22 09:57:38 +00:00
whitequark 8b6050f711 Clean up our feature story and more aggressively test features. 2017-12-22 08:54:58 +00:00
whitequark 26b8052ee9 Make packet dumps emitted for broken packets more useful.
Before this commit, only the outermost frame (the Ethernet one)
would be shown, which is really no help at all.
2017-12-08 07:11:08 +00:00
whitequark 19373c58c8 Style. NFCI. 2017-11-09 02:07:24 +00:00
Dan Robertson adb5014780 Add ICMP sockets
- Add support for ICMP sockets
 - Add tests for ICMP sockets
 - Rename proto-<type> features to socket-<type>
 - Update documentation
2017-11-09 00:08:24 +00:00
whitequark d9fa7f6bc6 Rename proto-* features back to socket-*.
A proto-* feature does not make sense for ICMP, where the protocol
is always enabled, but sockets, not.
2017-11-06 09:51:03 +00:00
whitequark a9a00baa49 Rename Cargo features: socket-* → proto-*. 2017-10-25 00:20:40 +00:00
whitequark dd0f4b706a Enforce some lints. 2017-09-25 00:46:53 +00:00
whitequark 0a8a962e94 Reorganize features using namespaces, to match module hierarchy.
I'm about to add a whole lot more features, and it's going to get
quite confusing otherwise.
2017-09-24 23:51:19 +00:00
whitequark 8e13333988 Remove all remnants of the collections feature. 2017-09-22 20:40:13 +00:00
whitequark 2c4222a0b6 smoltcp;:parsing → smoltcp::parsers. 2017-09-20 20:18:50 +00:00
whitequark 5ffce2c1a6 Remove Error::Rejected.
This wasn't an actual error, just a poorly designed communication
mechanism between sockets and whatever lies on the layer below them.
2017-09-08 00:59:46 +00:00