netstack merge requestshttps://gitlab.redox-os.org/redox-os/netstack/-/merge_requests2017-06-13T20:36:54Zhttps://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/1Initial ICMP support2017-06-13T20:36:54ZJeremy SollerInitial ICMP support*Created by: batonius*
**Problem**: Redox doesn't support ICMP, it doesn't respond to ECHO requests, it doesn't have the `ping` utility.
**Solution**: Introduce the `icmpd` daemon to handle incoming ICMP messages and provide file sy...*Created by: batonius*
**Problem**: Redox doesn't support ICMP, it doesn't respond to ECHO requests, it doesn't have the `ping` utility.
**Solution**: Introduce the `icmpd` daemon to handle incoming ICMP messages and provide file system abstraction of ICMP to other processes via the `icmp:` scheme.
**Changes introduced by this pull request**:
- The `icmpd` daemon has been added.
- The daemon replies to incoming ICMP ECHO_REQUEST packets with valid ECHO_RESPOND packets.
- The daemon listens to `ip:1` and creates the `:icmp` scheme.
- The new scheme supports `echo/<ip-addr>` paths to interact with ICMP.
- Writing to an `echo/*` file sends an ICMP ECHO_REQUEST packet with the buffer argument as the packet's payload. `icmpd` sets the packet's id field to the value of the file handle used.
- An `echo/*` file produces an event on incoming ICMP ECHO_RESPONSE with id equal to the id assigned to the file handle.
- Reading from an `echo/*` file produces payload from the received packet.
**Drawbacks**:
- Client processes has no access to the underlying network headers. For example, they can't check TTL of a response.
**State**: Redox replies to incoming ECHO requests and is able to send ECHO requests and process ECHO responses via the `ping` utility.
**TODOs**:
- Add support for `*_UNREACHABLE` messages to `icmpd`.
- Add `*_unreachable` methods to `icmpd` scheme.
- Add support for `icmpd` to `ipd`, `udpd` and `tcpd`.
**Other**: The qemu's default netwok settings don't support forwarding of ICMP packets, so additional configuration is required. Here's the [configuration I'm using](https://gist.github.com/batonius/886317dabca284cc4be2ea0c6cdcd5c8).https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/2Correct fpath() for tcpd2017-06-17T00:29:22ZIan Douglas ScottCorrect fpath() for tcpdhttps://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/3tcpd: fix bug in partial reads that was breaking https in curl2017-06-22T23:11:17ZIan Douglas Scotttcpd: fix bug in partial reads that was breaking https in curlhttps://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/4Smolnetd2017-11-26T16:13:39ZJeremy SollerSmolnetdThis switches the network stack to use smoltcp, which improves performance and reliablity.
DHCP is still to be implemented.This switches the network stack to use smoltcp, which improves performance and reliablity.
DHCP is still to be implemented.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/5Sync with smoltcp updates2017-12-21T00:45:58ZDan RobertsonSync with smoltcp updates - Use `EthernetInterfaceBuilder` instead of `EthernetInterface::new`.
- smoltcp removed the `ArpCache` trait in favor of `ManagedMap`.
- rename `ttl` to `hop_limit`.
NB: This breaks the use of loopback and sending packets to your... - Use `EthernetInterfaceBuilder` instead of `EthernetInterface::new`.
- smoltcp removed the `ArpCache` trait in favor of `ManagedMap`.
- rename `ttl` to `hop_limit`.
NB: This breaks the use of loopback and sending packets to yourself.
Do **not** merge this unless you're okay with these being broken
until multiple devices are supported by smoltcp.
I hit compile time errors due to running `make update && make all`.
If that is not within the normal workflow, we may want to hold off on this.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/6Updates to sync with upstream changes2018-01-10T00:45:49ZDan RobertsonUpdates to sync with upstream changes - Polling API for EthernetInterface has changed. See https://github.com/m-labs/smoltcp/commit/3868dcdb148ecd30015e1d99283099b171df76c5.
- `proto-ipv4` is now needed to enable IPv4 support. See https://github.com/m-labs/smoltcp/commit/... - Polling API for EthernetInterface has changed. See https://github.com/m-labs/smoltcp/commit/3868dcdb148ecd30015e1d99283099b171df76c5.
- `proto-ipv4` is now needed to enable IPv4 support. See https://github.com/m-labs/smoltcp/commit/507d2fe0ea390ec309d2e900a9d0d4a70a3dfa3c.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/8Use byteorder to improve readability2018-01-24T00:04:14ZDan RobertsonUse byteorder to improve readabilityUse byteorder instead of using less readable bitmasks and shifts.Use byteorder instead of using less readable bitmasks and shifts.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/13The dnsd daemon2018-01-29T11:45:16ZJeremy SollerThe dnsd daemon*Created by: batonius*
The PR implements the `dnsd` daemon as described in #9.
**Notes:**
- `smolnetd` should be updated as well for `dnsd` to work, because of https://github.com/m-labs/smoltcp/pull/133 .
- The daemon uses the [dns...*Created by: batonius*
The PR implements the `dnsd` daemon as described in #9.
**Notes:**
- `smolnetd` should be updated as well for `dnsd` to work, because of https://github.com/m-labs/smoltcp/pull/133 .
- The daemon uses the [dns-parser](https://github.com/tailhook/dns-parser) crate to create/parse DNS packets.
- The daemon implements `dns:<url>` scheme and currently supports only domain-to-ipv4 resolving, returning resolved IPs in textual form, separated by newlines.
- The name server is hardcoded to `8.8.8.8`, to be configurable once #7 is done.
- The schema works in blocked mode only, but the requests themselves are implemented via non-blocking UDP sockets.
- The daemon maintains an internal cache of resolved domains with hardcoded lifetime 5min, to be configurable after #7.
- On errors, the daemon returns `ENODATA`, on request timeouts (30 sec, to be configurable) - `ETIMEOUT`.
- The daemon doesn't support [IDN](https://en.wikipedia.org/wiki/Internationalized_domain_name).
@jackpot51 We should probably do something about the ad-hoc DNS code in `libstd` and `newlib` once this is merged.
Closes #9.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/14The netcfg scheme2018-01-30T20:00:55ZJeremy SollerThe netcfg scheme*Created by: batonius*
The PR implements the `netcfg` scheme as described in #7.
**Notes:**
- Right now configuration nodes hardcoded in https://github.com/batonius/netstack/blob/netcfg/src/smolnetd/scheme/netcfg/mod.rs#L45 are `res...*Created by: batonius*
The PR implements the `netcfg` scheme as described in #7.
**Notes:**
- Right now configuration nodes hardcoded in https://github.com/batonius/netstack/blob/netcfg/src/smolnetd/scheme/netcfg/mod.rs#L45 are `resolv/nameserver`, `route/{list, add, rm}`, `iface/eth0/{mac, addr/{list, add, rm}}`, these should be enough for DHCP. There's nothing preventing the dynamic creation of nodes.
- The schema implements directories, so it can be traversed as a regular file system.
- Readable nodes reflected the state of affairs at the time of `open` call, not the first `read`.
- Writable nodes 'commit' changes on `close`, not `write`.
- Nodes can notify about changes using `fevent`, to read the new value the file should be reopened.
- Right now the only route type supported is the default route which looks like `default via 192.168.1.1`.
- MAC and IP addresses of the interface are updated in `smoltcp`, the changes take effect immediately.
- `dnsd` has been updated to watch `resolv/nameserver` and switch nameservers on the fly.
Closes #7.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/16Add license and readme2018-01-31T18:29:45ZJeremy SollerAdd license and readme*Created by: NilSet*
*Created by: NilSet*
https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/17Change netcfg to validate on write and commit on fsync2018-02-03T14:14:06ZJeremy SollerChange netcfg to validate on write and commit on fsync*Created by: batonius*
As discussed, the PR changes the behavior of `netcfg` so it validates each line on write, and commits the changes on `fsync` and `close`. This way it's possible to return configuration errors via the return value ...*Created by: batonius*
As discussed, the PR changes the behavior of `netcfg` so it validates each line on write, and commits the changes on `fsync` and `close`. This way it's possible to return configuration errors via the return value of `File::sync_data`.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/18Use smoltcp::time types instead of u64 timestamps2018-02-16T03:07:53ZDan RobertsonUse smoltcp::time types instead of u64 timestampssmoltcp is moving towards using `time::Duration` and `time::Instant` instead
of a `u64` timestamp.
Dependencies: m-labs/smoltcp#141smoltcp is moving towards using `time::Duration` and `time::Instant` instead
of a `u64` timestamp.
Dependencies: m-labs/smoltcp#141https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/26add udp support2018-05-21T20:35:35ZJeremy Solleradd udp support*Created by: thinkrapido*
*Created by: thinkrapido*
https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/28Switch to an edge-triggered event system2018-05-30T15:25:58ZJeremy SollerSwitch to an edge-triggered event system*Created by: jD91mZM2*
- Only send events once.
- Resend events when new file is registered.
- Return EAGAIN when a read would be blocking.
- Return EAGAIN when an accept would be blocking (<- new! accepts can now be nonblocking!...*Created by: jD91mZM2*
- Only send events once.
- Resend events when new file is registered.
- Return EAGAIN when a read would be blocking.
- Return EAGAIN when an accept would be blocking (<- new! accepts can now be nonblocking!)
This matches the behavior of other systems more closely and allows me to basically almost completely revert all my work on tokio. It feels kind of sad but it's for the best.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/29Use new SchemeBlock trait2018-05-30T16:55:06ZJeremy SollerUse new SchemeBlock trait*Created by: jD91mZM2*
This trait allows us to actually return EWOULDBLOCK because now we don't use it internally for anything :smile:*Created by: jD91mZM2*
This trait allows us to actually return EWOULDBLOCK because now we don't use it internally for anything :smile:Jeremy SollerJeremy Sollerhttps://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/30Update smoltcp2018-06-19T13:58:03ZjD91mZM2Update smoltcpCloses #30Closes #30https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/31cargo update2018-07-05T21:39:44ZPaul Sajnacargo updatehttps://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/32Update Cargo.lock2018-07-27T16:19:27ZRobin RandhawaUpdate Cargo.lockA 'precise' cargo update of tokio is needed for the build to succeed.A 'precise' cargo update of tokio is needed for the build to succeed.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/34fix return statement of else block in dup function2018-12-06T17:45:38ZColleenfix return statement of else block in dup functionOne line change in tcp.rs discussed with jd91mzm2 in chat.One line change in tcp.rs discussed with jd91mzm2 in chat.https://gitlab.redox-os.org/redox-os/netstack/-/merge_requests/35Redox unix2020-05-21T18:00:00ZJeremy SollerRedox unix