NetworkManager/libnm-core
Thomas Haller 4154d9618c bluetooth: refactor BlueZ handling and let NMBluezManager cache ObjectManager data
This is a complete refactoring of the bluetooth code.

Now that BlueZ 4 support was dropped, the separation of NMBluezManager
and NMBluez5Manager makes no sense. They should be merged.

At that point, notice that BlueZ 5's D-Bus API is fully centered around
D-Bus's ObjectManager interface. Using that interface, we basically only
call GetManagedObjects() once and register to InterfacesAdded,
InterfacesRemoved and PropertiesChanged signals. There is no need to
fetch individual properties ever.

Note how NMBluezDevice used to query the D-Bus properties itself by
creating a GDBusProxy. This is redundant, because when using the ObjectManager
interfaces, we have all information already.

Instead, let NMBluezManager basically become the client-side cache of
all of BlueZ's ObjectManager interface. NMBluezDevice was mostly concerned
about caching the D-Bus interface's state, tracking suitable profiles
(pan_connection), and moderate between bluez and NMDeviceBt.
These tasks don't get simpler by moving them to a seprate file. Let them
also be handled by NMBluezManager.

I mean, just look how it was previously: NMBluez5Manager registers to
ObjectManager interface and sees a device appearing. It creates a
NMBluezDevice object and registers to its "initialized" and
"notify:usable" signal. In the meantime, NMBluezDevice fetches the
relevant information from D-Bus (although it was already present in the
data provided by the ObjectManager) and eventually emits these usable
and initialized signals.
Then, NMBlue5Manager emits a "bdaddr-added" signal, for which NMBluezManager
creates the NMDeviceBt instance. NMBluezManager, NMBluez5Manager and
NMBluezDevice are strongly cooperating to the point that it is simpler
to merge them.

This is not mere refactoring. This patch aims to make everything
asynchronously and always cancellable. Also, it aims to fix races
and inconsistencies of the state.

- Registering to a NAP server now waits for the response and delays
  activation of the NMDeviceBridge accordingly.

- For NAP connections we now watch the bnep0 interface in platform, and tear
  down the device when it goes away. Bluez doesn't send us a notification
  on D-Bus in that case.

- Rework establishing a DUN connection. It no longer uses blocking
  connect() and does not block until rfcomm device appears. It's
  all async now. It also watches the rfcomm file descriptor for
  POLLERR/POLLHUP to notice disconnect.

- drop nm_device_factory_emit_component_added() and instead let
  NMDeviceBt directly register to the WWan factory's "added" signal.
2019-09-23 12:47:37 +02:00
..
tests libnm/test: add unit test with consistency checks about NMSetting type info 2019-09-21 22:01:29 +02:00
meson.build libnm-core: add ovs-dpdk setting 2019-06-14 12:10:20 +02:00
nm-connection-private.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-connection.c setting-gsm: add auto-config property 2019-09-11 14:32:05 +02:00
nm-connection.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-core-enum-types.c.template libnm-core: add ovs-dpdk setting 2019-06-14 12:10:20 +02:00
nm-core-enum-types.h.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
nm-core-internal.h bluetooth: refactor BlueZ handling and let NMBluezManager cache ObjectManager data 2019-09-23 12:47:37 +02:00
nm-core-types-internal.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-core-types.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto-gnutls.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto-impl.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto-nss.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-dbus-interface.h libnm: export reload flags 2019-09-17 09:30:18 +02:00
nm-dbus-utils.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-errors.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-errors.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-json.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-json.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-keyfile-internal.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-keyfile-utils.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-keyfile-utils.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-keyfile.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-property-compare.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-property-compare.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-6lowpan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-6lowpan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-8021x.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-8021x.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-adsl.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-adsl.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bluetooth.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bluetooth.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bond.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bond.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bridge-port.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bridge-port.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bridge.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bridge.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-cdma.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-cdma.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-connection.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-connection.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-dcb.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-dcb.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-dummy.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-dummy.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ethtool.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ethtool.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-generic.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-generic.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-gsm.c setting-gsm: allow empty apn property in verify() 2019-09-11 14:32:05 +02:00
nm-setting-gsm.h setting-gsm: add auto-config property 2019-09-11 14:32:05 +02:00
nm-setting-infiniband.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-infiniband.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip-config.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip-config.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip-tunnel.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip-tunnel.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip4-config.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip4-config.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip6-config.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip6-config.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-macsec.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-macsec.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-macvlan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-macvlan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-match.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-match.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-olpc-mesh.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-olpc-mesh.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-bridge.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-bridge.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-dpdk.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-dpdk.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-interface.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-interface.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-patch.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-patch.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-port.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-port.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ppp.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ppp.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-pppoe.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-pppoe.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-private.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-proxy.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-proxy.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-serial.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-serial.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-sriov.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-sriov.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-tc-config.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-tc-config.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-team-port.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-team-port.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-team.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-team.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-tun.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-tun.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-user.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-user.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vlan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vlan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vpn.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vpn.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vxlan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vxlan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wifi-p2p.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wifi-p2p.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wimax.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wimax.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wired.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wired.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wireguard.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wireguard.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wireless-security.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wireless-security.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wireless.c libnm-core: support SAE when determining AP compatibility 2019-09-20 13:18:18 +02:00
nm-setting-wireless.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wpan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wpan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting.c libnm/test: add unit test with consistency checks about NMSetting type info 2019-09-21 22:01:29 +02:00
nm-setting.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-simple-connection.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-simple-connection.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-team-utils.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-team-utils.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-utils-private.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-utils.c bluetooth: refactor BlueZ handling and let NMBluezManager cache ObjectManager data 2019-09-23 12:47:37 +02:00
nm-utils.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-version.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-dbus-interface.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-editor-plugin.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-editor-plugin.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-plugin-info.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-plugin-info.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00