Commit Graph

21088 Commits

Author SHA1 Message Date
Lubomir Rintel
46806d403c merge: branch 'lr/device-modify'
https://bugzilla.gnome.org/show_bug.cgi?id=767999
2016-06-29 20:28:59 +02:00
Lubomir Rintel
8b4494598d cli/device: add modify command
It modifies the applied connection using the Reapply API.
2016-06-29 20:28:42 +02:00
Lubomir Rintel
a0bb8cd6cb cli/connection: export read_connection_properties()
It makes sense to modify the applied connection from the device object.
2016-06-29 20:28:42 +02:00
Lubomir Rintel
c054b871f7 cli/device: add device name completion
Useful with connect, disconnect, delete, monitor, show and reapply.
2016-06-29 20:28:42 +02:00
Lubomir Rintel
59bc820e66 cli/device: split get_device()
Parsing a single device name from the command line is generally
useful. Remove the open coded versions in reapply, connect & status.
2016-06-29 20:28:42 +02:00
Lubomir Rintel
55d349bc34 cli/trivial: rename device_list() to get_device_list()
It will look nicer when we have get_device().
2016-06-29 20:28:42 +02:00
Lubomir Rintel
5182ab3d5d cli/device: use nmc_do_cmd() 2016-06-29 20:28:42 +02:00
Lubomir Rintel
1a88eac02a cli: split out do_cmd() 2016-06-29 20:28:42 +02:00
Lubomir Rintel
a30224f6af cli: use should_wait consistently
It's a semaphore, not a boolean.
2016-06-29 20:28:42 +02:00
Lubomir Rintel
ef8d696252 cli: move the final completion check after the main loop exit
For "nmcli d modify" we'll need to do the completion from async
handlers. This seems to be the most reasonable place to ignore the
errors.
2016-06-29 20:28:42 +02:00
Lubomir Rintel
56804f4a3f cli/trivial: rename some functions for consistency
Some functions that take device lists use plural form in name.
2016-06-29 20:28:42 +02:00
Lubomir Rintel
86ffc08775 cli/connections: only do completion for the last argument
Completing the property when we stop parsing due to error is not the
right thing to do.
2016-06-29 20:28:42 +02:00
Thomas Haller
88c3050000 wwan/ofono: merge branch 'th/review/ofono'
https://mail.gnome.org/archives/networkmanager-list/2016-June/msg00085.html
https://mail.gnome.org/archives/networkmanager-list/2016-June/msg00089.html
2016-06-28 18:22:24 +02:00
Beniamino Galvani
2b958dce91 wwan/ofono: fix indentation 2016-06-28 17:34:42 +02:00
Dan Williams
7d89b862f4 wwan/ofono: remove unused code 2016-06-28 17:34:42 +02:00
Dan Williams
0c9527d9b8 wwan/ofono: fix comment about IP4Config refcounting 2016-06-28 17:34:42 +02:00
Dan Williams
602c3f6ed3 wwan/ofono: clean up and standardize logging 2016-06-28 17:34:42 +02:00
Dan Williams
3ef9b6aa41 build: show ofono enablement status in configure summary 2016-06-28 17:34:42 +02:00
Dan Williams
938b27a8d2 wwan/ofono: simplify capabilities function and add FIXME about LTE 2016-06-28 17:34:42 +02:00
Dan Williams
b898b0882b wwan/ofono: whitespace fixup 2016-06-28 17:34:42 +02:00
Dan Williams
3c054e21ba wwan/ofono: remove some unused types 2016-06-28 17:34:42 +02:00
Dan Williams
87aa671e6b wwan: no need for NM_MODEM_BROADBAND_MODEM to be public 2016-06-28 17:34:42 +02:00
Dan Williams
219904920f wwan/ofono: clean up g_clear_object() usage 2016-06-28 17:34:42 +02:00
Dan Williams
58ab8c9316 wwan/ofono: use g_dbus_proxy_new_for_bus() 2016-06-28 17:34:42 +02:00
Dan Williams
f0af7a0d05 wwan: rework ModemManager/ofono initialization
Avoids the following error when ofono isn't running:

NetworkManager[25133]: <info>  [1466186144.1392] ofono is now available
NetworkManager[25133]: <warn>  [1466186144.1637] failed to enumerate oFono devices: Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag

because the code assumes that if the GDBusProxy is created, that
oFono is available.  That's not the case with DO_NOT_AUTO_START
because it creates the proxy anyway, and lets the caller listen
for name-owner-changed signals instead.  The GDBusProxy also
doesn't need to be cleared, since it will follow name-owner
changes and emit g-name-owner changes when oFono starts/stops.

This also fixes the oFono name-owner-changed watch.  It was presumably
using the signal name copied from the ModemManager 'notify::name-owner'
code, but that's a GDBusObjectManagerClient.  The oFono code is using
a GDBusProxy for which the signal is 'notify::g-name-owner'.

Finally, the oFono code shouldn't really be piggy-backing on the
ModemManager autolaunch code, it's just cleaner to keep the two
code paths separate and initialize oFono in parallel.
2016-06-28 17:34:42 +02:00
Dan Williams
019b34af62 wwan/ofono: whitespace fixup 2016-06-28 17:34:42 +02:00
Dan Williams
8a827b1b4f wwan/ofono: fix a few more memory leaks 2016-06-28 17:34:42 +02:00
Dan Williams
425ae4fbd2 wwan: remove some dbus-glib left-overs 2016-06-28 17:34:42 +02:00
Dan Williams
d99171d700 wwan: use modem basename as NM device name
NM_MODEM_UID is used as the modem device name, and the device name
cannot contain path-like characters.

Ofono has a bluez plugin that detects paired DUN/PAN capable
Bluetooth devices, and these devices are created with a multi-component
object path like "/hfp/org/bluez/hci0/dev_00_26_E2_AB_68_66".
The NM ofono plugin cannot use these paths as NM device names.

Instead, strip off any path components and use the last part
of the object path as the NM device name.
2016-06-28 17:34:42 +02:00
Thomas Haller
e06e1d4691 wwan: cleanup clearing ofono proxy instance 2016-06-28 17:34:42 +02:00
Thomas Haller
44ce13c786 wwan: don't compile ofono support by default and mark as experimental
At least, there are assertions that fail and must be fixed.
Still, let's merge the (incomplete) ofono patches early
to have something that can be incrementally improved.

However, for now mark it as experimental and disable it by
default.
2016-06-28 17:34:42 +02:00
Thomas Haller
521133d456 core: revert asserts to NM_ASSERT_VALID_PATH_COMPONENT() and _get_property_path()
If ofono violates these asserts, then the bug must be fixed somewhere
else, not by silently doing something wrong.
2016-06-28 17:34:42 +02:00
Thomas Haller
5a740d323e wwan: fix memleaks
And use gs_free in ofono_check_name_owner()
2016-06-28 17:34:42 +02:00
Thomas Haller
5cdb2b1520 wwan: cleanup includes 2016-06-28 17:34:42 +02:00
Thomas Haller
3ef0641674 wwan: some minor refactorings 2016-06-28 17:34:42 +02:00
Thomas Haller
4e00e7a15f wwan: remove unused code 2016-06-28 17:34:42 +02:00
Thomas Haller
735bb933f6 wwan: fix building for !WITH_OFONO 2016-06-28 17:34:42 +02:00
Thomas Haller
acac97f818 wwan: fix compilation error about wrong field name 2016-06-28 17:34:42 +02:00
Thomas Haller
9e63ada7e2 wwna: fix compiler error about wrong prototype 2016-06-28 17:34:42 +02:00
Thomas Haller
8621b0aba9 wwan: fix using wrong enum type for flags for g_dbus_proxy_new() 2016-06-28 17:34:42 +02:00
Thomas Haller
1b570723b4 trivial: style issues and indention 2016-06-28 17:34:42 +02:00
Mathieu Trudel-Lapierre
a6e81af87f wwan: add support for using oFono as a modem manager
This patch adds core wwan support for ofono, as used by Ubuntu Touch.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>

https://mail.gnome.org/archives/networkmanager-list/2016-June/msg00089.html
2016-06-28 17:34:42 +02:00
Thomas Haller
13b2253df6 wwan: cleanup clearing modem-manager instance 2016-06-28 17:34:42 +02:00
Beniamino Galvani
88637dee66 vpn,dns: merge branch 'bg/vpn-dns-rh1348901' 2016-06-28 16:39:17 +02:00
Beniamino Galvani
df48628a48 vpn: don't merge DNS properties into parent device's configuration
DNS properties should not be copied to parent device's configuration
otherwise they will be applied twice, possibly with two different DNS
priorities.
2016-06-28 16:24:28 +02:00
Beniamino Galvani
a5d1db08f8 dns: log DNS servers at TRACE level
Be more verbose at TRACE level and log the DNS servers associated to
configurations. This will help to debug issues like [0].

[0] https://bugzilla.redhat.com/show_bug.cgi?id=1348887
2016-06-28 16:24:28 +02:00
Beniamino Galvani
641e8b00fe vpn: reuse existing ip_config objects when config gets updated
Previously we created a new NMIP[46]Config object to replace the
previous one every time the plugin reported a new IP configuration
through the Ip[46]Config signal, but the old configuration was not
removed from the DNS manager and would become stale.

The interaction with DNS manager is handled by NMPolicy, which only
reacts to changes in connection status, so it's not easy to have the
configuration removed from DNS while keeping the connection state
ACTIVATED.

A cleaner solutions is to avoid creating a new IP configuration object
and reuse the existing one if possible. The side effect is that the
D-Bus path of the object will not change, which seems also positive.

https://bugzilla.redhat.com/show_bug.cgi?id=1348901
2016-06-28 16:24:16 +02:00
Beniamino Galvani
19133b08da vpn: dispatch pre-up scripts only once
If the plugin sends a new configuration when the connection is already
activated the state should not go back to PRE_UP since this causes
dispatcher scripts to run again.
2016-06-28 16:24:16 +02:00
Francesco Giudici
fdecb6b669 cli: option autocompletion should not match words without trailing '-'
This would fix for example:
nmcli e <TAB>
(e interpreted as --escape, would allow autocompletion to work... but
when the command is executed an error is reported)

Moreover, we will now have:
nmcli c <TAB>
autocompletion work correctly, i.e., c is correctly interpreted  as
"connection" instead of "--colors"
2016-06-28 12:12:39 +02:00
Francesco Giudici
fd4a8a202e bond/trivial: fix typo 2016-06-28 11:47:50 +02:00