Commit Graph

738 Commits (88256dbdcfc3b284f5533e5aa2969bf5061db22a)

Author SHA1 Message Date
Derk Bell 4bb0e5f21a fix indentation
Closes: #274
Approved by: dlrobertson
2019-02-01 23:13:35 +08:00
Derk Bell a1d3b94f7b make fill method public #273
Closes: #274
Approved by: dlrobertson
2019-02-01 23:13:35 +08:00
Alex Crawford 2477355516 Allow more integer types when creating Instants
This allows any type that can be converted into an `i64` to be used when
creating an Instant. Because this is no longer a concrete type, this
change may break existing code like the following:

    error: attempt to multiply with overflow
       --> src/time.rs:282:37
        |
    282 |         epoc = Instant::from_millis(2085955200 * 1000).into();
        |                                     ^^^^^^^^^^^^^^^^^
        |
        = note: #[deny(const_err)] on by default

Closes: #272
Approved by: whitequark
2019-01-28 06:37:39 +08:00
jhwgh1968 e867832214 Minimal Implementation of TCP Selective Acknowledgement
Closes: #266
Approved by: whitequark
2019-01-01 13:51:02 +08:00
Luka Atanasovski 04c9518dd2 Implement raw sockets via BPF on macOS. 2018-12-28 11:46:43 +00:00
whitequark bbc526fcd6 Fix rust-1.28 feature name (should be rust_1.28). 2018-10-29 07:05:49 +00:00
whitequark 7f5fc4e841 Bump version. 2018-10-29 07:02:57 +00:00
Kai Lüke 15c6c24a87 Increase number of assembler gaps to 32 for std/alloc targets
Only allowing four missing packets is hurting
performance for large receive windows.

The new value was picked by observing good
performance with 500 kB socket buffers.

Closes: #264
Approved by: whitequark
2018-10-05 18:36:35 +08:00
Kai Lüke 2047aaea28 Only change the assembler state on success
The current hole was always shrinked even if the
packet assembler rejected adding a packet due to
not being able to insert a new hole.

Shrink only after a new hole was added.
Shrinking before or after does not make a difference
because offset + size < hole_size and thus
contigs[index] is not empty, passing the
debug_assert in add_contig_at.

https://github.com/m-labs/smoltcp/issues/261

Closes: #265
Approved by: whitequark
2018-09-22 22:00:14 +08:00
jhwgh1968 05d5183ccc Fix fault injection on TCP streams
Closes: #263
Approved by: whitequark
2018-09-16 04:19:57 +08:00
jhwgh1968 ed3862f63b Add iter_data() to Assembler
Closes: #262
Approved by: whitequark
2018-09-01 08:29:59 +08:00
whitequark b06bb735c7 Bring feature list in README up to date. 2018-08-28 00:13:35 +00:00
jhwgh1968 88016e675f Fully implement TCP Window Scaling
Closes: #253
Approved by: whitequark
2018-08-20 06:57:44 +08:00
whitequark 2b7a25b1e2 Add an ARTIQ-specific cargo feature "rust-1.28".
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.
2018-08-10 14:53:28 +00:00
Astro a8f2725784 Implement IGMPv1/v2 processing.
Closes: #178
Approved by: whitequark
2018-08-01 10:26:51 +08:00
whitequark 06c7e6eb54 examples: remove the remaining panics on poll error. 2018-07-31 13:58:00 +00:00
Astro c2c08b4c35 Add IpAddress.to_prefix_len()
Closes: #255
Approved by: whitequark
2018-07-31 19:26:47 +08:00
Astro 633d89b78e Add a few DHCP options
Closes: #255
Approved by: whitequark
2018-07-31 19:26:47 +08:00
M@ Dunlap f3d34b09a2 fixed DHCP constants
Closes: #257
Approved by: whitequark
2018-07-30 22:32:15 +08:00
whitequark 5bcb358eb5 Rename `new` method on Packet types to `new_checked`.
Fixes #195.

Closes: #254
Approved by: dlrobertson
2018-07-11 12:59:05 +08:00
Dan Robertson 8a214f3850 Add MLDv2 Repr support
Closes: #252
Approved by: whitequark
2018-07-11 10:47:52 +08:00
whitequark 125a102b71 Update to track changes in liballoc. 2018-07-11 01:57:56 +00:00
Kai Lüke 970502e9fb Proper calculation of TCP header length
The presence of TCP options will only increase
the header length to muliples of 4. The added
padding consists of zeros.

This also fixes an emit panic when the Window
Scale and MSS options result in a length of 27
which then gets floored to 24 when applied to
the header.

Closes: #251
Approved by: whitequark
2018-06-28 19:30:43 +08:00
Dan Robertson 56463f19bd Fix code syle nits
- phy: Fix unused mut ref
 - wire: Fix comment collapse unneeded impl block

Closes: #250
Approved by: whitequark
2018-06-27 21:17:50 +08:00
jhwgh1968 1745df2110 Implement TCP Window Scaling, Phase 1 (Issue #106)
Closes: #232
Approved by: whitequark
2018-06-25 03:08:44 +08:00
Sidharth Shanker c7e35d143c Add GC & threshold to the ARP cache.
Closes: #234
Approved by: whitequark
2018-06-25 02:55:53 +08:00
Dan Robertson 82f822930c Move more iface tests to test ipv6
Closes: #249
Approved by: whitequark
2018-06-24 15:24:37 +08:00
Dan Robertson 0563fdf921 Add MLDv2 packet parsing support to wire
Add the basics for parsing MLDv2 packets with the Icmpv6Packet structure
in the wire module.

Closes: #235
Approved by: whitequark
2018-06-23 10:53:10 +08:00
whitequark 00e9d64911 Travis: add Clippy to allowed failures. 2018-06-23 02:52:26 +00:00
Michal Podhradsky 3e124ef482 Log and print error for all examples 2018-06-22 19:30:03 +00:00
Dan Robertson 276acfb7ef Fix packet buffer enqueue logic error
The size of the contiguous window should be prioritized over the size of
the contiguous window if padding were added.

For example, given the following packet buffer:

  1   2     3
|---|----|------|

If 2 is used and 1 and 3 are empty, enqueing a buffer of size 4 should
be placed in contiguous window 3 and the size of 1 should not cause
any issues in enqueue.

Closes: #247
Approved by: whitequark
2018-06-21 21:04:50 +08:00
jD91mZM2 3d141489a2 Fix impossible lifetime bounds
Using Routes<'static> used to make these functions impossible because it created a reference that needed to be valid for the static lifetime

Closes: #243
Approved by: dlrobertson
2018-06-19 21:14:20 +08:00
Dan Robertson eb078ecf63 Add clippy to CI
Closes: #240
Approved by: dlrobertson
2018-06-19 11:04:39 +08:00
Kai Lüke b23df24a2a Only trigger fast retransmit for data to send
This fixes entering a loop when both endpoints
are stuck in retransmission.

https://github.com/m-labs/smoltcp/issues/224

Closes: #233
Approved by: whitequark
2018-06-18 22:19:42 +08:00
Kai Lüke 272baab3ef Reset retrasmission delay after fast retrasmit
Closes: #233
Approved by: whitequark
2018-06-18 22:19:42 +08:00
Dan Robertson 126f144295 Update docs and fix warnings
Closes: #238
Approved by: dlrobertson
2018-06-18 10:49:16 +08:00
Valentin Lorentz 728ae3fbb5 Add support for arbitrarily many routes instead of only gateways.
Closes: #219
Approved by: whitequark
2018-06-10 05:31:08 +08:00
Ole Martin Ruud 022cad8b11 Fix implementation of fast retransmit (TcpSocket)
Improve detection of duplicate ACKs by checking that the segment does
not contain data.

Move implementation from the 'reject unacceptable acknowledgements'
to later in the process function, because a duplicate ACK is not an
'unacceptable' acknowledgement but rather a condition to update state.

Implement more tests to verify the operation of the fast retransmit
implementation.

Related issue: #224

Closes: #225
Approved by: whitequark
2018-06-10 02:53:35 +08:00
Dan Robertson e88f58739b Improve the Iterator for IPv6 options
- Add a helper function for returning an error in the implementation of
   next
 - Add an assert in Ipv6OptionsIterator::new that ensures that an
   iterator is not created with a length field larger than that of the
   data buffer we're iterating over.

Closes: #230
Approved by: dlrobertson
2018-06-07 05:08:11 +08:00
Dan Robertson 938fd55763 Fix the ipv6 option structure
The IPv6 Option representation layer structure includes the type value
as the raw u8. This should be stored as the Type enum.

Closes: #229
Approved by: whitequark
2018-06-06 07:42:35 +08:00
Michal Podhradsky 6249f69bd9 Log and print poll errors instead of crashing the server
Closes: #228
Approved by: dlrobertson
2018-06-06 06:30:18 +08:00
Dan Robertson 4d01ee3807 Remove v4 from udp/tcp of ChecksumCapabilities
Closes: #220
Approved by: dlrobertson
2018-05-28 09:41:07 +08:00
Dan Robertson 7462664954 iface: Begin parsing Hop-By-Hop extension headers
Begin add support for parsing extension headers.

Closes: #212
Approved by: whitequark
2018-05-27 16:14:29 +08:00
Dan Robertson 42a1da4d72 Improve IPv6 options parsing
- Do not require the packet structure of the header have the same
    lifetime as the underlying bytes or the parsed representation.
  - Add the bytes of the contained options to the parsed representation
    structure.
  - Add the IPv6OptionsIterator structure to make iterating over the
    contained options easier.

Closes: #212
Approved by: whitequark
2018-05-27 16:14:29 +08:00
Dan Robertson be32144ba2 NDISC flags should be located in ndisc module
Closes: #212
Approved by: whitequark
2018-05-27 16:14:29 +08:00
Astro e5a3de210c Optimize RingBuffer::enqueue_many_with to an empty buffer.
This optimization makes sure that enqueueing to an empty ring buffer
would never wrap around, in turn ensuring that enqueueing to an empty
packet buffer would never use more than one metadata entry.
Right now, pushing buffer-sized packets into a packet buffer requires
at least two metadata entries, which is surprising and wasteful.
2018-05-24 22:00:00 +00:00
Herman J. Radtke III 053a6f36e5 CR fixes deux
Closes: #218
Approved by: whitequark
2018-05-23 05:51:21 +08:00
Herman J. Radtke III 4898d5ab2a CR fixes
Closes: #218
Approved by: whitequark
2018-05-23 05:51:21 +08:00
Herman J. Radtke III 9403f1bf23 Add IPv6 Extension Routing Header
Fixes #160

Closes: #218
Approved by: whitequark
2018-05-23 05:51:21 +08:00
Dan Robertson 3a3ac474f6 Fix server example
Make the IPv6 address used in the server example the same as the IPv6
address used in the others.

Closes: #217
Approved by: dlrobertson
2018-05-19 04:34:02 +08:00