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 v2] client: Add session contextIdentifier config
support ([email protected])
2. [PATCH] wifi: Stop autoscanning once tethering has started
([email protected])
3. RE: [PATCH v2] dns: Use hash table instead of binary tree
(Puustinen, Ismo)
4. Re: [PATCH v2] dns: Use hash table instead of binary tree
(Daniel Wagner)
----------------------------------------------------------------------
Message: 1
Date: Mon, 9 Oct 2017 11:41:12 +0530
From: [email protected]
To: [email protected]
Cc: [email protected], Bjoern Thorwirth
<[email protected]>
Subject: [PATCH v2] client: Add session contextIdentifier config
support
Message-ID: <[email protected]>
From: Bjoern Thorwirth <[email protected]>
Added contextIdentifier field in session config.
This allows processes to select a service context dependent
behaviour for which the routing decision is made.
diff --git a/client/commands.c b/client/commands.c
index 583095b..56e098b 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -901,6 +901,13 @@ struct config_append {
int values;
};
+struct session_options {
+ char **args;
+ int num;
+ char *notify_path;
+ struct connman_option *options;
+};
+
static void config_append_ipv4(DBusMessageIter *iter,
void *user_data)
{
@@ -1796,28 +1803,141 @@ static int session_create_cb(DBusMessageIter *iter,
const char *error,
return -EINPROGRESS;
}
+static void session_config_append_array(DBusMessageIter *iter,
+ void *user_data)
+{
+ struct config_append *append = user_data;
+ char **opts = append->opts;
+ int i = 1;
+
+ if (!opts)
+ return;
+
+ while (opts[i] && strncmp(opts[i], "--", 2) != 0) {
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
+ &opts[i]);
+ i++;
+ }
+
+ append->values = i;
+}
+
+static void session_create_append_dict(DBusMessageIter *iter, void *user_data)
+{
+ struct session_options *args_struct = user_data;
+ int index = 0, res = 0;
+ struct config_append append;
+ char c;
+ char *ifname;
+ dbus_bool_t source_ip_rule;
+
+ while (index < args_struct->num && args_struct->args[index]) {
+ append.opts = &args_struct->args[index];
+ append.values = 0;
+
+ c = parse_args(args_struct->args[index], args_struct->options);
+
+ switch (c) {
+ case 'b':
+ __connmanctl_dbus_append_dict_string_array(iter,
"AllowedBearers",
+
session_config_append_array,
+ &append);
+ break;
+ case 't':
+ if (! args_struct->args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ __connmanctl_dbus_append_dict_entry(iter,
"ConnectionType",
+ DBUS_TYPE_STRING,
+
&args_struct->args[index + 1]);
+ append.values = 2;
+ break;
+ case 'i':
+ if (index + 1 < args_struct->num)
+ ifname = args_struct->args[index + 1];
+ else
+ ifname = "";
+ __connmanctl_dbus_append_dict_entry(iter,
"AllowedInterface",
+ DBUS_TYPE_STRING,
+ &ifname);
+ append.values = 2;
+ break;
+ case 's':
+ if (! args_struct->args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ switch (parse_boolean( args_struct->args[index + 1])) {
+ case 1:
+ source_ip_rule = TRUE;
+ break;
+ case 0:
+ source_ip_rule = FALSE;
+ break;
+ default:
+ res = -EINVAL;
+ break;
+ }
+ __connmanctl_dbus_append_dict_entry(iter,
"SourceIPRule",
+ DBUS_TYPE_BOOLEAN,
+ &source_ip_rule);
+ append.values = 2;
+ break;
+ case 'c':
+ if (!args_struct->args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ __connmanctl_dbus_append_dict_entry(iter,
"ContextIdentifier",
+
DBUS_TYPE_STRING,
+
&args_struct->args[index + 1]);
+ append.values = 2;
+ break;
+ default:
+ res = -EINVAL;
+ }
+
+ if (res < 0 && res != -EINPROGRESS) {
+ printf("Error '%s': %s\n", args_struct->args[index],
+ strerror(-res));
+ return;
+ }
+
+ index += append.values;
+ }
+
+ return;
+}
static void session_create_append(DBusMessageIter *iter, void *user_data)
{
- const char *notify_path = user_data;
+ struct session_options *args_struct = user_data;
- __connmanctl_dbus_append_dict(iter, NULL, NULL);
+ __connmanctl_dbus_append_dict(iter, session_create_append_dict,
+ args_struct);
dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH,
- ¬ify_path);
+ &args_struct->notify_path);
}
-static int session_create(gboolean connect)
+static int session_create(gboolean connect, char *args[], int num,
+ struct connman_option *options)
{
int res;
char *notify_path;
+ struct session_options args_struct;
+ args_struct.args = args;
+ args_struct.num = num;
+ args_struct.options = options;
notify_path = g_strdup_printf("/net/connman/connmanctl%d", getpid());
session_notify_add(notify_path);
+ args_struct.notify_path = notify_path;
res = __connmanctl_dbus_method_call(connection, "net.connman", "/",
"net.connman.Manager", "CreateSession",
session_create_cb, GINT_TO_POINTER(connect),
- session_create_append, notify_path);
+ session_create_append, &args_struct);
g_free(notify_path);
@@ -1871,25 +1991,6 @@ static int session_config_return(DBusMessageIter *iter,
const char *error,
return 0;
}
-static void session_config_append_array(DBusMessageIter *iter,
- void *user_data)
-{
- struct config_append *append = user_data;
- char **opts = append->opts;
- int i = 1;
-
- if (!opts)
- return;
-
- while (opts[i] && strncmp(opts[i], "--", 2) != 0) {
- dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
- &opts[i]);
- i++;
- }
-
- append->values = i;
-}
-
static int session_config(char *args[], int num,
struct connman_option *options)
{
@@ -1959,7 +2060,18 @@ static int session_config(char *args[], int num,
DBUS_TYPE_BOOLEAN, &source_ip_rule);
append.values = 2;
break;
+ case 'c':
+ if (!args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ res =
__connmanctl_dbus_session_change(connection,
+ session_path,
session_config_return,
+ "ContextIdentifier",
"ContextIdentifier",
+ DBUS_TYPE_STRING, &args[index +
1]);
+ append.values = 2;
+ break;
default:
res = -EINVAL;
}
@@ -1994,12 +2106,13 @@ static int cmd_session(char *args[], int num, struct
connman_option *options)
case 1:
if (session_path)
return -EALREADY;
- return session_create(FALSE);
+ return session_create(FALSE, &args[2], num - 2, options);
default:
if (!strcmp(command, "connect")) {
if (!session_path)
- return session_create(TRUE);
+ return session_create(TRUE, &args[2], num - 2,
+ options);
return session_connect();
@@ -2248,6 +2361,7 @@ static struct connman_option session_options[] = {
{"type", 't', "local|internet|any"},
{"ifname", 'i', "[<interface_name>]"},
{"srciprule", 's', "yes|no"},
+ {"contextIdentifier", 'c', "Context identifier"},
{ NULL, }
};
--
2.7.4
------------------------------
Message: 2
Date: Mon, 9 Oct 2017 14:52:22 +0200
From: [email protected]
To: [email protected]
Cc: Jose Blanquicet <[email protected]>
Subject: [PATCH] wifi: Stop autoscanning once tethering has started
Message-ID:
<1507553542-26730-1-git-send-email-jose.blanqui...@magnetimarelli.com>
From: Jose Blanquicet <[email protected]>
---
plugins/wifi.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 34c16dfd4486..74f216d2d6ca 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2370,17 +2370,20 @@ static void interface_state(GSupplicantInterface
*interface)
if (!wifi)
return;
+ device = wifi->device;
+ if (!device)
+ return;
+
if (state == G_SUPPLICANT_STATE_COMPLETED) {
if (wifi->tethering_param) {
g_free(wifi->tethering_param->ssid);
g_free(wifi->tethering_param);
wifi->tethering_param = NULL;
}
- }
- device = wifi->device;
- if (!device)
- return;
+ if (wifi->tethering)
+ stop_autoscan(device);
+ }
if (g_supplicant_interface_get_ready(interface) &&
!wifi->interface_ready) {
--
1.9.1
------------------------------
Message: 3
Date: Mon, 9 Oct 2017 17:39:25 +0000
From: "Puustinen, Ismo" <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: RE: [PATCH v2] dns: Use hash table instead of binary tree
Message-ID:
<ccdeb7c6a88959479c736e89d8e0adc78ee21...@irsmsx107.ger.corp.intel.com>
Content-Type: text/plain; charset="us-ascii"
> here is an updated version. It looks like I am bit rusty on my glib foo :)
>
> changes since v1:
> - fixed the signature and implemenetation of compare_index()
> - test return value of setup_resolved correctly
This looks good to me now. Thanks!
Ismo
------------------------------
Message: 4
Date: Mon, 09 Oct 2017 20:34:15 +0200
From: Daniel Wagner <[email protected]>
To: "Puustinen\, Ismo" <[email protected]>
Cc: "connman\@lists.01.org" <[email protected]>
Subject: Re: [PATCH v2] dns: Use hash table instead of binary tree
Message-ID: <[email protected]>
Content-Type: text/plain
Hi Ismo,
"Puustinen, Ismo" <[email protected]> writes:
>> here is an updated version. It looks like I am bit rusty on my glib foo :)
>>
>> changes since v1:
>> - fixed the signature and implemenetation of compare_index()
>> - test return value of setup_resolved correctly
>
> This looks good to me now. Thanks!
Great. I have applied the patch.
Thanks,
Daniel
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 24, Issue 13
***************************************