The best approach to change network configuration from applications.
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? Regards Nicola ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: The best approach to change network configuration from applications.
Nicola Mfb wrote: 2008/10/9 Alastair Johnson [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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. Sounds good. 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:)) Debian lets you have multiple configurations for the same interface, so you can have for example different configs for eth0 at home and at work, or for wifi at different locations. I've not dealt with it in depth myself, except for trying to use its wifi roaming config and finding bits of that system missing. 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? OE already has both connman and networkmanager. I built it under fso-testing yesterday but haven't tried it yet. The KDE front end for NetworkManager may be close to what you're aiming at, depending on how much of it is pure Qt and how much KDE. I haven't used networkmanager much so I don't know if it supports configuring bluetooth connections. ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: The best approach to change network configuration from applications.
2008/10/9 Alastair Johnson [EMAIL PROTECTED] 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 ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: The best approach to change network configuration from applications.
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 missing though. Debian and Gentoo use their respective networking practices. NetworkManager is another option. The key is to pick one method and stick to it - mixing them usually ends up in them fighting for control of the interfaces. ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: The best approach to change network configuration from applications.
Am Donnerstag, den 09.10.2008, 11:24 +0200 schrieb Nicola Mfb: 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? Networking is on scope for FSO, but will be tackled not before end of this year. :M: ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: The best approach to change network configuration from applications.
Hi Michele, reading you message you told that in a future is possible that fso framework will manage network interface too. Is correct to think that I can use the fso dbus interface to manage wireless? DBus yes. At this point of time it's still unclear how much FSO will have to do on their own in the network space and how much it can delegate to one of the existing connection managers. I'm leaning towards just a bunch of simple high level calls like: * Setup the fastest IP connection and notify me when it's up * Setup the cheapest IP connectoin and notify me when it's up * Tell me about devices in vincinity * Send a file to a device delegating all the hard work to other software. :M: ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community