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. [PATCH] session: Add ContextIdentifier (Daniel Wagner)
   2. Re: Fw: Re: Connman coredump (Daniel Wagner)


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

Message: 1
Date: Thu, 28 Sep 2017 16:52:23 +0200
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Bjoern Thorwirth <[email protected]>
Subject: [PATCH] session: Add ContextIdentifier
Message-ID: <[email protected]>

From: Bjoern Thorwirth <[email protected]>

The 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.

This extension allows processes to select a service context dependent
behaviour for which the routing decision is made.

This is an extention to session API interface. Helps to enable a
service differentiation for processes run by the same user. Allows
ConnMan to differentiate between bearer usage permissions and the
respective priorities based on the requested service type.
---

Hi,

after an offline discussion with Bjorn, we came to the conclusion that
my idea with AllowedServices is going into the wrong
direction. At least for his use case.

Propably I got confused by the name 'Session'. By calling this
ContextIdentifier we should avoid this confusion. In the end it is
just an additonal information given by the application to support the
bearer selection algorithm. Currently, the session code in ConnMan
doesn't make use of it, but a session plugin can use it. That is what
Bjorn does.

Thanks,
Daniel

doc/session-api.txt | 11 +++++++++++
 include/session.h   |  1 +
 src/session.c       | 17 +++++++++++++++++
 3 files changed, 29 insertions(+)

diff --git a/doc/session-api.txt b/doc/session-api.txt
index e8da5224dbf7..46ac5f3dc94a 100644
--- a/doc/session-api.txt
+++ b/doc/session-api.txt
@@ -205,3 +205,14 @@ Settings   string State [readonly]
                        a default route. When the source IP rule is enabled,
                        an application can select which session/interface to
                        send traffic on, using bind-before-connect mechanism.
+
+               string ContextIdentifier [readwrite] [experimental]
+
+                       The application can provide an identifier for a
+                       session. If an application runs several session
+                       at the same time, the additional information
+                       can be used by ConnMan to assign different
+                       bearers according the identifier. For example
+                       a web browser creates per tab a session. For
+                       each session a different should bearer be
+                       assigned.
diff --git a/include/session.h b/include/session.h
index 5106e886b9ab..39f3368554ed 100644
--- a/include/session.h
+++ b/include/session.h
@@ -74,6 +74,7 @@ struct connman_session_config {
        GSList *allowed_bearers;
        char *allowed_interface;
        bool source_ip_rule;
+       char *context_identifier;
 };
 
 typedef int (* connman_session_config_func_t) (struct connman_session *session,
diff --git a/src/session.c b/src/session.c
index 9e3c55941ee6..108228a820a7 100644
--- a/src/session.c
+++ b/src/session.c
@@ -548,6 +548,7 @@ struct creation_data {
        GSList *allowed_bearers;
        char *allowed_interface;
        bool source_ip_rule;
+       char *context_identifier;
 };
 
 static void cleanup_creation_data(struct creation_data *creation_data)
@@ -557,6 +558,8 @@ static void cleanup_creation_data(struct creation_data 
*creation_data)
 
        if (creation_data->pending)
                dbus_message_unref(creation_data->pending);
+       if (creation_data->context_identifier)
+               g_free(creation_data->context_identifier);
 
        g_slist_free(creation_data->allowed_bearers);
        g_free(creation_data->allowed_interface);
@@ -927,6 +930,17 @@ static void append_notify(DBusMessageIter *dict,
        }
 
        if (session->append_all ||
+                       info->config.context_identifier != 
info_last->config.context_identifier) {
+               char *ifname = info->config.context_identifier;
+               if (!ifname)
+                       ifname = "";
+               connman_dbus_dict_append_basic(dict, "Context_Identifier",
+                                               DBUS_TYPE_STRING,
+                                               &ifname);
+               info_last->config.context_identifier = 
info->config.context_identifier;
+       }
+
+       if (session->append_all ||
                        info->config.source_ip_rule != 
info_last->config.source_ip_rule) {
                dbus_bool_t source_ip_rule = FALSE;
                if (info->config.source_ip_rule)
@@ -1474,6 +1488,9 @@ int __connman_session_create(DBusMessage *msg)
                                        
connman_session_parse_connection_type(val);
 
                                user_connection_type = true;
+                       } else if (g_str_equal(key, "ContextIdentifier")) {
+                               dbus_message_iter_get_basic(&value, &val);
+                               creation_data->context_identifier = 
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.9.5


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

Message: 2
Date: Thu, 28 Sep 2017 17:06:00 +0200
From: Daniel Wagner <[email protected]>
To: Cliff McDiarmid <[email protected]>, connman
        <[email protected]>
Subject: Re: Fw: Re: Connman coredump
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi Cliff,

>> Connman has been a breeze to run in the past.? This IS my first 64bit system.
> 
>> What kind of distro are you using? Did you upgrade from a 32bit
>> installation to 64bit and keeping the /var/lib/connman directory? If so,
>> we just might have to problem, that the history files etc are in 32bit
>> and not in 64bit. Just a wild guess.
> 
> A wild guess maybe, but dead on.  I had moved the /var/lib/connman directory 
> straight to the new system, as i do a lot of traveling and had many wifi 
> configs.
> 
> I had completely forgotten this move.  Many thanks for your patience Daniel, 
> this is a terrific product.

Note you don't have to delete all the files. You just need to delete the 
stats files. Then all should be fine again.

Glad we could resolve this problem :)

Thanks,
Daniel


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

Subject: Digest Footer

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


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

End of connman Digest, Vol 23, Issue 20
***************************************

Reply via email to