From: Patrik Flykt <[email protected]>
Hi,
Here is a first rough take on VPN support for sessions. The VPN support
assumes there are already VPN services created beforehand, i.e. configured
via ConnectProvider before session mode is enabled.
I'm thinking that a VPN should be sorted to the session service list just
as any other normal service, possibly first as the highest weight patch 1
implies. But a VPN is not a normal service with a network, it can be
enabled only if there already is an (IP) network connected. I'd also want
a session to be able to specify just "vpn" as it's only preference, as it
should not need to specify other technologies to get the initial network
connectivity enabled. Patch 2 tries to figure out whether ConnMan is
already connected or not, which means that in patch 3 VPN service is skipped
if there is no network connectivity present.
Finally, when a network is connected, patch 4 attempts to figure out
whether the session should be looked at once more, i.e. whether the session
was configured with VPNs. I was talking with wagi about optimizing the code
in service_state_changed() to check already there if the service belongs
to the session, but that would prevent the service state change being used
for connecting VPNs in respective sessions.
I'm not happy at all with patch 4, a value of session->connect_provider
would be much better in my opinion. Or then to rework the session->online
boolean altogether. Unfortunately I'm busy with other things next week,
thus I'm sending this as request for comments so that it hopefully will
trigger an avalanche of them.
Cheers,
Patrik
Patrik Flykt (4):
session: Highest weight for VPN service type
service: Helper function for detecting network connectivity
session: Check that there is a connection before connecting VPN
Test triggering service if it has a provider
include/service.h | 1 +
src/service.c | 27 +++++++++++++++++++++++++++
src/session.c | 32 +++++++++++++++++++++++++++++---
3 files changed, 57 insertions(+), 3 deletions(-)
--
1.7.2.5
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman