The best approach to change network configuration from applications.

Nicola Mfb nicola.mfb at gmail.com
Thu Oct 9 13:50:41 CEST 2008


2008/10/9 Alastair Johnson <alastair at truebox.co.uk>

> Nicola Mfb wrote:
> > I'm trying to write a test application that should change the network
> > configuration with a gui, what's the best approach?
> > Manually change /etc/network/interfaces? a wrapper library to do that?
> > dbus api call?
>
> That depends on which distro you're using, and how complete its network
> management is. 2008.x is using ConnMan which is an attempt at a lighter
> weight version of NetworkManager, but it seems rather incomplete. I
> think FSO is sticking with the basic debian-based interface using
> /etc/network/interfaces which mostly works according to the debian
> networking handbook. IIRC the bits needed for roaming connections are
>

Hi Alastair, here a better explanation of what I'd like to do:
I'm trying to use dbus with C++/QT under FSO, to test it I'm writing a
simple gui that is able to turn on/off the bluetooth adapter, and to spawn a
pan connection to my nap gentoo boxes. This is really simple with dbus, and
works fine with dbus-send or mdbus, now I'd like to support network
configuration to have different pan profiles, with or without dhcp, with or
without default routing and so on.

So actually should I modify /etc/network/interfaces directly in my
application or spawn some external script that does this with sed and after
launch ifdown/ifup bnep0?
This seems not much elegant to me, and to avoid mistakes on the
configuration file, I should read busybox c code to understand how it read
that file (a curiosity, there is a doc file in busybox that says please do
not use ifup/ifdown approach:))

The problem become bigger if I want to add a pan server option and so change
ip forwarding and iptables rules, launch dhcp or change the its ip range,
and so on...

What's we may expect in the future? would be nice to have frameworkd offer
nice api to hide and abstract all this tasks? should we ask for
connman/networkmanager official/default support in OE?

Regards

   Nicola
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/community/attachments/20081009/b6b0149a/attachment.htm 


More information about the community mailing list