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 0/6] Frequency list for services (Adam Moore)
2. [PATCH 1/6] dbus: add uint16 array property support (Adam Moore)
3. [PATCH 2/6] gsupplicant: frequency list getter for networks
(Adam Moore)
4. [PATCH 3/6] network: add getter and setter for frequencies
(Adam Moore)
5. [PATCH 4/6] wifi: gather and remember frequency data when a
network is added (Adam Moore)
6. [PATCH 5/6] service: Add Frequencies property (Adam Moore)
7. [PATCH 6/6] doc: add service documentation for Frequencies
property (Adam Moore)
8. RE: [RFC] vpn: Restrict connman-vpnd capabilities (Andrew Bibb)
----------------------------------------------------------------------
Message: 1
Date: Fri, 19 Feb 2016 13:47:51 -0800
From: Adam Moore <[email protected]>
To: <[email protected]>
Subject: [PATCH 0/6] Frequency list for services
Message-ID:
<[email protected]>
Content-Type: text/plain
Here are some patches I've needed to learn about the frequencies
on which a service is present. This could be useful to others for
use cases such as network survey or more advanced service selection
logic that considers availability on specific frequencies or bands.
I realize that perhaps Frequencies may be considered TMI
for a service abstraction, but I noticed there is a precedent
for wireless specific properties already (e.g., Strength)
Adam Moore (6):
dbus: add uint16 array property support
gsupplicant: frequency list getter for networks
network: add getter and setter for frequencies
wifi: gather and remember frequency data when a network is added
service: Add Frequencies property
doc: add service documentation for Frequencies property
doc/service-api.txt | 11 +++++++++++
gsupplicant/gsupplicant.h | 1 +
gsupplicant/supplicant.c | 36 ++++++++++++++++++++++++++++++++++++
include/network.h | 4 ++++
plugins/wifi.c | 3 +++
src/dbus.c | 5 +++++
src/network.c | 24 ++++++++++++++++++++++++
src/service.c | 15 +++++++++++++++
8 files changed, 99 insertions(+)
--
2.5.0
Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and
are intended solely for the addressee. The information may also be legally
privileged. This transmission is sent in trust, and the sole purpose of
delivery to the intended recipient. If you have received this transmission in
error, any use, reproduction or dissemination of this transmission is strictly
prohibited. If you are not the intended recipient, please immediately notify
the sender by reply e-mail or at 508.683.2500 and delete this message and its
attachments, if any.
------------------------------
Message: 2
Date: Fri, 19 Feb 2016 13:47:52 -0800
From: Adam Moore <[email protected]>
To: <[email protected]>
Subject: [PATCH 1/6] dbus: add uint16 array property support
Message-ID:
<[email protected]>
Content-Type: text/plain
Adds support for uint16 arrays in connman_dbus_property_append_array
---
src/dbus.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/dbus.c b/src/dbus.c
index d80a46c..8fe36e5 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -209,6 +209,11 @@ void connman_dbus_property_append_array(DBusMessageIter
*iter,
DBUS_DICT_ENTRY_END_CHAR_AS_STRING
DBUS_STRUCT_END_CHAR_AS_STRING;
break;
+ case DBUS_TYPE_UINT16:
+ variant_sig = DBUS_TYPE_ARRAY_AS_STRING
+ DBUS_TYPE_UINT16_AS_STRING;
+ array_sig = DBUS_TYPE_UINT16_AS_STRING;
+ break;
default:
return;
}
--
2.5.0
Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and
are intended solely for the addressee. The information may also be legally
privileged. This transmission is sent in trust, and the sole purpose of
delivery to the intended recipient. If you have received this transmission in
error, any use, reproduction or dissemination of this transmission is strictly
prohibited. If you are not the intended recipient, please immediately notify
the sender by reply e-mail or at 508.683.2500 and delete this message and its
attachments, if any.
------------------------------
Message: 3
Date: Fri, 19 Feb 2016 13:47:53 -0800
From: Adam Moore <[email protected]>
To: <[email protected]>
Subject: [PATCH 2/6] gsupplicant: frequency list getter for networks
Message-ID:
<[email protected]>
Content-Type: text/plain
Add a helper function to return a list of frequencies for a given
GSupplicantNetwork.
Gathering frequencies for each BSS in a network would be useful
for network survey or selection logic.
---
gsupplicant/gsupplicant.h | 1 +
gsupplicant/supplicant.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index a2a7605..76c96d8 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -313,6 +313,7 @@ const char
*g_supplicant_network_get_mode(GSupplicantNetwork *network);
const char *g_supplicant_network_get_security(GSupplicantNetwork *network);
dbus_int16_t g_supplicant_network_get_signal(GSupplicantNetwork *network);
dbus_uint16_t g_supplicant_network_get_frequency(GSupplicantNetwork *network);
+GList *g_supplicant_network_get_frequencies(GSupplicantNetwork *network);
dbus_bool_t g_supplicant_network_get_wps(GSupplicantNetwork *network);
dbus_bool_t g_supplicant_network_is_wps_active(GSupplicantNetwork *network);
dbus_bool_t g_supplicant_network_is_wps_pbc(GSupplicantNetwork *network);
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 342cb01..0dc6c6e 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1057,6 +1057,42 @@ dbus_uint16_t
g_supplicant_network_get_frequency(GSupplicantNetwork *network)
return network->frequency;
}
+GList *g_supplicant_network_get_frequencies(GSupplicantNetwork *network)
+{
+ GList *bss_list = NULL;
+ GList *frequencies = NULL;
+ GList *current = NULL;
+ struct g_supplicant_bss *current_bss = NULL;
+
+ if (!network)
+ return NULL;
+
+ if (!network->bss_table)
+ return NULL;
+
+ bss_list = g_hash_table_get_values(network->bss_table);
+
+ if (!bss_list)
+ return NULL;
+
+ for (current = bss_list; current != NULL; current = current->next) {
+ if (!current->data) {
+ continue;
+ }
+
+ current_bss = (struct g_supplicant_bss*)current->data;
+ if (g_list_find(frequencies,
GUINT_TO_POINTER(current_bss->frequency))) {
+ continue;
+ }
+
+ frequencies = g_list_append(frequencies,
GUINT_TO_POINTER(current_bss->frequency));
+ }
+
+ g_list_free(bss_list);
+
+ return frequencies;
+}
+
dbus_bool_t g_supplicant_network_get_wps(GSupplicantNetwork *network)
{
if (!network)
--
2.5.0
Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and
are intended solely for the addressee. The information may also be legally
privileged. This transmission is sent in trust, and the sole purpose of
delivery to the intended recipient. If you have received this transmission in
error, any use, reproduction or dissemination of this transmission is strictly
prohibited. If you are not the intended recipient, please immediately notify
the sender by reply e-mail or at 508.683.2500 and delete this message and its
attachments, if any.
------------------------------
Message: 4
Date: Fri, 19 Feb 2016 13:47:54 -0800
From: Adam Moore <[email protected]>
To: <[email protected]>
Subject: [PATCH 3/6] network: add getter and setter for frequencies
Message-ID:
<[email protected]>
Content-Type: text/plain
Allows for storage/exposure the set of all frequencies on which a network is
present
---
include/network.h | 4 ++++
src/network.c | 24 ++++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/include/network.h b/include/network.h
index d772699..5b98479 100644
--- a/include/network.h
+++ b/include/network.h
@@ -25,6 +25,7 @@
#include <stdbool.h>
#include <stdint.h>
+#include <glib.h>
#include <connman/device.h>
#include <connman/ipconfig.h>
@@ -124,6 +125,9 @@ uint8_t connman_network_get_strength(struct connman_network
*network);
int connman_network_set_frequency(struct connman_network *network,
uint16_t frequency);
uint16_t connman_network_get_frequency(struct connman_network *network);
+int connman_network_set_frequencies(struct connman_network *network,
+ GList *frequencies);
+GList *connman_network_get_frequencies(struct connman_network *network);
int connman_network_set_wifi_channel(struct connman_network *network,
uint16_t channel);
uint16_t connman_network_get_wifi_channel(struct connman_network *network);
diff --git a/src/network.c b/src/network.c
index db3d2f3..82d7cd6 100644
--- a/src/network.c
+++ b/src/network.c
@@ -52,6 +52,7 @@ struct connman_network {
bool roaming;
uint8_t strength;
uint16_t frequency;
+ GList *frequencies;
char *identifier;
char *name;
char *node;
@@ -892,6 +893,11 @@ static void network_destruct(struct connman_network
*network)
g_free(network->name);
g_free(network->identifier);
+ if (network->frequencies) {
+ g_list_free(network->frequencies);
+ network->frequencies = NULL;
+ }
+
network->device = NULL;
g_free(network);
@@ -1727,11 +1733,29 @@ int connman_network_set_frequency(struct
connman_network *network,
return 0;
}
+int connman_network_set_frequencies(struct connman_network *network,
+ GList *frequencies)
+{
+ if (network->frequencies) {
+ g_list_free(network->frequencies);
+ network->frequencies = NULL;
+ }
+
+ network->frequencies = frequencies;
+
+ return 0;
+}
+
uint16_t connman_network_get_frequency(struct connman_network *network)
{
return network->frequency;
}
+GList *connman_network_get_frequencies(struct connman_network *network)
+{
+ return network->frequencies;
+}
+
int connman_network_set_wifi_channel(struct connman_network *network,
uint16_t channel)
{
--
2.5.0
Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and
are intended solely for the addressee. The information may also be legally
privileged. This transmission is sent in trust, and the sole purpose of
delivery to the intended recipient. If you have received this transmission in
error, any use, reproduction or dissemination of this transmission is strictly
prohibited. If you are not the intended recipient, please immediately notify
the sender by reply e-mail or at 508.683.2500 and delete this message and its
attachments, if any.
------------------------------
Message: 5
Date: Fri, 19 Feb 2016 13:47:55 -0800
From: Adam Moore <[email protected]>
To: <[email protected]>
Subject: [PATCH 4/6] wifi: gather and remember frequency data when a
network is added
Message-ID:
<[email protected]>
Content-Type: text/plain
Allows for monitoring all frequencies on which a network resides
---
plugins/wifi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index bb1cabc..bad63b7 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2680,6 +2680,9 @@ static void network_added(GSupplicantNetwork
*supplicant_network)
connman_network_set_frequency(network,
g_supplicant_network_get_frequency(supplicant_network));
+ connman_network_set_frequencies(network,
+
g_supplicant_network_get_frequencies(supplicant_network));
+
connman_network_set_available(network, true);
connman_network_set_string(network, "WiFi.Mode", mode);
--
2.5.0
Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and
are intended solely for the addressee. The information may also be legally
privileged. This transmission is sent in trust, and the sole purpose of
delivery to the intended recipient. If you have received this transmission in
error, any use, reproduction or dissemination of this transmission is strictly
prohibited. If you are not the intended recipient, please immediately notify
the sender by reply e-mail or at 508.683.2500 and delete this message and its
attachments, if any.
------------------------------
Message: 6
Date: Fri, 19 Feb 2016 13:47:56 -0800
From: Adam Moore <[email protected]>
To: <[email protected]>
Subject: [PATCH 5/6] service: Add Frequencies property
Message-ID:
<[email protected]>
Content-Type: text/plain
Add a property which contains the list of all frequencies on which
a service's network resides.
This data would be useful for network survey or network selection
logic.
A caveat of this implementation is that a hidden network service's
Frequencies property will contain the union of frequencies for
all hidden networks with the same security type, which can be
resolved by performing an active scan of the hidden network.
---
src/service.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/service.c b/src/service.c
index 8e07337..8d701c0 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1503,6 +1503,18 @@ static void strength_changed(struct connman_service
*service)
DBUS_TYPE_BYTE, &service->strength);
}
+static void append_frequencies(DBusMessageIter *iter, void *user_data)
+{
+ struct connman_service *service = user_data;
+ GList *list = connman_network_get_frequencies(service->network);
+
+ while (list) {
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16,
+ &list->data);
+ list = g_list_next(list);
+ }
+}
+
static void favorite_changed(struct connman_service *service)
{
dbus_bool_t favorite;
@@ -2305,6 +2317,9 @@ static void append_properties(DBusMessageIter *dict,
dbus_bool_t limited,
connman_dbus_dict_append_basic(dict, "Strength",
DBUS_TYPE_BYTE, &service->strength);
+ connman_dbus_dict_append_array(dict, "Frequencies",
+ DBUS_TYPE_UINT16, append_frequencies, service);
+
val = service->favorite;
connman_dbus_dict_append_basic(dict, "Favorite",
DBUS_TYPE_BOOLEAN, &val);
--
2.5.0
Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and
are intended solely for the addressee. The information may also be legally
privileged. This transmission is sent in trust, and the sole purpose of
delivery to the intended recipient. If you have received this transmission in
error, any use, reproduction or dissemination of this transmission is strictly
prohibited. If you are not the intended recipient, please immediately notify
the sender by reply e-mail or at 508.683.2500 and delete this message and its
attachments, if any.
------------------------------
Message: 7
Date: Fri, 19 Feb 2016 13:47:57 -0800
From: Adam Moore <[email protected]>
To: <[email protected]>
Subject: [PATCH 6/6] doc: add service documentation for Frequencies
property
Message-ID:
<[email protected]>
Content-Type: text/plain
---
doc/service-api.txt | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/doc/service-api.txt b/doc/service-api.txt
index e2e9e84..09cad87 100644
--- a/doc/service-api.txt
+++ b/doc/service-api.txt
@@ -200,6 +200,17 @@ Properties string State [readonly]
This property will not be present for Ethernet
devices.
+ array{uint16} Frequencies [readonly]
+
+ Contains a list of frequencies on which the
+ service is present.
+
+ For a hidden network service, this property will
+ contain the union of frequencies for all hidden
+ network services in range with the same security
+ type, which can be disambiguated by performing
+ an active scan of the network.
+
boolean Favorite [readonly]
Will be true if a cable is plugged in or the user
--
2.5.0
Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and
are intended solely for the addressee. The information may also be legally
privileged. This transmission is sent in trust, and the sole purpose of
delivery to the intended recipient. If you have received this transmission in
error, any use, reproduction or dissemination of this transmission is strictly
prohibited. If you are not the intended recipient, please immediately notify
the sender by reply e-mail or at 508.683.2500 and delete this message and its
attachments, if any.
------------------------------
Message: 8
Date: Fri, 19 Feb 2016 19:08:37 -0500
From: Andrew Bibb <[email protected]>
To: Patrik Flykt <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: RE: [RFC] vpn: Restrict connman-vpnd capabilities
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
> Subject: Re: [RFC] vpn: Restrict connman-vpnd capabilities
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Date: Fri, 19 Feb 2016 11:29:22 +0200
>
>
> Hi,
>
> The below reply got stuck somewhere, I thought it had already been sent
> to the mailing list...
>
> On Wed, 2016-02-10 at 19:30 -0500, Andrew Bibb wrote:
>
> > Lastly I decided to play around with the CapabiliyBoundingSet a bit
> > based on your suggestion. Adding CAP_DAC_READ_SEARCH to the "as
> > shipped" list will allow OpenVPN to connect. I never even knew these
> > existed until this evening, and I only picked that one based on
> > reading the manpage, so the probability of it being the proper one is
> > likely not great. Using CAP_DAC_OVERRIDE also works, but that
> > bypasses write permissions and seems to be overkill.
>
> man paget says about CAP_DAC_READ_SEARCH that it:
> * Bypass file read permission checks and directory read and execute
> permission checks;
> * Invoke open_by_handle_at(2).
>
> Could it be that openvpn does not have read permissions to the config
> file and/or path written to by ConnMan?
>
> Cheers,
>
> Patrik
>
>
>
Patrik,
You nailed it, permissions on my personal home directory were 700, so OpenVPN
could never get into ~/.local/share. Change that one to 711 and Connman with
OpenVPN will connect fine (using the default "as shipped"
/usr/lib/systemd/system/connman-vpn.service file).
Thank you for all your help.
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20160219/647a4139/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 4, Issue 24
**************************************