Skip to content

Commit f4c276f

Browse files
committed
Bump MSRV to 1.80.
Ipv4Addr::to_bits() is stable only in 1.80+.
1 parent e4e6c21 commit f4c276f

File tree

4 files changed

+102
-102
lines changed

4 files changed

+102
-102
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "smoltcp"
33
version = "0.11.0"
44
edition = "2021"
5-
rust-version = "1.77"
5+
rust-version = "1.80"
66
authors = ["whitequark <whitequark@whitequark.org>"]
77
description = "A TCP/IP stack designed for bare-metal, real-time systems without a heap."
88
documentation = "https://docs.rs/smoltcp/"

README.md

Lines changed: 99 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ real-time systems. Its design goals are simplicity and robustness. Its design an
1111
include complicated compile-time computations, such as macro or type tricks, even
1212
at cost of performance degradation.
1313

14-
_smoltcp_ does not need heap allocation *at all*, is [extensively documented][docs],
15-
and compiles on stable Rust 1.77 and later.
14+
_smoltcp_ does not need heap allocation _at all_, is [extensively documented][docs],
15+
and compiles on stable Rust 1.80 and later.
1616

1717
_smoltcp_ achieves [~Gbps of throughput](#examplesbenchmarkrs) when tested against
1818
the Linux TCP stack in loopback mode.
@@ -28,115 +28,115 @@ To set expectations right, both implemented and omitted features are listed.
2828

2929
There are 3 supported mediums.
3030

31-
* Ethernet
32-
* Regular Ethernet II frames are supported.
33-
* Unicast, broadcast and multicast packets are supported.
34-
* ARP packets (including gratuitous requests and replies) are supported.
35-
* ARP requests are sent at a rate not exceeding one per second.
36-
* Cached ARP entries expire after one minute.
37-
* 802.3 frames and 802.1Q are **not** supported.
38-
* Jumbo frames are **not** supported.
39-
* IP
40-
* Unicast, broadcast and multicast packets are supported.
41-
* IEEE 802.15.4
42-
* Only support for data frames.
31+
- Ethernet
32+
- Regular Ethernet II frames are supported.
33+
- Unicast, broadcast and multicast packets are supported.
34+
- ARP packets (including gratuitous requests and replies) are supported.
35+
- ARP requests are sent at a rate not exceeding one per second.
36+
- Cached ARP entries expire after one minute.
37+
- 802.3 frames and 802.1Q are **not** supported.
38+
- Jumbo frames are **not** supported.
39+
- IP
40+
- Unicast, broadcast and multicast packets are supported.
41+
- IEEE 802.15.4
42+
- Only support for data frames.
4343

4444
### IP layer
4545

4646
#### IPv4
4747

48-
* IPv4 header checksum is generated and validated.
49-
* IPv4 time-to-live value is configurable per socket, set to 64 by default.
50-
* IPv4 default gateway is supported.
51-
* Routing outgoing IPv4 packets is supported, through a default gateway or a CIDR route table.
52-
* IPv4 fragmentation and reassembly is supported.
53-
* IPv4 options are **not** supported and are silently ignored.
48+
- IPv4 header checksum is generated and validated.
49+
- IPv4 time-to-live value is configurable per socket, set to 64 by default.
50+
- IPv4 default gateway is supported.
51+
- Routing outgoing IPv4 packets is supported, through a default gateway or a CIDR route table.
52+
- IPv4 fragmentation and reassembly is supported.
53+
- IPv4 options are **not** supported and are silently ignored.
5454

5555
#### IPv6
5656

57-
* IPv6 hop-limit value is configurable per socket, set to 64 by default.
58-
* Routing outgoing IPv6 packets is supported, through a default gateway or a CIDR route table.
59-
* IPv6 hop-by-hop header is supported.
60-
* ICMPv6 parameter problem message is generated in response to an unrecognized IPv6 next header.
61-
* ICMPv6 parameter problem message is **not** generated in response to an unknown IPv6
62-
hop-by-hop option.
57+
- IPv6 hop-limit value is configurable per socket, set to 64 by default.
58+
- Routing outgoing IPv6 packets is supported, through a default gateway or a CIDR route table.
59+
- IPv6 hop-by-hop header is supported.
60+
- ICMPv6 parameter problem message is generated in response to an unrecognized IPv6 next header.
61+
- ICMPv6 parameter problem message is **not** generated in response to an unknown IPv6
62+
hop-by-hop option.
6363

6464
#### 6LoWPAN
6565

66-
* Implementation of [RFC6282](https://tools.ietf.org/rfc/rfc6282.txt).
67-
* Fragmentation is supported, as defined in [RFC4944](https://tools.ietf.org/rfc/rfc4944.txt).
68-
* UDP header compression/decompression is supported.
69-
* Extension header compression/decompression is supported.
70-
* Uncompressed IPv6 Extension Headers are **not** supported.
66+
- Implementation of [RFC6282](https://tools.ietf.org/rfc/rfc6282.txt).
67+
- Fragmentation is supported, as defined in [RFC4944](https://tools.ietf.org/rfc/rfc4944.txt).
68+
- UDP header compression/decompression is supported.
69+
- Extension header compression/decompression is supported.
70+
- Uncompressed IPv6 Extension Headers are **not** supported.
7171

7272
### IP multicast
7373

7474
#### IGMP
7575

7676
The IGMPv1 and IGMPv2 protocols are supported, and IPv4 multicast is available.
7777

78-
* Membership reports are sent in response to membership queries at
79-
equal intervals equal to the maximum response time divided by the
80-
number of groups to be reported.
78+
- Membership reports are sent in response to membership queries at
79+
equal intervals equal to the maximum response time divided by the
80+
number of groups to be reported.
8181

8282
### ICMP layer
8383

8484
#### ICMPv4
8585

8686
The ICMPv4 protocol is supported, and ICMP sockets are available.
8787

88-
* ICMPv4 header checksum is supported.
89-
* ICMPv4 echo replies are generated in response to echo requests.
90-
* ICMP sockets can listen to ICMPv4 Port Unreachable messages, or any ICMPv4 messages with
91-
a given IPv4 identifier field.
92-
* ICMPv4 protocol unreachable messages are **not** passed to higher layers when received.
93-
* ICMPv4 parameter problem messages are **not** generated.
88+
- ICMPv4 header checksum is supported.
89+
- ICMPv4 echo replies are generated in response to echo requests.
90+
- ICMP sockets can listen to ICMPv4 Port Unreachable messages, or any ICMPv4 messages with
91+
a given IPv4 identifier field.
92+
- ICMPv4 protocol unreachable messages are **not** passed to higher layers when received.
93+
- ICMPv4 parameter problem messages are **not** generated.
9494

9595
#### ICMPv6
9696

9797
The ICMPv6 protocol is supported, and ICMP sockets are available.
9898

99-
* ICMPv6 header checksum is supported.
100-
* ICMPv6 echo replies are generated in response to echo requests.
101-
* ICMPv6 protocol unreachable messages are **not** passed to higher layers when received.
99+
- ICMPv6 header checksum is supported.
100+
- ICMPv6 echo replies are generated in response to echo requests.
101+
- ICMPv6 protocol unreachable messages are **not** passed to higher layers when received.
102102

103103
#### NDISC
104104

105-
* Neighbor Advertisement messages are generated in response to Neighbor Solicitations.
106-
* Router Advertisement messages are **not** generated or read.
107-
* Router Solicitation messages are **not** generated or read.
108-
* Redirected Header messages are **not** generated or read.
105+
- Neighbor Advertisement messages are generated in response to Neighbor Solicitations.
106+
- Router Advertisement messages are **not** generated or read.
107+
- Router Solicitation messages are **not** generated or read.
108+
- Redirected Header messages are **not** generated or read.
109109

110110
### UDP layer
111111

112112
The UDP protocol is supported over IPv4 and IPv6, and UDP sockets are available.
113113

114-
* Header checksum is always generated and validated.
115-
* In response to a packet arriving at a port without a listening socket,
116-
an ICMP destination unreachable message is generated.
114+
- Header checksum is always generated and validated.
115+
- In response to a packet arriving at a port without a listening socket,
116+
an ICMP destination unreachable message is generated.
117117

118118
### TCP layer
119119

120120
The TCP protocol is supported over IPv4 and IPv6, and server and client TCP sockets are available.
121121

122-
* Header checksum is generated and validated.
123-
* Maximum segment size is negotiated.
124-
* Window scaling is negotiated.
125-
* Multiple packets are transmitted without waiting for an acknowledgement.
126-
* Reassembly of out-of-order segments is supported, with no more than 4 or 32 gaps in sequence space.
127-
* Keep-alive packets may be sent at a configurable interval.
128-
* Retransmission timeout starts at at an estimate of RTT, and doubles every time.
129-
* Time-wait timeout has a fixed interval of 10 s.
130-
* User timeout has a configurable interval.
131-
* Delayed acknowledgements are supported, with configurable delay.
132-
* Nagle's algorithm is implemented.
133-
* Selective acknowledgements are **not** implemented.
134-
* Silly window syndrome avoidance is **not** implemented.
135-
* Congestion control is **not** implemented.
136-
* Timestamping is **not** supported.
137-
* Urgent pointer is **ignored**.
138-
* Probing Zero Windows is **not** implemented.
139-
* Packetization Layer Path MTU Discovery [PLPMTU](https://tools.ietf.org/rfc/rfc4821.txt) is **not** implemented.
122+
- Header checksum is generated and validated.
123+
- Maximum segment size is negotiated.
124+
- Window scaling is negotiated.
125+
- Multiple packets are transmitted without waiting for an acknowledgement.
126+
- Reassembly of out-of-order segments is supported, with no more than 4 or 32 gaps in sequence space.
127+
- Keep-alive packets may be sent at a configurable interval.
128+
- Retransmission timeout starts at at an estimate of RTT, and doubles every time.
129+
- Time-wait timeout has a fixed interval of 10 s.
130+
- User timeout has a configurable interval.
131+
- Delayed acknowledgements are supported, with configurable delay.
132+
- Nagle's algorithm is implemented.
133+
- Selective acknowledgements are **not** implemented.
134+
- Silly window syndrome avoidance is **not** implemented.
135+
- Congestion control is **not** implemented.
136+
- Timestamping is **not** supported.
137+
- Urgent pointer is **ignored**.
138+
- Probing Zero Windows is **not** implemented.
139+
- Packetization Layer Path MTU Discovery [PLPMTU](https://tools.ietf.org/rfc/rfc4821.txt) is **not** implemented.
140140

141141
## Installation
142142

@@ -227,11 +227,11 @@ and counts of buffers.
227227
They can be set in two ways:
228228

229229
- Via Cargo features: enable a feature like `<name>-<value>`. `name` must be in lowercase and
230-
use dashes instead of underscores. For example. `iface-max-addr-count-3`. Only a selection of values
231-
is available, check `Cargo.toml` for the list.
230+
use dashes instead of underscores. For example. `iface-max-addr-count-3`. Only a selection of values
231+
is available, check `Cargo.toml` for the list.
232232
- Via environment variables at build time: set the variable named `SMOLTCP_<value>`. For example
233-
`SMOLTCP_IFACE_MAX_ADDR_COUNT=3 cargo build`. You can also set them in the `[env]` section of `.cargo/config.toml`.
234-
Any value can be set, unlike with Cargo features.
233+
`SMOLTCP_IFACE_MAX_ADDR_COUNT=3 cargo build`. You can also set them in the `[env]` section of `.cargo/config.toml`.
234+
Any value can be set, unlike with Cargo features.
235235

236236
Environment variables take precedence over Cargo features. If two Cargo features are enabled for the same setting
237237
with different values, compilation fails.
@@ -369,21 +369,21 @@ sudo brctl delbr br0
369369
In order to demonstrate the response of _smoltcp_ to adverse network conditions, all examples
370370
implement fault injection, available through command-line options:
371371

372-
* The `--drop-chance` option randomly drops packets, with given probability in percents.
373-
* The `--corrupt-chance` option randomly mutates one octet in a packet, with given
374-
probability in percents.
375-
* The `--size-limit` option drops packets larger than specified size.
376-
* The `--tx-rate-limit` and `--rx-rate-limit` options set the amount of tokens for
377-
a token bucket rate limiter, in packets per bucket.
378-
* The `--shaping-interval` option sets the refill interval of a token bucket rate limiter,
379-
in milliseconds.
372+
- The `--drop-chance` option randomly drops packets, with given probability in percents.
373+
- The `--corrupt-chance` option randomly mutates one octet in a packet, with given
374+
probability in percents.
375+
- The `--size-limit` option drops packets larger than specified size.
376+
- The `--tx-rate-limit` and `--rx-rate-limit` options set the amount of tokens for
377+
a token bucket rate limiter, in packets per bucket.
378+
- The `--shaping-interval` option sets the refill interval of a token bucket rate limiter,
379+
in milliseconds.
380380

381381
A good starting value for `--drop-chance` and `--corrupt-chance` is 15%. A good starting
382382
value for `--?x-rate-limit` is 4 and `--shaping-interval` is 50 ms.
383383

384384
Note that packets dropped by the fault injector still get traced;
385-
the `rx: randomly dropping a packet` message indicates that the packet *above* it got dropped,
386-
and the `tx: randomly dropping a packet` message indicates that the packet *below* it was.
385+
the `rx: randomly dropping a packet` message indicates that the packet _above_ it got dropped,
386+
and the `tx: randomly dropping a packet` message indicates that the packet _below_ it was.
387387

388388
### Packet dumps
389389

@@ -445,11 +445,11 @@ Read its [source code](/examples/ping.rs), then run it as:
445445
cargo run --example ping -- --tap tap0 ADDRESS
446446
```
447447

448-
It sends a series of 4 ICMP ECHO\_REQUEST packets to the given address at one second intervals and
449-
prints out a status line on each valid ECHO\_RESPONSE received.
448+
It sends a series of 4 ICMP ECHO_REQUEST packets to the given address at one second intervals and
449+
prints out a status line on each valid ECHO_RESPONSE received.
450450

451-
The first ECHO\_REQUEST packet is expected to be lost since arp\_cache is empty after startup;
452-
the ECHO\_REQUEST packet is dropped and an ARP request is sent instead.
451+
The first ECHO_REQUEST packet is expected to be lost since arp_cache is empty after startup;
452+
the ECHO_REQUEST packet is dropped and an ARP request is sent instead.
453453

454454
Currently, netmasks are not implemented, and so the only address this example can reach
455455
is the other endpoint of the tap interface, `192.168.69.100`. It cannot reach itself because
@@ -469,18 +469,18 @@ cargo run --example server -- --tap tap0
469469

470470
It responds to:
471471

472-
* pings (`ping 192.168.69.1`);
473-
* UDP packets on port 6969 (`socat stdio udp4-connect:192.168.69.1:6969 <<<"abcdefg"`),
474-
where it will respond with reversed chunks of the input indefinitely;
475-
* TCP connections on port 6969 (`socat stdio tcp4-connect:192.168.69.1:6969`),
476-
where it will respond "hello" to any incoming connection and immediately close it;
477-
* TCP connections on port 6970 (`socat stdio tcp4-connect:192.168.69.1:6970 <<<"abcdefg"`),
478-
where it will respond with reversed chunks of the input indefinitely.
479-
* TCP connections on port 6971 (`socat stdio tcp4-connect:192.168.69.1:6971 </dev/urandom`),
480-
which will sink data. Also, keep-alive packets (every 1 s) and a user timeout (at 2 s)
481-
are enabled on this port; try to trigger them using fault injection.
482-
* TCP connections on port 6972 (`socat stdio tcp4-connect:192.168.69.1:6972 >/dev/null`),
483-
which will source data.
472+
- pings (`ping 192.168.69.1`);
473+
- UDP packets on port 6969 (`socat stdio udp4-connect:192.168.69.1:6969 <<<"abcdefg"`),
474+
where it will respond with reversed chunks of the input indefinitely;
475+
- TCP connections on port 6969 (`socat stdio tcp4-connect:192.168.69.1:6969`),
476+
where it will respond "hello" to any incoming connection and immediately close it;
477+
- TCP connections on port 6970 (`socat stdio tcp4-connect:192.168.69.1:6970 <<<"abcdefg"`),
478+
where it will respond with reversed chunks of the input indefinitely.
479+
- TCP connections on port 6971 (`socat stdio tcp4-connect:192.168.69.1:6971 </dev/urandom`),
480+
which will sink data. Also, keep-alive packets (every 1 s) and a user timeout (at 2 s)
481+
are enabled on this port; try to trigger them using fault injection.
482+
- TCP connections on port 6972 (`socat stdio tcp4-connect:192.168.69.1:6972 >/dev/null`),
483+
which will source data.
484484

485485
Except for the socket on port 6971. the buffers are only 64 bytes long, for convenience
486486
of testing resource exhaustion conditions.
@@ -553,7 +553,7 @@ is possible; otherwise, nothing at all will be displayed and no options are acce
553553

554554
[wireshark]: https://wireshark.org
555555

556-
### examples/loopback\_benchmark.rs
556+
### examples/loopback_benchmark.rs
557557

558558
_examples/loopback_benchmark.rs_ is another simple throughput benchmark.
559559

ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eox pipefail
44

55
export DEFMT_LOG=trace
66

7-
MSRV="1.77.0"
7+
MSRV="1.80.0"
88

99
RUSTC_VERSIONS=(
1010
$MSRV

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
//!
6666
//! # Minimum Supported Rust Version (MSRV)
6767
//!
68-
//! This crate is guaranteed to compile on stable Rust 1.77 and up with any valid set of features.
68+
//! This crate is guaranteed to compile on stable Rust 1.80 and up with any valid set of features.
6969
//! It *might* compile on older versions but that may change in any new patch release.
7070
//!
7171
//! The exception is when using the `defmt` feature, in which case `defmt`'s MSRV applies, which

0 commit comments

Comments
 (0)