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: When BackgroundScanning = false, connman's Scan() dbus
method is broken (Jose Blanquicet)
2. [PATCH v4 1/5] session: Add parameter Service into
CreateSession call of ConnMan session API ([email protected])
3. [PATCH 1/1] client: Add session Service config support
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 17 Aug 2017 08:37:50 +0200
From: Jose Blanquicet <[email protected]>
To: Jonah Petri <[email protected]>, Daniel Wagner <[email protected]>,
Sam Nazarko <[email protected]>
Cc: [email protected]
Subject: Re: When BackgroundScanning = false, connman's Scan() dbus
method is broken
Message-ID:
<CAFC8iJ+aDv48rhHaS38E2nzn3kSXWA295wr+DBN1stT1m=w...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Good morning,
Sorry the delay, I was out of office.
On Fri, Aug 11, 2017 at 4:24 PM, Jonah Petri <[email protected]> wrote:
> On Aug 11, 2017, at 2:43 AM, Jose Blanquicet <[email protected]> wrote:
> ]So, according to the your dbus logs, there should not exist any AP using
> 2437 in your range, is it true? Try to do what I did and modify the
settings
> file of your "known-service" to a frequency you are sure there are APs in
> your range. Doing so you should be able see them now. Remember to kill
> ConnMan before modifying that settings file then re-launch ConnMan or just
> reboot your system to get the changes applied.
>
>
> There are 6 other networks using 2437 in range. I am in a downtown area
> with LOTS of APs. So that's not it.
I cannot reproduce exactly what you are suffering and unfortunately I am
not sure what precisely is the correct driver's behaviour. What your driver
replies is different than what I am seeing here. I recreated the scenario
you described with the following results:
* "MaxScanSSID" = 4, reported from wpa_supplicant
* "BackgroundScanning = false" in main.conf
* Connect to a WiFi Network
* Turn off AP
* Reboot device
When system is up again, after doing "connmanctl scan wifi":
method call sender=:1.67 -> dest=net.connman serial=9
path=/net/connman/technology/wifi; interface=net.connman.Technology;
member=Scan
method call sender=:1.65 -> dest=fi.w1.wpa_supplicant1 serial=62
path=/fi/w1/wpa_supplicant1/Interfaces/11;
interface=fi.w1.wpa_supplicant1.Interface; member=Scan
array [
dict entry(
string "Type"
variant string "active"
)
dict entry(
string "SSIDs"
variant array [
array of bytes "Testing-AP"
array of bytes "Colombian-AP"
...
]
)
dict entry(
string "Channels"
variant array [
struct {
uint32 2437
uint32 0
}
struct {
uint32 2462
uint32 0
}
]
)
]
Next, I can see the signals "PropertiesChanged" with (Scanning -> true),
some "BSSAdded" and then the "ScanDone". After that I see:
method call sender=:1.65 -> dest=fi.w1.wpa_supplicant1 serial=67
path=/fi/w1/wpa_supplicant1/Interfaces/11;
interface=org.freedesktop.DBus.Properties; member=Get
string "fi.w1.wpa_supplicant1.Interface"
string "BSSs"
method return sender=:1.44 -> dest=:1.65 reply_serial=67
variant array [
object path "/fi/w1/wpa_supplicant1/Interfaces/11/BSSs/0"
object path "/fi/w1/wpa_supplicant1/Interfaces/11/BSSs/1"
object path "/fi/w1/wpa_supplicant1/Interfaces/11/BSSs/2"
object path "/fi/w1/wpa_supplicant1/Interfaces/11/BSSs/3"
]
Where all those BSSs use only frequencies 2437 or 2462. That's what I asked
you if there were not more APs in range using 2437, according to your dbus
logs.
In any case, we need to be prepared for all driver's behaviour. So, let's
try to solve this.
>> My 2?: If "Active" scanning will indeed only return results for the SSIDs
>> mentioned in the scan parameters, then I think ConnMan should *always*
>> schedule a passive scan afterwards, perhaps by just calling
>> wifi_scan_simple() in the scan_callback() of an active scan.
>>
>> Thoughts?
>
> That sounds reasonable. You should just take into account the timing, you
> cannot immediately ask wpa_supplicant for another scan because it could
just
> be discarded due to there is another ongoing. That second passive scan
needs
> to be done once you are sure the active scan has finished. You could try
to
> implement this, I will think if this is the best we can do. Then we can
test
> and discuss the options.
I was thinking and maybe this is not the best way to solve this issue.
The active scan is useful in order to perform a fast scan looking for the
WiFi networks we have got connected in the past. I think this is
particularly helpful to speed up auto-connect procedure at the start-up of
the system. Instead, when user asks for scanning I think it should always
be a passive scan because users want to see all WiFi networks available in
range. Therefore, I propose to make ConnMan ask wpa_supplicant for an
active scan only at star-up of the system and passive scan when it is
directly asked from users through a Technology.Scan() D-Bus call. Both
things no matter BackgroundScanning's value.
What do all you think?
Regards,
Jose Blanquicet
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20170817/e64cd15b/attachment-0001.html>
------------------------------
Message: 2
Date: Thu, 17 Aug 2017 14:59:06 +0530
From: [email protected]
To: [email protected]
Cc: [email protected], Bjoern Thorwirth
<[email protected]>
Subject: [PATCH v4 1/5] session: Add parameter Service into
CreateSession call of ConnMan session API
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.
---
doc/session-api.txt | 12 ++++++++++++
include/session.h | 1 +
src/session.c | 17 +++++++++++++++++
3 files changed, 30 insertions(+)
diff --git a/doc/session-api.txt b/doc/session-api.txt
index e8da522..139bcca 100644
--- a/doc/session-api.txt
+++ b/doc/session-api.txt
@@ -205,3 +205,15 @@ 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 [readwrite]
+
+ This designates context of service for a Session.
+ 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 field is used to implement service context
+ dependent behavior.
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 9e3c559..a62f93e 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
------------------------------
Message: 3
Date: Thu, 17 Aug 2017 14:59:35 +0530
From: [email protected]
To: [email protected]
Cc: [email protected], Bjoern Thorwirth
<[email protected]>
Subject: [PATCH 1/1] client: Add session Service config support
Message-ID:
<[email protected]>
From: Bjoern Thorwirth <[email protected]>
Added Service 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..6c3e1f8 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 'S':
+ if (!args_struct->args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ __connmanctl_dbus_append_dict_entry(iter,
"Service",
+
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 'S':
+ if (!args[index + 1]) {
+ res = -EINVAL;
+ break;
+ }
+ res =
__connmanctl_dbus_session_change(connection,
+ session_path,
session_config_return,
+ "Service", "Service",
+ 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"},
+ {"service", 'S', "service identifier"},
{ NULL, }
};
--
2.7.4
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 22, Issue 13
***************************************