Skip to content

The netcfg scheme

Jeremy Soller requested to merge batonius:netcfg into master

Created by: batonius

The PR implements the netcfg scheme as described in #7 (closed).

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 (closed).

Merge request reports