Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe 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: [PATCH 2/2] ofono: store context apn value (Daniel Wagner)
2. Re: Turn off connman-vpn (Daniel Wagner)
3. Re: Connman apparently not working on my embedded target
(Daniel Wagner)
4. Re: Connman apparently not working on my embedded target
(Mauro Condarelli)
5. Re: Connman apparently not working on my embedded target
(Daniel Wagner)
6. Re: [PATCH 2/2] ofono: store context apn value (nick83ola)
----------------------------------------------------------------------
Date: Wed, 4 Mar 2020 09:02:03 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: [PATCH 2/2] ofono: store context apn value
To: Nicola Lunghi <[email protected]>
Cc: connman <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Hi Nicola,
Please add a commit message explaining why you are changing this.
On Tue, Mar 03, 2020 at 06:27:37PM +0000, Nicola Lunghi wrote:
> Signed-off-by: Nicola Lunghi <[email protected]>
We don't do SoB.
A few nitpicks.
> ---
> plugins/ofono.c | 60 ++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 40 insertions(+), 20 deletions(-)
>
> diff --git a/plugins/ofono.c b/plugins/ofono.c
> index bb08cfd..e6e8827 100644
> --- a/plugins/ofono.c
> +++ b/plugins/ofono.c
> @@ -133,6 +133,8 @@ static GHashTable *context_hash;
> struct network_context {
> char *path;
> char *name;
> + char *apn;
> +
> int index;
> struct connman_network *network;
>
> @@ -147,7 +149,6 @@ struct network_context {
> int refcount;
>
> bool active;
> - bool valid_apn; /* APN is 'valid' if length > 0 */
> };
>
> struct modem_data {
> @@ -295,6 +296,7 @@ static void network_context_unref(struct network_context
> *context)
>
> g_free(context->path);
> g_free(context->name);
> + g_free(context->apn);
>
> connman_ipaddress_free(context->ipv4_address);
> g_free(context->ipv4_nameservers);
> @@ -1174,6 +1176,29 @@ static int set_context_name(struct network_context
> *context,
> return 0;
> }
>
> +static context_apn_is_valid(struct network_context *context)
> +{
> + return ((context!=NULL) &&
> + (context->apn != NULL) &&
> + (strlen(context->apn) > 0));
return context && context->apn && strlen(context->apn);
> +}
> +
> +static int set_context_apn(struct network_context *context, const char
> *apn_name)
> +{
> + if (!context || !apn_name)
> + return -EINVAL;
> +
> + g_free(context->apn);
> + context->apn = g_strdup(apn_name);
> +
> + if(!context->apn)
> + return -ENOMEM;
No need for testing here. g_strdup() will call abort() if the
allocation fails.
> +
> + DBG("%s Set context apn to %s", context->path, context->name);
> +
> + return 0;
> +}
> +
> static int set_context_ipconfig(struct network_context *context,
> const char *protocol)
> {
> @@ -1222,6 +1247,7 @@ static int add_cm_context(struct modem_data *modem,
> const char *context_path,
> dbus_bool_t active = FALSE;
> const char *ip_protocol = NULL;
> const char *ctx_name = NULL;
> + const char *apn_name = NULL;
>
> DBG("%s context path %s", modem->path, context_path);
>
> @@ -1262,16 +1288,10 @@ static int add_cm_context(struct modem_data *modem,
> const char *context_path,
> dbus_message_iter_get_basic(&value, &active);
>
> DBG("%s Active %d", modem->path, active);
> - } else if (g_str_equal(key, "AccessPointName")) {
> - const char *apn;
> -
> - dbus_message_iter_get_basic(&value, &apn);
> - if (apn && strlen(apn) > 0)
> - context->valid_apn = true;
> - else
> - context->valid_apn = false;
> -
> - DBG("%s AccessPointName '%s'", modem->path, apn);
> + } else if (g_str_equal(key, "AccessPointName") &&
> + dbus_message_iter_get_arg_type(&value) ==
> DBUS_TYPE_STRING ) {
Hmm, yeah the 80 chararter limit is making it sometimes hard. Maybe
adding an emtpy line here. Makes it easier to understand where the
body starts. Not completely conistent but I thknk still the better option
> + dbus_message_iter_get_basic(&value, &apn_name);
And here an empty line. The rest of the code does this.
> + DBG("%s AccessPointName '%s'", modem->path, apn_name);
> } else if (g_str_equal(key, "Protocol") &&
> dbus_message_iter_get_arg_type(&value) ==
> DBUS_TYPE_STRING ) {
>
> @@ -1291,6 +1311,9 @@ static int add_cm_context(struct modem_data *modem,
> const char *context_path,
> if (ctx_name)
> set_context_name(context, ctx_name);
>
> + if (apn_name)
> + set_context_apn(context, apn_name);
> +
> if (ip_protocol)
> set_context_ipconfig(context, ip_protocol);
>
> @@ -1299,7 +1322,7 @@ static int add_cm_context(struct modem_data *modem,
> const char *context_path,
> modem->context_list = g_slist_prepend(modem->context_list, context);
> g_hash_table_replace(context_hash, g_strdup(context_path), modem);
>
> - if (context->valid_apn && modem->attached &&
> + if (context_apn_is_valid(context) && modem->attached &&
> has_interface(modem->interfaces, OFONO_API_NETREG))
> add_network(modem, context);
>
> @@ -1410,15 +1433,14 @@ static gboolean context_changed(DBusConnection *conn,
> else
> set_disconnected(context);
> } else if (g_str_equal(key, "AccessPointName")) {
> - const char *apn;
> + const char *apn = NULL;
Is this one needed?
>
> dbus_message_iter_get_basic(&value, &apn);
>
> - DBG("%s AccessPointName %s", modem->path, apn);
> -
> - if (apn && strlen(apn) > 0) {
> - context->valid_apn = true;
> + set_context_apn(context, apn);
>
> + if (context_apn_is_valid(context)) {
> + DBG("%s AccessPointName %s", modem->path, context->apn);
> if (context->network)
> return TRUE;
>
> @@ -1434,8 +1456,6 @@ static gboolean context_changed(DBusConnection *conn,
> if (context->active)
> set_connected(modem, context);
> } else {
> - context->valid_apn = false;
> -
> if (!context->network)
> return TRUE;
>
> @@ -1804,7 +1824,7 @@ static void netreg_properties_reply(struct modem_data
> *modem,
> for (list = modem->context_list; list; list = list->next) {
> struct network_context *context = list->data;
>
> - if (context->valid_apn)
> + if (context_apn_is_valid(context))
> add_network(modem, context);
> if (context->active)
> set_connected(modem, context);
Thanks,
Daniel
------------------------------
Date: Wed, 4 Mar 2020 09:09:25 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: Turn off connman-vpn
To: KeithG <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Hi Gearhead,
On Tue, Mar 03, 2020 at 01:40:25PM -0600, KeithG wrote:
> Is there a way to turn this off? I am trying to convert form
> netctl/ifplug/wpa_supplicant to connman/iwd and notice that connman-vpn is
> always running.
connman-vpnd is not started by connmand. systemd or some startup
scripts start connman-vpnd.
> This is for an audio appliance, so vpn is not needed. Is
> there a configuration setting to turn this off short of compiling from
> scratch? I have tried to mask the service but then I get errors when I try
> to run connmanctl.
You don't need connman-vpnd to run. connmanctl seems not be able to
deal with the situation when connman-vpnd is not running though. This
is a bug in connmanctl.
> Also, I have to run the connman connect wifi_... to connect to my wifi AP
> at boot. Is this normal. It has an ethernet cable connected and gets an IP
> from there. I do not have it set to use only one interface but to get it to
> connect, I have to run a script at startup to get it to connect to both
> interfaces.
The default behavior of ConnMan is to connect only one interface. You
can tweak the behavior with the global config, e.g
DefaultAutoConnectTechnologies
DefaultFavoriteTechnologies
AlwaysConnectedTechnologies
PreferredTechnologies
See man connman.config for more details on it.
Thanks,
Daniel
------------------------------
Date: Wed, 4 Mar 2020 09:22:08 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: Connman apparently not working on my embedded target
To: Mauro Condarelli <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
Hi Mauro,
On Tue, Mar 03, 2020 at 09:51:02PM +0100, Mauro Condarelli wrote:
> # dhcpcd -f /etc/dhcpcd.conf
[...]
> eth0: rebinding lease of 192.168.7.125
Here dhcp says it's able to configure eth0
> # ip a
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop qlen 1000
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> qlen 1000
> link/ether 36:6f:f7:d1:b4:35 brd ff:ff:ff:ff:ff:ff
> inet 169.254.83.182/16 brd 169.254.255.255 scope global eth0
> valid_lft forever preferred_lft forever
But here we have a link local address. No idea if this is important or
not.
[...]
> # connmand -d
> # connmanctl services
> *Aa NETGEAR_11N
> wifi_aa4a5c6ba483_4e4554474541525f31314e_managed_psk
> # connmanctl connect wifi_aa4a5c6ba483_4e4554474541525f31314e_managed_psk
> Error
Which version of ConnMan and iwd are you using? We just released a new
ConnMan version which updated the iwd plugin. Older version of ConnMan
do not work correctly with iwd 1.x.
> # grep connmand /var/log/messages
This part is hard to read because the lines are wrapped. Could you
upload it somewhere and post the link?
Thanks,
Daniel
------------------------------
Date: Wed, 4 Mar 2020 09:47:40 +0100
From: Mauro Condarelli <[email protected]>
Subject: Re: Connman apparently not working on my embedded target
To: Daniel Wagner <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Hi Daniel,
Thanks for the fast answer.
On 3/4/20 9:22 AM, Daniel Wagner wrote:
> Hi Mauro,
>
> On Tue, Mar 03, 2020 at 09:51:02PM +0100, Mauro Condarelli wrote:
>> # dhcpcd -f /etc/dhcpcd.conf
> [...]
>
>> eth0: rebinding lease of 192.168.7.125
> Here dhcp says it's able to configure eth0
>
>> # ip a
>> 1: lo: <LOOPBACK> mtu 65536 qdisc noop qlen 1000
>> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
>> qlen 1000
>> link/ether 36:6f:f7:d1:b4:35 brd ff:ff:ff:ff:ff:ff
>> inet 169.254.83.182/16 brd 169.254.255.255 scope global eth0
>> valid_lft forever preferred_lft forever
> But here we have a link local address. No idea if this is important or
> not.
This is a bit strange, but somewhat expected:
This SoC has an integrated Ethernet Switch, so eth0 *believes*
it has connection because it sees the switch, but there's no
Ethernet cable on the other side of the (internal) switch, so
no connection with DHCP server is possible on that route.
Anyhow this is completely beyond the point (currently); as
You can see I completely disabled Ethernet under ConnMan.
I would like to fully understand what's going on, however.
Final target would be to have some simple way to configure
Networking *either* via wired or wireless, with all needed
parameters, including fixed (non DHCP) and authentication,
via scripting (without need of human intervention).
>
> [...]
>
>> # connmand -d
>> # connmanctl services
>> *Aa NETGEAR_11N
>> wifi_aa4a5c6ba483_4e4554474541525f31314e_managed_psk
>> # connmanctl connect wifi_aa4a5c6ba483_4e4554474541525f31314e_managed_psk
>> Error
> Which version of ConnMan and iwd are you using? We just released a new
> ConnMan version which updated the iwd plugin. Older version of ConnMan
> do not work correctly with iwd 1.x.
# connmand --version
1.37
# /usr/libexec/iwd --version
1.5
Should I upgrade?
>
>> # grep connmand /var/log/messages
> This part is hard to read because the lines are wrapped. Could you
> upload it somewhere and post the link?
Sorry, please see: http://paste.awesom.eu/LYgk
>
> Thanks,
> Daniel
> _______________________________________________
> connman mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>
Regards
Mauro
------------------------------
Date: Wed, 4 Mar 2020 10:24:10 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: Connman apparently not working on my embedded target
To: Mauro Condarelli <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
Hi Mauro,
On Wed, Mar 04, 2020 at 09:47:40AM +0100, Mauro Condarelli wrote:
> Hi Daniel,
> Thanks for the fast answer.
That was just pure luck :)
> > But here we have a link local address. No idea if this is important or
> > not.
> This is a bit strange, but somewhat expected:
> This SoC has an integrated Ethernet Switch, so eth0 *believes*
> it has connection because it sees the switch, but there's no
> Ethernet cable on the other side of the (internal) switch, so
> no connection with DHCP server is possible on that route.
>
> Anyhow this is completely beyond the point (currently); as
> You can see I completely disabled Ethernet under ConnMan.
Ok, it just looked a bit strange.
> >> # connmand -d
> >> # connmanctl services
> >> *Aa NETGEAR_11N
> >> wifi_aa4a5c6ba483_4e4554474541525f31314e_managed_psk
> >> # connmanctl connect wifi_aa4a5c6ba483_4e4554474541525f31314e_managed_psk
> >> Error
> > Which version of ConnMan and iwd are you using? We just released a new
> > ConnMan version which updated the iwd plugin. Older version of ConnMan
> > do not work correctly with iwd 1.x.
> # connmand --version
> 1.37
> # /usr/libexec/iwd --version
> 1.5
>
> Should I upgrade?
Yes. iwd is up to date but ConnMan doesn't support correctly iwd in 1.37.
> >
> >> # grep connmand /var/log/messages
> > This part is hard to read because the lines are wrapped. Could you
> > upload it somewhere and post the link?
> Sorry, please see: http://paste.awesom.eu/LYgk
Looks like you are using wpa_supplicant instead of iwd in
ConnMan. '--enable-wifi' enables the wpa_supplicant backend. Try to
use '--disable-wifi --enable-iwd' when configuring ConnMan 1.38. This
should use iwd instead.
Thanks,
Daniel
------------------------------
Date: Wed, 4 Mar 2020 10:40:54 +0000
From: nick83ola <[email protected]>
Subject: Re: [PATCH 2/2] ofono: store context apn value
To: Daniel Wagner <[email protected]>
Cc: connman <[email protected]>
Message-ID:
<cabph3uodca638o3we1ffcazdjca2++ld5p9qsw7cuuzq3ej...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Hi Daniel,
thanks for your comment I'm submitting another patch.
Actually I need a bit of help.
What I want to achieve with this and with another patch that I'm
working on is to be able to set the apn settings in connman via dbus.
And I wanted to ask:
- is possible for connman technologies to define custom dbus properties?
like the passphrase for wifi or the context settings (apn name,
username, password) for the modem network.
- How is the best way to achieve this? It needs modification in the technology ?
DO you have any example for this?
Thanks
Nicola Lunghi
On Wed, 4 Mar 2020 at 08:02, Daniel Wagner <[email protected]> wrote:
>
> Hi Nicola,
>
> Please add a commit message explaining why you are changing this.
>
>
> On Tue, Mar 03, 2020 at 06:27:37PM +0000, Nicola Lunghi wrote:
> > Signed-off-by: Nicola Lunghi <[email protected]>
>
> We don't do SoB.
>
> A few nitpicks.
>
> > ---
> > plugins/ofono.c | 60 ++++++++++++++++++++++++++++++++-----------------
> > 1 file changed, 40 insertions(+), 20 deletions(-)
> >
> > diff --git a/plugins/ofono.c b/plugins/ofono.c
> > index bb08cfd..e6e8827 100644
> > --- a/plugins/ofono.c
> > +++ b/plugins/ofono.c
> > @@ -133,6 +133,8 @@ static GHashTable *context_hash;
> > struct network_context {
> > char *path;
> > char *name;
> > + char *apn;
> > +
> > int index;
> > struct connman_network *network;
> >
> > @@ -147,7 +149,6 @@ struct network_context {
> > int refcount;
> >
> > bool active;
> > - bool valid_apn; /* APN is 'valid' if length > 0 */
> > };
> >
> > struct modem_data {
> > @@ -295,6 +296,7 @@ static void network_context_unref(struct
> > network_context *context)
> >
> > g_free(context->path);
> > g_free(context->name);
> > + g_free(context->apn);
> >
> > connman_ipaddress_free(context->ipv4_address);
> > g_free(context->ipv4_nameservers);
> > @@ -1174,6 +1176,29 @@ static int set_context_name(struct network_context
> > *context,
> > return 0;
> > }
> >
> > +static context_apn_is_valid(struct network_context *context)
> > +{
> > + return ((context!=NULL) &&
> > + (context->apn != NULL) &&
> > + (strlen(context->apn) > 0));
>
> return context && context->apn && strlen(context->apn);
>
> > +}
> > +
> > +static int set_context_apn(struct network_context *context, const char
> > *apn_name)
> > +{
> > + if (!context || !apn_name)
> > + return -EINVAL;
> > +
> > + g_free(context->apn);
> > + context->apn = g_strdup(apn_name);
> > +
> > + if(!context->apn)
> > + return -ENOMEM;
>
>
> No need for testing here. g_strdup() will call abort() if the
> allocation fails.
>
> > +
> > + DBG("%s Set context apn to %s", context->path, context->name);
> > +
> > + return 0;
> > +}
> > +
> > static int set_context_ipconfig(struct network_context *context,
> > const char *protocol)
> > {
> > @@ -1222,6 +1247,7 @@ static int add_cm_context(struct modem_data *modem,
> > const char *context_path,
> > dbus_bool_t active = FALSE;
> > const char *ip_protocol = NULL;
> > const char *ctx_name = NULL;
> > + const char *apn_name = NULL;
> >
> > DBG("%s context path %s", modem->path, context_path);
> >
> > @@ -1262,16 +1288,10 @@ static int add_cm_context(struct modem_data *modem,
> > const char *context_path,
> > dbus_message_iter_get_basic(&value, &active);
> >
> > DBG("%s Active %d", modem->path, active);
> > - } else if (g_str_equal(key, "AccessPointName")) {
> > - const char *apn;
> > -
> > - dbus_message_iter_get_basic(&value, &apn);
> > - if (apn && strlen(apn) > 0)
> > - context->valid_apn = true;
> > - else
> > - context->valid_apn = false;
> > -
> > - DBG("%s AccessPointName '%s'", modem->path, apn);
> > + } else if (g_str_equal(key, "AccessPointName") &&
> > + dbus_message_iter_get_arg_type(&value) ==
> > DBUS_TYPE_STRING ) {
>
> Hmm, yeah the 80 chararter limit is making it sometimes hard. Maybe
> adding an emtpy line here. Makes it easier to understand where the
> body starts. Not completely conistent but I thknk still the better option
>
> > + dbus_message_iter_get_basic(&value, &apn_name);
>
> And here an empty line. The rest of the code does this.
>
> > + DBG("%s AccessPointName '%s'", modem->path, apn_name);
> > } else if (g_str_equal(key, "Protocol") &&
> > dbus_message_iter_get_arg_type(&value) ==
> > DBUS_TYPE_STRING ) {
> >
> > @@ -1291,6 +1311,9 @@ static int add_cm_context(struct modem_data *modem,
> > const char *context_path,
> > if (ctx_name)
> > set_context_name(context, ctx_name);
> >
> > + if (apn_name)
> > + set_context_apn(context, apn_name);
> > +
> > if (ip_protocol)
> > set_context_ipconfig(context, ip_protocol);
> >
> > @@ -1299,7 +1322,7 @@ static int add_cm_context(struct modem_data *modem,
> > const char *context_path,
> > modem->context_list = g_slist_prepend(modem->context_list, context);
> > g_hash_table_replace(context_hash, g_strdup(context_path), modem);
> >
> > - if (context->valid_apn && modem->attached &&
> > + if (context_apn_is_valid(context) && modem->attached &&
> > has_interface(modem->interfaces, OFONO_API_NETREG))
> > add_network(modem, context);
> >
> > @@ -1410,15 +1433,14 @@ static gboolean context_changed(DBusConnection
> > *conn,
> > else
> > set_disconnected(context);
> > } else if (g_str_equal(key, "AccessPointName")) {
> > - const char *apn;
> > + const char *apn = NULL;
>
> Is this one needed?
>
> >
> > dbus_message_iter_get_basic(&value, &apn);
> >
> > - DBG("%s AccessPointName %s", modem->path, apn);
> > -
> > - if (apn && strlen(apn) > 0) {
> > - context->valid_apn = true;
> > + set_context_apn(context, apn);
> >
> > + if (context_apn_is_valid(context)) {
> > + DBG("%s AccessPointName %s", modem->path,
> > context->apn);
> > if (context->network)
> > return TRUE;
> >
> > @@ -1434,8 +1456,6 @@ static gboolean context_changed(DBusConnection *conn,
> > if (context->active)
> > set_connected(modem, context);
> > } else {
> > - context->valid_apn = false;
> > -
> > if (!context->network)
> > return TRUE;
> >
> > @@ -1804,7 +1824,7 @@ static void netreg_properties_reply(struct modem_data
> > *modem,
> > for (list = modem->context_list; list; list = list->next) {
> > struct network_context *context = list->data;
> >
> > - if (context->valid_apn)
> > + if (context_apn_is_valid(context))
> > add_network(modem, context);
> > if (context->active)
> > set_connected(modem, context);
>
> Thanks,
> Daniel
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]
------------------------------
End of connman Digest, Vol 53, Issue 5
**************************************