[haiku-development] Re: Saving network settings

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 21 Nov 2014 22:43:30 +0100

On 11/21/2014 11:55 AM, Adrien Destugues wrote:
The old preflet wrote these settings to /etc/network/interfaces where
the net_server would pick them up. This is also how it worked in BeOS
(except there is no need to "restart networking" for us). Is that still
the correct way to handle it? Is there a shared API for doing it? (it's
just a driver settings file, but we need to decide what to put in it).
The old preflet used its own "settings" class, the new preflet extends
on that, and net_server has its own version of it (with unused _Save
method). I think we should merge these two so the network preferences
and the server work on the same settings format. Then the net_server can
use the _Save method to save settings. Does that sound right?

Not exactly :-)
At least I see two different ways to implement it that make some sense:
1) Keep the way the previous preferences application did it, ie. write the settings from the preferences application, and read them back from the server on change. It would indeed make sense to share the settings code, however, the client would write the settings, not the server. 2) Let the network server write the current settings on demand itself, ie. the preferences application only configures the interfaces manually/automatically/whatever, and would finally tell the network server to write the current settings back.

I would lean towards 1), though, as a) writing down the current settings may write stuff back you don't want there, and b) you might not be able derive everything from the current settings either.

Bye,
   Axel.


Other related posts: