[PATCH v3 15/15] session_policy_ivi: Implement policy_load()

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner If config file should also be parsed and the values then stored in the config object. --- plugins/session_policy_ivi.c | 93 +++- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/plugins/session_policy_ivi.c b/plugins/sess

[PATCH v3 14/15] session_policy_ivi: Watch for changes on policy files

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner Monitor changes on the config files. Either create, modify or destroy them according the events we get from the inotify interface. --- plugins/session_policy_ivi.c | 63 +--- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git

[PATCH v3 13/15] session_policy_ivi: Add hash table to track idents

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner Introduce the second hash table which tracks the config object lifetime based on the file existens. The parsing of the file and creation of the config object is part of the next patch. --- plugins/session_policy_ivi.c | 34 ++ 1 file changed, 3

[PATCH v3 12/15] session_policy_ivi: Create session config

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner The policy data object is refcounted because the policy data object can be created either through the session core or from the file based policy. In order to avoid complex logic which tries to figure out when to is safe to destroy the object we just fall back to refcountig. p

[PATCH v3 11/15] session_policy_ivi: Get SELinux context of session owner

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner --- plugins/session_policy_ivi.c | 96 +++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/plugins/session_policy_ivi.c b/plugins/session_policy_ivi.c index 2c30b05..40a1f99 100644 --- a/plugins/session_policy_ivi.c +++ b

[PATCH v3 10/15] session_policy_ivi: Add policy plugin for IVI

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner Add only the empty 'framework'. In the following patches we add step by step the implementation. --- Makefile.plugins | 12 ++ configure.ac | 6 +++ plugins/session_policy_ivi.c | 91 3 files change

[PATCH v3 09/15] session: Don't filter match all out

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner If the user provides the match all rule we should add the policy bearer to the result. --- src/session.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/session.c b/src/session.c index a896503..e0de530 100644 --- a/src/session.c +++ b/src/session.c @@ -455,6 +455,9

[PATCH v3 08/15] session: Store user AllowedBearers configuration

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner Don't overwrite the user provided AllowedBearers configuration. Instead just store it at session level. So we always will apply the bearer filter on the user input. Obviously, this might need some more improvements on how we want to handle the AllowedBearers behavior when the

[PATCH v3 07/15] session: Export session parsing functions

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner We want to reuse these functions. --- include/session.h | 4 src/session.c | 54 ++ 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/include/session.h b/include/session.h index 8fbf88e..2b83e49 1006

[PATCH v3 06/15] session: Add connman_session_get_owner()

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner --- include/session.h | 2 ++ src/session.c | 5 + 2 files changed, 7 insertions(+) diff --git a/include/session.h b/include/session.h index cbed939..8fbf88e 100644 --- a/include/session.h +++ b/include/session.h @@ -79,6 +79,8 @@ void connman_session_config_update(s

[PATCH v3 05/15] session: Update sessions on config updates

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner Give a policy plugin a way to inform the session core that some of the config values have changed. This could be done in a more clever way, e.g. figure out only to update the necessary info entries but we keep it for now as simple and assume everthing has changed. --- includ

[PATCH v3 04/15] dbus: Add SELinux support

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner ConnMan needs to identify application in a secure way when they are using the Session API. The current D-Bus server implemention supports two types of LSM, POSIX and SELinux. In order to support SMACK or TOMOYO the D-Bus code base needs to be patch. This is the initial work to

[PATCH v3 03/15] inotify: Move inotify code into its own file

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner The inotify code will be used by the core (config.c) and the session policy plugin. We introduce a new API for file modifcation notifcation. We move the factored out code part from the last patch into a new file and also change the inotify code so that it allows to monitor no

[PATCH v3 02/15] config: Factor out config inotify handler

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner The inotify code can be reused. So before we introduce a new generic inotify API, let's factor out in order to simplify the review process. --- src/config.c | 97 1 file changed, 52 insertions(+), 45 deletions(-) d

[PATCH v3 00/15] Policy IVI Plugin (part 2)

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner Hi, An updated version of part2. Noteworthy changes are the drop the additional directory for the SELinux function. I have moved it to connman/dbus.c. Another thing is that I introduced refcounting for the policy object. And suddenly the messy code went away. I think overall

[PATCH v3 01/15] build: No FORTIFY flags when building without optimization

2012-11-02 Thread Daniel Wagner
From: Daniel Wagner When building with --disable-optimiziation we need to make sure the compiler flags do not include -O0 and FORTITFY when compiling the resolv.h header file. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac ind

[PATCH v2 5/9] service: Set up technology powered notifier

2012-11-02 Thread patrik . flykt
From: Patrik Flykt --- src/service.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/service.c b/src/service.c index 2ba34b8..326e4a2 100644 --- a/src/service.c +++ b/src/service.c @@ -3417,6 +3417,13 @@ void __connman_service_filter_types(connman_bool_t add, GSList *l

[PATCH v2 9/9] manager: Setting SessionMode must not disconnect all services

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Change SessionMode property handling so that the value is changed but the operation does not disconnect all services. --- src/manager.c | 24 src/session.c |3 --- 2 files changed, 27 deletions(-) diff --git a/src/manager.c b/src/manager.c index

[PATCH v2 7/9] session: Let autoconnect handle service connecting

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Remove direct calls for service connecting and disconnecting when configuring sessions. Update the session connecting to call service autoconnect. --- v2: service disconnection removal is moved to patch 09 src/session.c |9 + 1 file changed, 1 insertion(+), 8 dele

[PATCH v2 4/9] notifier: Add technology powered notifier function

2012-11-02 Thread patrik . flykt
From: Patrik Flykt --- include/notifier.h |2 ++ src/connman.h |2 ++ src/notifier.c | 15 +++ 3 files changed, 19 insertions(+) diff --git a/include/notifier.h b/include/notifier.h index 4412717..f1d394f 100644 --- a/include/notifier.h +++ b/include/notifier.h @@

[PATCH v2 8/9] service: Auto connection is unaffected by SessionMode

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Update code and documentation. --- doc/manager-api.txt |6 ++ src/service.c |5 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/doc/manager-api.txt b/doc/manager-api.txt index ca193aa..ea17a20 100644 --- a/doc/manager-api.txt +++ b/doc/ma

[PATCH v2 6/9] technology: Call technology powered notification function

2012-11-02 Thread patrik . flykt
From: Patrik Flykt --- src/technology.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/src/technology.c b/src/technology.c index 1ff8fb7..94bb2d4 100644 --- a/src/technology.c +++ b/src/technology.c @@ -1212,6 +1212,8 @@ static void powered_changed(struct connman_technology *technolog

[PATCH v2 0/9] Using autoconnect to connect sessions

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Hi, For version 2 of this set there are two additions. Patch 08 removes the disabling of autoconnect when session mode is enabled. Patch 09 changes the SessionMode property setting to be instant, it no longer waits for idle state to happen when enabling SessionMode. The

[PATCH v2 1/9] service: Add function for updating service types used by sessions

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Add function for counting the number of sessions using a certain service type. Add a type specific boolean to know if the session type is used and a general one to know if there exists any technology types requested by sessions. Also keep track of the technology powered state

[PATCH v2 2/9] service: Add mechanism to filter by session technology types

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Add a session technology type filter for autoconnect handling in auto_connect_service(). Do a first autoconnect pass over the services using the current state of session requests. If that does not get result in any services being connected, do another pass with session selectio

[PATCH v2 3/9] session: Inform which bearers are in use by sessions

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Update service autoconnection with the allowed bearers when creating, updating and disconnecting sessions. --- src/session.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/session.c b/src/session.c index 77a6c85..b6d9d5b 100644 --- a/src/session.c ++

Re: [PATCH 7/7] session: Let autoconnect handle service connecting

2012-11-02 Thread Patrik Flykt
Hi, On Fri, 2012-11-02 at 12:51 +0100, Daniel Wagner wrote: > If you have a good plain to fix this, go ahead :) Version 2 coming up, with that one the session unit tests work until the explicit disconnection test. I'm afraid that cannot be universally supported. > That means you want to

Re: [PATCH 1/7] service: Add function for updating service types used by sessions

2012-11-02 Thread Patrik Flykt
Hi, On Fri, 2012-11-02 at 10:54 +0100, Daniel Wagner wrote: > Couldn't use something like > > #define MAX_SERVICE CONNMAN_SERVICE_TYPE_GADGET + 1 > > and maybe also add a big comment to update the define if enum > connman_service_type grows (if you really want to go with the array) I

Re: [PATCH 7/7] session: Let autoconnect handle service connecting

2012-11-02 Thread Daniel Wagner
Hi Patrik, On 02.11.2012 12:18, Patrik Flykt wrote: On Fri, 2012-11-02 at 11:06 +0100, Daniel Wagner wrote: With this removal (which should remove the comple function btw) Yep, I just had to stop at the minimum so that the patch set would be readable. As part II there is quite a lot more that

Re: [PATCH 7/7] session: Let autoconnect handle service connecting

2012-11-02 Thread Patrik Flykt
On Fri, 2012-11-02 at 11:06 +0100, Daniel Wagner wrote: > With this removal (which should remove the comple function btw) Yep, I just had to stop at the minimum so that the patch set would be readable. As part II there is quite a lot more that can be removed. > you will > break the unit tests. W

Re: [PATCH 7/7] session: Let autoconnect handle service connecting

2012-11-02 Thread Daniel Wagner
Hi Patrik, On 11/02/2012 09:33 AM, patrik.fl...@linux.intel.com wrote: From: Patrik Flykt Remove direct calls for service connecting and disconnecting when configuring sessions. Update the session connecting to call service autoconnect. --- src/session.c | 11 +-- 1 file changed,

Re: [PATCH 3/7] session: Inform which bearers are in use by sessions

2012-11-02 Thread Daniel Wagner
On 11/02/2012 09:33 AM, patrik.fl...@linux.intel.com wrote: From: Patrik Flykt Update service autoconnection with the allowed bearers when creating, updating and disconnecting sessions. --- src/session.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/session.c b/s

Re: [PATCH 2/7] service: Add mechanism to filter by session technology types

2012-11-02 Thread Daniel Wagner
On 11/02/2012 09:33 AM, patrik.fl...@linux.intel.com wrote: From: Patrik Flykt Add a session technology type filter for autoconnect handling in auto_connect_service(). Do a first autoconnect pass over the services using the current state of session requests. If that does not result in any servi

Re: [PATCH 1/7] service: Add function for updating service types used by sessions

2012-11-02 Thread Daniel Wagner
Hi Patrik, On 11/02/2012 09:33 AM, patrik.fl...@linux.intel.com wrote: From: Patrik Flykt Add function for counting the number of sessions using a certain service type. Add a type specific boolean to know if the session type is used and a general one to know if there exists any technology type

Re: connman does not configure ethernet

2012-11-02 Thread Tomasz Bursztyka
Hi Tim, I missatached the file. Somehow i had an old connman patch lying in the same directory and attached the wrong file. (Unfortunatly it was a patch which caused enought confusion already... if i would be beliving i would say this thing is cursed;-). Ok that explains it, looked really weird

[PATCH 4/4] openconnect: Domain pointer was used incorrectly

2012-11-02 Thread Jukka Rissanen
We must allocate the domain name from the heap and not point to it directly because the dbus library will deallocate it and we will have invalid memory access. --- vpn/plugins/openconnect.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vpn/plugins/openconnect.c b

[PATCH 2/4] vpn: Add initial support for async connect

2012-11-02 Thread Jukka Rissanen
Needed for agent VPN support. --- vpn/plugins/l2tp.c| 27 +++ vpn/plugins/openconnect.c | 23 --- vpn/plugins/openvpn.c | 14 ++ vpn/plugins/pptp.c| 24 +--- vpn/plugins/vpn.c | 5 +++-- vpn/pl

[PATCH 3/4] openconnect: Add asking cookie from agent

2012-11-02 Thread Jukka Rissanen
It is possible to ask the cookie from agent for OpenConnect VPN client. The agent should connect to VPN gateway, get the HTML page, show the page in window or parse the HTML, then allow user to feed the user id and passphrase and post the result. The server will then return cookie to agent which sh

[PATCH 1/4] doc: Describe VPN agent API

2012-11-02 Thread Jukka Rissanen
--- doc/vpn-agent-api.txt | 137 ++ 1 file changed, 137 insertions(+) create mode 100644 doc/vpn-agent-api.txt diff --git a/doc/vpn-agent-api.txt b/doc/vpn-agent-api.txt new file mode 100644 index 000..bdef9f3 --- /dev/null +++ b/doc/vpn-agent-

[PATCH 0/4] VPN agent support

2012-11-02 Thread Jukka Rissanen
Hi, attached is the initial VPN agent support. This means that VPN plugin is able to ask necessary questions from agent which will ask the information from the user. The VPN agent API is documented in patch 1. As the user supplied information is asked during the VPN connect phase, the VPN connec

Re: [PATCH 0/2] DHCP clear address before starting

2012-11-02 Thread Patrik Flykt
On Thu, 2012-11-01 at 14:16 +0200, Jukka Rissanen wrote: > Hi, > > Tim Sander noticed an issue where we might not be able to set > ipaddress from DHCP in the system if IP address information > is already found in the service settings file. Something like > this could happen if user changes between

[PATCH 3/7] session: Inform which bearers are in use by sessions

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Update service autoconnection with the allowed bearers when creating, updating and disconnecting sessions. --- src/session.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/session.c b/src/session.c index 77a6c85..f8d062b 100644 --- a/src/session.c +

[PATCH 7/7] session: Let autoconnect handle service connecting

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Remove direct calls for service connecting and disconnecting when configuring sessions. Update the session connecting to call service autoconnect. --- src/session.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/session.c b/src/session.c

[PATCH 6/7] technology: Call technology powered notification function

2012-11-02 Thread patrik . flykt
From: Patrik Flykt --- src/technology.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/src/technology.c b/src/technology.c index 1ff8fb7..94bb2d4 100644 --- a/src/technology.c +++ b/src/technology.c @@ -1212,6 +1212,8 @@ static void powered_changed(struct connman_technology *technolog

[PATCH 5/7] service: Set up technology powered notifier

2012-11-02 Thread patrik . flykt
From: Patrik Flykt --- src/service.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/service.c b/src/service.c index 2ba34b8..326e4a2 100644 --- a/src/service.c +++ b/src/service.c @@ -3417,6 +3417,13 @@ void __connman_service_filter_types(connman_bool_t add, GSList *l

[PATCH 0/7] Using autoconnect to connect sessions

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Hi, Here is a patch set that uses the existing autoconnect mechanism when connecting sessions. With two or more sessions having conflicting interests on the technologies to connect and especially where the default route is to be set, are now handled with the autoconnec

[PATCH 1/7] service: Add function for updating service types used by sessions

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Add function for counting the number of sessions using a certain service type. Add a type specific boolean to know if the session type is used and a general one to know if there exists any technology types requested by sessions. Also keep track of the technology powered state

[PATCH 4/7] notifier: Add technology powered notifier function

2012-11-02 Thread patrik . flykt
From: Patrik Flykt --- include/notifier.h |2 ++ src/connman.h |2 ++ src/notifier.c | 15 +++ 3 files changed, 19 insertions(+) diff --git a/include/notifier.h b/include/notifier.h index 4412717..f1d394f 100644 --- a/include/notifier.h +++ b/include/notifier.h @@

[PATCH 2/7] service: Add mechanism to filter by session technology types

2012-11-02 Thread patrik . flykt
From: Patrik Flykt Add a session technology type filter for autoconnect handling in auto_connect_service(). Do a first autoconnect pass over the services using the current state of session requests. If that does not result in any services being connected, do another pass with session selection tu