Commit Graph

204 Commits

Author SHA1 Message Date
whitequark be29789192 Fix an unimplemented!() invocation that should be unreachable!(). 2017-06-22 00:38:45 +00:00
whitequark 83cf86f1d0 Unbreak parsing of ICMP unreachable messages.
Fixes #16.
2017-06-21 04:08:33 +00:00
Egor Karavaev ca56baca65 Add `RawSocket`. 2017-06-21 03:29:31 +00:00
whitequark 8087bf3755 Fix a typo in documentation. 2017-04-21 15:59:55 +00:00
whitequark 1d46ccf432 fn Device::mtu() -> usize → Device::limits() -> DeviceLimits 2017-03-07 11:10:26 +00:00
whitequark 393ebbe682 Don't put non-unicast (IP or Ethernet) addresses into ARP cache.
Thanks @little-dude for pointing this out--it's probably a DoS bug.
2017-03-07 06:32:18 +00:00
whitequark b305797cb4 Trace eviction and fill in SliceArpCache. 2017-03-07 06:25:47 +00:00
Corentin Henry 0f2b05ede7 arp: increment lru when inserting a new entry 2017-03-07 06:04:40 +00:00
Corentin Henry 40d3a3ada8 arp: use valid unicast ip addresses for tests 2017-03-07 05:20:28 +00:00
whitequark 5137608aed Follow-up to b9e79d19; always process broadcast frames. 2017-03-06 04:00:13 +00:00
whitequark d25eebc0ef Ignore Ethernet frames for which we aren't a destination. 2017-03-06 03:58:19 +00:00
whitequark 493a319132 Remove the `use_` prefix from feature names.
I haven't realized that a feature `log` with an optional crate
dependency `log` activates that dependency, and added the prefix
to avoid a "clash". This is unnecessary.
2017-03-05 05:49:38 +00:00
whitequark 0d32fcee5b Send an ARP request when the destination is not in cache. 2017-03-05 04:59:51 +00:00
whitequark bc1d65ea89 Send the TCP MSS option. 2017-01-27 02:56:27 +00:00
whitequark 077513fda6 Add support for TCP MSS option in TCP representation. 2017-01-27 02:56:27 +00:00
whitequark 591993014e Reject, not accept, TCP RST packets in LISTEN state.
These packets may have been destined for a different socket.
2017-01-17 04:33:37 +00:00
whitequark 578d7bce5f Calculate IP payload length from the total length field.
Before this commit, IP payload length was calculated by subtracting
the IP header length from the total underlying buffer length, which
fails if the underlying buffer has padding, e.g. like Ethernet
does.
2017-01-14 11:07:06 +00:00
whitequark 362c954624 Make interfaces not own the sockets. 2017-01-11 05:25:54 +00:00
whitequark 234e5ef29e Implement socket sets. 2017-01-11 04:05:41 +00:00
whitequark 1ea9a5125b Use ManagedSlice in SliceArpCache. 2017-01-10 11:57:14 +00:00
whitequark 0e006383f2 Use Managed/ManagedSlice for EthernetInterface. 2017-01-10 11:37:12 +00:00
whitequark 67430aa589 Use the managed crate. 2017-01-10 11:04:00 +00:00
whitequark 08ac98e4bc Reorder type parameters of Interface. 2017-01-01 08:18:25 +00:00
whitequark bf3b62bb25 Examples for the phy layer! 2016-12-31 12:28:59 +00:00
whitequark 27ccfc1bb0 Implement TCP retransmission. 2016-12-31 08:35:46 +00:00
whitequark 71268ace88 Get rid of the #![feature(const_fn)]. 2016-12-28 00:08:51 +00:00
whitequark de24d635fa Rename features: std→use_std, logging→use_log. 2016-12-27 23:45:24 +00:00
whitequark a8fc4fd832 Improve the user-facing TCP socket API. 2016-12-27 17:49:40 +00:00
whitequark ea78053dc1 Factor out IpRepr into the wire module. 2016-12-26 11:20:20 +00:00
whitequark ea07e79bdf Group IP header parts in the socket layer as struct IpRepr. 2016-12-26 10:06:49 +00:00
whitequark bdfb99ea16 Validate TCP ACKs. 2016-12-25 09:22:49 +00:00
whitequark f46c77bdd6 Fix autoselection of source address. 2016-12-23 07:57:54 +00:00
whitequark 6d8d3cb29d Use correct sequence numbers in TCP RST packets. 2016-12-23 07:34:10 +00:00
whitequark 2f24fb263b Populate ARP cache from incoming IP packets. 2016-12-23 07:31:42 +00:00
whitequark 1ad8f9c9bd Implement conversion of incoming TCP connections into TCP streams. 2016-12-20 22:57:21 +00:00
whitequark 53ddc9476f Fix no_std build. 2016-12-20 22:06:36 +00:00
whitequark 5a64a87dbe Reply with ICMP dest. unreachable or TCP RST from unused ports. 2016-12-20 19:18:35 +00:00
whitequark 0d9a8a417d Add some sanity into enumeration names (avoid "*Type"). 2016-12-20 13:54:11 +00:00
whitequark 095005a597 Empty transmit buffers before starting to receive. 2016-12-20 00:07:02 +00:00
whitequark f86fac2223 Sort out buffer lengths. 2016-12-19 23:50:04 +00:00
whitequark 2dc837be9d Fix lifetime variance. 2016-12-17 06:39:18 +00:00
whitequark 31e44445f5 Working UDP loopback. 2016-12-17 05:12:45 +00:00
whitequark c672b94ef7 Rethink the buffering strategy with Managed<T>. 2016-12-17 04:15:55 +00:00
whitequark 3fb5f04b07 Implement network part of communication through UDP sockets. 2016-12-15 05:40:55 +00:00
whitequark fb172ed1ed Implement UDP sockets. 2016-12-14 17:39:44 +00:00
whitequark 2b01a3dace Implement UDP representation parsing and emission. 2016-12-14 02:11:50 +00:00
whitequark 57e544cc8c Return interior pointers more uniformly. 2016-12-13 22:37:05 +00:00
whitequark 1c616218a1 Respond with ICMP echo request data in echo reply. 2016-12-13 17:02:50 +00:00
whitequark d587981ef5 Implement ICMPv4 echo replies. 2016-12-12 23:22:59 +00:00
whitequark c18d6bf04d Actually commit ARP snooping. 2016-12-12 22:41:34 +00:00
whitequark 921ca353b4 Implement IPv4 packet support. 2016-12-12 17:26:06 +00:00
whitequark 7f1b88ef45 Implement ARP snooping. 2016-12-12 12:30:35 +00:00
whitequark 4421b2fe27 Implement ARP replies. 2016-12-12 07:19:53 +00:00
whitequark d862512582 Implement an ARP LRU cache. 2016-12-12 02:39:46 +00:00