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 v3 1/5] session: add parameter Service into
createsession call of ConnMan session API ([email protected])
----------------------------------------------------------------------
Message: 1
Date: Mon, 22 May 2017 10:42:22 +0530
From: [email protected]
To: [email protected]
Cc: [email protected], Bjoern Thorwirth
<[email protected]>
Subject: [PATCH v3 1/5] session: add parameter Service into
createsession call of ConnMan session API
Message-ID: <[email protected]>
Content-Type: text/plain; charset=Y
From: Bjoern Thorwirth <[email protected]>
Extend the session API interface. enable a service differentiation
for processes run by the same user. allow 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.
This extension allows processes to select a service context
for which the routing decision is made.
---
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 e8da522..a449af2 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 Service [readonly]
+
+ The service context of the Session.
+ 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.
+ This parameter can be used to implement service context
dependent behavior
+ In session_policy_local.c. It should be supplied with
the ???dict Settings??? parameter
+ supplied with CreateSession() call from within the
manager-api.
diff --git a/include/session.h b/include/session.h
index 5106e88..3b3c53f 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 *service;
};
typedef int (* connman_session_config_func_t) (struct connman_session *session,
diff --git a/src/session.c b/src/session.c
index 9dd183f..2437538 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 *service;
};
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->service)
+ g_free(creation_data->service);
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.service != info_last->config.service) {
+ char *ifname = info->config.service;
+ if (!ifname)
+ ifname = "";
+ connman_dbus_dict_append_basic(dict, "Service",
+ DBUS_TYPE_STRING,
+ &ifname);
+ info_last->config.service = info->config.service;
+ }
+
+ 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, "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
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 19, Issue 12
***************************************