auto-network foo

Looked at NetworkManager providing auto-proxy and auto-other information this weekend. There are a bunch of RFCs to look at for DHCP including the DHCP Option for Proxy Server Config. The second one is the more important one as it provides us with auto-proxy configuration information. There are also a bunch of other random and even helpful proxy information that we should be able to grab out of network manager. The SMTP server info is a nice one while a default IRC server is kind of random but still cool. :-)

For NM it seems like the interface should not be too complicated except that we might have different network paths for different device types.

For wireless device we might have an access string that looks like this:/org/freedesktop/NetworkManager/Devices/${dev}/Networks/${network}/dhcp/Options

So a wireless example could be:

/org/freedesktop/NetworkManager/Devices/eth0/Networks/linksys/dhcp/Options

And for a wired device we have this:

/org/freedesktop/NetworkManager/Devices/${dev}/dhcp/Options

So this is a wired exaple:

/org/freedesktop/NetworkManager/Devices/eth1/dhcp/Options

This means that your application, say Epiphany, can use $access_string from above (any of the variable information can be grabbed from NetworkManager as well) and then do a get($access_string, $access_code) to return all the DHCP information for the specific code.

As far as I can tell auto-proxy configuration access code seems to be called custom-proxy-server. The other useful items are:

  • time-servers (auto discover of tme server to check clock)

  • pop-server
  • smtp-server
  • www-server (auto-intranet discovery)

See man dhcp-options for more. These items are of course all limited to how savy your DHCP administrator really is, and while they provide the ability to auto-discover this information we can’t blindly auto-use it.

This D-BUS string path isn’t settled yet so don’t get too worried if it needs some work still. If anyone out there is a DHCP guru / auto-proxy configure master please join the NetworkManager list and start some discussion on it. Patches are always welcome too, but I don’t use proxy config so it’s hard to understand it all when I’m not in the situation at all.

Jean-Franois has already begun work to integrate an automatic discovery of online vs. offline state for Epiphany via NetworkManger, I’m excited to see this in action. Soon Epiphany will have the ability to become much smarter about accessing the interweb by knowing if your connection is changing, offline or online. +1 for integration!

Update: Ok, so I’m not sure what I was thinking at the time. The wireless doesn’t need to be expanded over the networks available since you can only dhcp on a single network at time. Meaning that for wired/wireless they will all look like: /org/freedesktop/NetworkManager/Devices/${dev}/dhcp/Options. More coffee, less crack…


About this entry