Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. Re: [PATCH] config: Memory leak in
      connman_config_provision_mutable_service (Daniel Wagner)
   2. Re: Connman to control OpenVPN connection (Florent Le Saout)
   3. [PATCH v2 1/5] session: add parameter Service into
      createsession call of ConnMan session API ([email protected])
   4. [PATCH v2 2/5] session: Callback hook for policy plugins to
      update session state ([email protected])
   5. [PATCH v2 3/5] service: Query function to retrieve service
      handle ([email protected])
   6. [PATCH v2 4/5] session: Callback hook for policy plugin to
      return service of session ([email protected])
   7. [PATCH v2 5/5] session: Interface to query session->mark
      value ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Tue, 25 Apr 2017 09:09:34 +0200
From: Daniel Wagner <[email protected]>
To: Slava Monich <[email protected]>, [email protected]
Subject: Re: [PATCH] config: Memory leak in
        connman_config_provision_mutable_service
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

Hi Slava,

On 04/21/2017 11:22 AM, Slava Monich wrote:
> The value returned by g_key_file_get_start_group has to be
> deallocated by the caller.

Forgot to post 'patch applied' yesterday.

Thanks,
Daniel


------------------------------

Message: 2
Date: Tue, 25 Apr 2017 10:03:39 +0200
From: Florent Le Saout <[email protected]>
To: Daniel Wagner <[email protected]>, "[email protected]"
        <[email protected]>
Subject: Re: Connman to control OpenVPN connection
Message-ID: <[email protected]>
Content-Type: text/plain; charset="windows-1252"

Hi Daniel,

Yep I spent some time digging into it.

Since it took me few weeks to answer back, I think I'll not complain
about 2-3 days more ;)

Let me know if I can help,

Florent.


On 24/04/2017 22:20, Daniel Wagner wrote:
> Hi Florent,
>
> On 04/19/2017 05:08 PM, Florent Le Saout wrote:
>> I think I figured out the reproducing method.
>>
>> When I get the first connection, (so before the local settings file
>> exist : vpn_X_X_X_X/settings) the route is always wrong.
>>
>> But at the second boot when the file is already there the route is
>> properly setup.
>>
>> Please find attached the logs with proper and incorrect route setup.
>>
>> I guess it's trying to set the default route to the kernel before the
>> vpn tunnel is actually ready ?
>> Let me know if there is other points I should check or if I should add
>> more logs.
>
> Thanks for taking time digging into this. I think with this info I
> should be able to see there is a problem. But just not today/tonight :)
>
> Thanks,
> Daniel

-- 
*Florent LE SAOUT*
R&D department
Embedded Software Developer
AUSY contractor for KERLINK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.01.org/pipermail/connman/attachments/20170425/ef214cc0/attachment-0001.html>

------------------------------

Message: 3
Date: Tue, 25 Apr 2017 15:14:16 +0530
From: [email protected]
To: [email protected]
Cc: [email protected], Bjoern Thorwirth
        <[email protected]>
Subject: [PATCH v2 1/5] session: add parameter Service into
        createsession call of ConnMan session API
Message-ID:
        <[email protected]>

From: Bjoern Thorwirth <[email protected]>

It is extension to the session API interface. It enables a service 
differentiation
for processes run by the same user. It allows ConnMan to differentiate between 
bearer
usage permissions and the respective priorities based on the requested service 
type.

Usually calling process that implements the session API is identified by the 
user ID
as it is runs. All processes of the same user share the same list of allowed 
bearers,
and the same priority for choosing between available bearers is applied.

With the proposed changes, extension allows processes to select a service 
context
for which the routing decision is made.

diff --git a/src/session.c b/src/session.c
index 1f80b14..b77d9dc 100644
--- a/src/session.c
+++ b/src/session.c
@@ -549,6 +549,7 @@ struct creation_data {
        GSList *allowed_bearers;
        char *allowed_interface;
        bool source_ip_rule;
+       char *service;
 };
 
 static void cleanup_creation_data(struct creation_data *creation_data)
@@ -558,6 +559,8 @@ static void cleanup_creation_data(struct creation_data 
*creation_data)
 
        if (creation_data->pending)
                dbus_message_unref(creation_data->pending);
+       if (creation_data->service)
+               g_free(creation_data->service);
 
        g_slist_free(creation_data->allowed_bearers);
        g_free(creation_data->allowed_interface);
@@ -1475,6 +1478,9 @@ int __connman_session_create(DBusMessage *msg)
                                        
connman_session_parse_connection_type(val);
 
                                user_connection_type = true;
+                       } else if (g_str_equal(key, "Service")) {
+                               dbus_message_iter_get_basic(&value, &val);
+                               creation_data->service = g_strdup(val);
                        } else if (g_str_equal(key, "AllowedInterface")) {
                                dbus_message_iter_get_basic(&value, &val);
                                creation_data->allowed_interface = 
g_strdup(val);
-- 
2.7.4



------------------------------

Message: 4
Date: Tue, 25 Apr 2017 15:15:09 +0530
From: [email protected]
To: [email protected]
Cc: [email protected], Bjoern Thorwirth
        <[email protected]>
Subject: [PATCH v2 2/5] session: Callback hook for policy plugins to
        update session state
Message-ID:
        <[email protected]>

From: Bjoern Thorwirth  <[email protected]>

Called when state of session changes.

diff --git a/include/session.h b/include/session.h
index 48f1510..25a5e58 100644
--- a/include/session.h
+++ b/include/session.h
@@ -55,6 +55,12 @@ enum connman_session_id_type {
        CONNMAN_SESSION_ID_TYPE_LSM     = 3,
 };
 
+enum connman_session_state {
+       CONNMAN_SESSION_STATE_DISCONNECTED   = 0,
+       CONNMAN_SESSION_STATE_CONNECTED      = 1,
+       CONNMAN_SESSION_STATE_ONLINE         = 2,
+};
+
 struct connman_session;
 
 struct connman_session_config {
@@ -85,6 +91,8 @@ struct connman_session_policy {
                                GSList *bearers);
        bool (*allowed)(struct connman_session *session,
                        struct connman_service *service);
+       void (*update_session_state)(struct connman_session* session,
+                                    enum connman_session_state state);
 };
 
 int connman_session_policy_register(struct connman_session_policy *config);
diff --git a/src/session.c b/src/session.c
index b77d9dc..0c8c0bb 100644
--- a/src/session.c
+++ b/src/session.c
@@ -38,12 +38,6 @@ static GHashTable *service_hash;
 static struct connman_session *ecall_session;
 static uint32_t session_mark = 256;
 
-enum connman_session_state {
-       CONNMAN_SESSION_STATE_DISCONNECTED   = 0,
-       CONNMAN_SESSION_STATE_CONNECTED      = 1,
-       CONNMAN_SESSION_STATE_ONLINE         = 2,
-};
-
 struct session_info {
        struct connman_session_config config;
        enum connman_session_state state;
@@ -1691,6 +1685,10 @@ static void update_session_state(struct connman_session 
*session)
        del_nat_rules(session);
        update_routing_table(session);
        add_nat_rules(session);
+
+       if (policy && policy->update_session_state)
+               policy->update_session_state(session, state);
+
        session_notify(session);
 }
 
diff --git a/tools/session-test.h b/tools/session-test.h
index 5e6d196..8512933 100644
--- a/tools/session-test.h
+++ b/tools/session-test.h
@@ -68,12 +68,6 @@ void util_session_cleanup(struct test_session *session);
 
 typedef void (* notify_func_t) (struct test_session *session);
 
-enum connman_session_state {
-       CONNMAN_SESSION_STATE_DISCONNECTED   = 0,
-       CONNMAN_SESSION_STATE_CONNECTED      = 1,
-       CONNMAN_SESSION_STATE_ONLINE         = 2,
-};
-
 struct test_session_info {
        enum connman_session_state state;
        char *name;
-- 
2.7.4



------------------------------

Message: 5
Date: Tue, 25 Apr 2017 15:15:22 +0530
From: [email protected]
To: [email protected]
Cc: [email protected], Bjoern Thorwirth
        <[email protected]>
Subject: [PATCH v2 3/5] service: Query function to retrieve service
        handle
Message-ID:
        <[email protected]>

From: Bjoern Thorwirth <[email protected]>

Query function to retrieve service handle for service identifier string

diff --git a/include/service.h b/include/service.h
index 185f008..958e7fd 100644
--- a/include/service.h
+++ b/include/service.h
@@ -130,6 +130,7 @@ bool connman_service_get_favorite(struct connman_service 
*service);
 bool connman_service_get_autoconnect(struct connman_service *service);
 
 struct connman_service *connman_service_lookup_from_network(struct 
connman_network *network);
+struct connman_service *connman_service_lookup_from_identifier(const char* 
identifier);
 
 void connman_service_create_ip4config(struct connman_service *service,
                                                                int index);
diff --git a/src/service.c b/src/service.c
index 2289d54..d9c1907 100644
--- a/src/service.c
+++ b/src/service.c
@@ -6404,6 +6404,11 @@ static struct connman_service 
*lookup_by_identifier(const char *identifier)
        return g_hash_table_lookup(service_hash, identifier);
 }
 
+struct connman_service *connman_service_lookup_from_identifier(const char* 
identifier)
+{
+       return lookup_by_identifier(identifier);
+}
+
 struct provision_user_data {
        const char *ident;
        int ret;
-- 
2.7.4



------------------------------

Message: 6
Date: Tue, 25 Apr 2017 15:15:40 +0530
From: [email protected]
To: [email protected]
Cc: [email protected], Bjoern Thorwirth
        <[email protected]>
Subject: [PATCH v2 4/5] session: Callback hook for policy plugin to
        return service of session
Message-ID:
        <[email protected]>

From: Bjoern Thorwirth <[email protected]>

Returns the allowed service for a session based on a provided list of available 
services.

diff --git a/include/session.h b/include/session.h
index 25a5e58..0d66f48 100644
--- a/include/session.h
+++ b/include/session.h
@@ -93,6 +93,8 @@ struct connman_session_policy {
                        struct connman_service *service);
        void (*update_session_state)(struct connman_session* session,
                                     enum connman_session_state state);
+       struct connman_service* (*get_service_for_session)(struct 
connman_session* session,
+                                                          GSList* services);
 };
 
 int connman_session_policy_register(struct connman_session_policy *config);
diff --git a/src/session.c b/src/session.c
index 0c8c0bb..b408037 100644
--- a/src/session.c
+++ b/src/session.c
@@ -1757,6 +1757,41 @@ static void session_activate(struct connman_session 
*session)
        if (!service_hash)
                return;
 
+       if (policy && policy->get_service_for_session)
+       {
+               struct connman_service *service;
+               struct connman_service_info *info;
+               GSList *service_list = NULL;
+               enum connman_service_state state = 
CONNMAN_SESSION_STATE_DISCONNECTED;
+
+               g_hash_table_iter_init(&iter, service_hash);
+
+               while (g_hash_table_iter_next(&iter, &key, &value)) {
+                       struct connman_service_info *info = value;
+                       state = __connman_service_get_state(info->service);
+
+                       if (is_session_connected(session, state))
+                               service_list = g_slist_prepend(service_list,
+                                                              info->service);
+               }
+
+               service_list = g_slist_reverse(service_list);
+               service = policy->get_service_for_session(session,service_list);
+
+               if (service) {
+                       info = g_hash_table_lookup(service_hash,service);
+                       DBG("session %p add service %p", session, 
info->service);
+
+                       info->sessions = g_slist_prepend(info->sessions,
+                                                       session);
+                       session->service = info->service;
+                       update_session_state(session);
+               }
+
+               g_slist_free(service_list);
+               return;
+       }
+
        g_hash_table_iter_init(&iter, service_hash);
        while (g_hash_table_iter_next(&iter, &key, &value)) {
                struct connman_service_info *info = value;
-- 
2.7.4



------------------------------

Message: 7
Date: Tue, 25 Apr 2017 15:15:51 +0530
From: [email protected]
To: [email protected]
Cc: [email protected], Bjoern Thorwirth
        <[email protected]>
Subject: [PATCH v2 5/5] session: Interface to query session->mark
        value
Message-ID:
        <[email protected]>

From: Bjoern Thorwirth <[email protected]>

Will return the session mark
(without needing to expose the complete struct connman_session)

diff --git a/include/session.h b/include/session.h
index 0d66f48..68be6a9 100644
--- a/include/session.h
+++ b/include/session.h
@@ -22,8 +22,10 @@
 #ifndef __CONNMAN_SESSION_H
 #define __CONNMAN_SESSION_H
 
+#include <stdint.h>
 #include <connman/service.h>
 
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -97,6 +99,7 @@ struct connman_session_policy {
                                                           GSList* services);
 };
 
+uint32_t connman_session_firewall_get_fwmark(struct connman_session *session);
 int connman_session_policy_register(struct connman_session_policy *config);
 void connman_session_policy_unregister(struct connman_session_policy *config);
 
diff --git a/src/session.c b/src/session.c
index b408037..d66ba3f 100644
--- a/src/session.c
+++ b/src/session.c
@@ -436,6 +436,11 @@ static void add_nat_rules(struct connman_session *session)
        g_free(ifname);
 }
 
+uint32_t connman_session_firewall_get_fwmark(struct connman_session *session)
+{
+       return session->mark;
+}
+
 static void cleanup_routing_table(struct connman_session *session)
 {
        DBG("");
-- 
2.7.4



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 18, Issue 22
***************************************

Reply via email to