Dan Robertson
eb33e7f09f
Add ICMPv6
...
Add support for ICMPv6 message types to the wire module.
2018-01-26 23:10:41 +00:00
whitequark
a9903aee61
Allow fuzzer failures on Travis.
...
cargo-fuzz is broken on Travis, but the mode is still useful for
those running ./.test_like_travis.rb.
2018-01-26 20:20:37 +00:00
whitequark
7269ed4981
Fix af26eafd.
2018-01-26 19:56:23 +00:00
whitequark
de3b9735f2
Install cargo-fuzz on Travis before fuzzing.
2018-01-26 19:44:02 +00:00
whitequark
235cd2581d
Run fuzzing on Travis.
2018-01-26 19:30:47 +00:00
Egor Karavaev
864b4b7996
Treat unspecified IPv4/IPv6 addresses as IpAddress::Unspecified in IpRepr::lower.
...
Closes #127 .
2018-01-26 19:26:01 +00:00
Dan Robertson
7778626788
Fix ICMPv4 check_len to not panic on truncated packets.
2018-01-26 18:59:11 +00:00
whitequark
79e065e052
Add some ICMPv4 and ICMPv6 packets to fuzz corpus.
2018-01-26 18:43:39 +00:00
whitequark
a65daade16
Fix some overly long comments. NFC.
2018-01-26 17:48:59 +00:00
Dan Robertson
b017a16e98
Increase required size for ICMPv4 packets
...
- Increase the size required in Icmpv4Packet::check_len to 8 bytes
- Add a test
2018-01-26 16:59:37 +00:00
luozijun
b5646f1e98
Add `Hash` trait on `IpAddress/IpCidr`
2018-01-26 16:35:53 +00:00
whitequark
0ddd4c9001
Route broadcast packets directly.
...
Closes #120 .
2018-01-15 11:56:14 +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
Herman J. Radtke III
d612a93163
Fix mistakes in README
...
- Fix binary path in tcpdump example
- Fix IP address in ping example
2018-01-13 18:42:17 +00:00
Dan Robertson
7edb7ee93d
Implement the time module.
2018-01-13 14:51:21 +00:00
Herman J. Radtke III
2419147b45
Handle parsing and display of IPv4 mapped IPv6 addresses.
...
* The IPv6 address parser now handles IPv4 mapped IPv6 addresses which
take on the form ::ffff:x.x.x.x.
* Implement Display for IPv4 mapped IPv6 addresses
* Implement From<IPv4Address> for IPv6Address
Fixes #86
2018-01-13 08:49:24 +00:00
Dan Robertson
6fd5ed8aaf
Support IPv6 raw sockets
...
- Add support for IPv6 raw sockets.
- Update tests.
2018-01-13 03:07:10 +00:00
Alex Crawford
066d42c0e0
Clean up dispatch_socket!() syntax
...
This modified syntax is meant to more closely resemble standard Rust.
2018-01-08 07:44:15 +00:00
whitequark
3e96551004
Bump `managed` dependency to 0.5.
2018-01-05 22:44:25 +00:00
whitequark
f494200c8c
Disregard TCP FIN flag if it arrives in a segment not at window start.
...
Fixes #111 .
2018-01-05 21:06:20 +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
22b048c225
Ensure ICMPv4 error replies comply with size requirements
...
- Add MIN_MTU constants to the IP version modules.
- Ensure that ICMPv4 error replies comply with the size requirements
specified in RFC 1812 § 4.3.2.3.
2018-01-05 19:21:45 +00:00
寧靜
98679f9a1b
Update examples/tcpdump.rs.
2017-12-28 04:48:23 +00:00
whitequark
7c0bae7d36
Simplify. NFC.
2017-12-27 00:09:50 +00:00
Dan Robertson
0d7a6255f6
Add bench tests
...
- Add basic infrastructure for bench tests
- Add bench tests for
- TcpRepr::emit
- UdpRepr::emit
- Ipv4Repr::emit
- Ipv6Repr::emit
2017-12-24 22:40:00 +00:00
Dan Robertson
439e0a2cc1
Add the proto-ipv4 feature.
2017-12-24 13:28:59 +00:00
Herman J. Radtke III
260e3d996f
Implement FromStr for IpEndpoint
...
Fixes #81
2017-12-24 12:08:16 +00:00
Josh Gangloff
fe3e67d544
Make IP checksum loop use larger chunks to ease autovectorization.
2017-12-23 22:26:16 +00:00
whitequark
d8685dbb1e
Unswitch the IP checksum loop for 30% improvement in performance.
2017-12-23 12:17:39 +00:00
whitequark
fb11c4a84d
Convert the stress.rs example into a simple benchmark.
...
There are no more bugs exposed by stress.rs as far as I can tell,
so let's make it do something more useful.
2017-12-22 20:59:30 +00:00
whitequark
b2c2214725
Convert all assert!s not documented as panics into debug_assert!s.
...
Document the rest.
2017-12-22 20:38:54 +00:00
whitequark
ee6c1f34b3
Build release testsuite binaries with complete debug information.
2017-12-22 19:38:17 +00:00
whitequark
436f4ef624
Correctly handle retransmission of lost-received-lost TCP segments.
...
Thanks @pothos for initial analysis of the issue.
2017-12-22 19:31:04 +00:00
whitequark
ae17151f2a
Fix a few documentation issues. NFC.
2017-12-22 13:13:43 +00:00
whitequark
a45b3d9eab
TcpSocket::recv_impl should have never been public, oops.
2017-12-22 13:11:11 +00:00
whitequark
85487bf3bc
EthernetInterface::set_ipv4_gateway should panic on non-unicast addrs.
2017-12-22 13:07:11 +00:00
whitequark
f1a7fbe973
Split `poll_at`/`poll_delay` out of `poll`.
...
The previous model was flawed. Consider the following case:
* The main loop looks as follows (pseudocode):
loop {
let _ = (tcp:1234).read_all()
wait(iface.poll())
}
* The remote end is continuously transmitting data and at some
point fills the window of (tcp:1234), stopping the transmission
afterwards.
* The local end processes the packets and, as a part of egress
routine, emits an ACK. That also updates the window, and
the socket's poll_at() routine returns None, since there is
nothing to transmit or retransmit.
* The local end now waits indefinitely even though it can start
processing the data in the socket buffers right now.
2017-12-22 12:59:52 +00:00
whitequark
fec3bb32eb
Make the log crate properly optional.
2017-12-22 09:57:38 +00:00
whitequark
5ea177e6ab
Add a stress test.
...
Run it without the `log` feature and in release mode:
$ cargo run --release \
--no-default-features \
--features std,phy-tap_interface,socket-tcp \
--example stress tap0 \
[reader|writer]
There are currently two bugs exposed by it:
* a crash in the reader mode,
* slow-down in the writer mode.
2017-12-22 09:43:00 +00:00
whitequark
6d6635a4a9
Oops, don't make examples depend on a nonexistent feature.
...
It's a Cargo bug that this is not an error (and thus went unnoticed).
2017-12-22 09:29:56 +00:00
whitequark
809cfd5ff2
Add a script to run every test Travis would run locally.
2017-12-22 09:07:57 +00:00
whitequark
8b6050f711
Clean up our feature story and more aggressively test features.
2017-12-22 08:54:58 +00:00
whitequark
3029341d5a
Panic on an attempt of subtracting sequence numbers with underflow.
...
This would result in results near usize::MAX, and is indicative of
a bug. A panic is always used instead of a debug_assert!() because
debug builds are easily slow enough so that the underlying bugs
are not tripped.
Related to #62 .
2017-12-21 12:35:15 +00:00
whitequark
bd40265d3a
Use a more specific log message for keep-alive or probe TCP packets.
2017-12-21 10:39:54 +00:00
whitequark
df65c0e6ae
Unbreak `cargo test --no-default-features --features default`.
...
I'm not sure why is this needed, but it broke CI.
2017-12-18 15:10:50 +00:00
whitequark
bf53b73e09
Fix accidental conversion of a slice to owned.
...
This broke #![no_std] builds.
2017-12-18 15:03:38 +00:00
whitequark
8863eb8db1
Add an HTTP client example.
2017-12-18 14:53:09 +00:00
whitequark
946376897e
Make EthernetInterfaceBuilder::ip_addrs optional.
...
It's perfectly reasonable to have an interface with no addresses
assigned to it.
2017-12-18 13:53:27 +00:00
Dan Robertson
c5c2264cdc
Use hop limit instead of ttl
...
Use hop limit instead of ttl for method and member names.
2017-12-18 13:47:34 +00:00
Dan Robertson
ee60efefd3
Add Ipv6Repr and Ipv6Packet to wire
...
- Add the Ipv6Repr and Ipv6Packet structures to the wire module
- Add basic tests for the new structures
- Update IpRepr to include the Ipv6 variant
2017-12-18 13:47:34 +00:00