libnm-core, libnm, core: make NMConnection an interface
authorDan Winship <danw@gnome.org>
Wed, 13 Aug 2014 18:34:29 +0000 (14:34 -0400)
committerDan Winship <danw@gnome.org>
Sat, 16 Aug 2014 14:17:53 +0000 (10:17 -0400)
commite1ba13a426bf6fc34043822d772384559b0831cb
treea70fc1d7815f244e9b17388a17711df155ed9bda
parent5ed054aca9d30c13a7c47bd51cb475d857443b44
libnm-core, libnm, core: make NMConnection an interface

The fact that NMRemoteConnection has to be an NMConnection and
therefore can't be an NMObject means that it needs to reimplement bits
of NMObject functionality (and likewise NMObject needs some special
magic to deal with it). Likewise, we will need a daemon-side
equivalent of NMObject as part of the gdbus port, and we would want
NMSettingsConnection to be able to inherit from this as well.

Solve this problem by making NMConnection into an interface, and
having NMRemoteConnection and NMSettingsConnection implement it. (We
use some hacks to keep the GHashTable of NMSettings objects inside
nm-connection.c rather than having to be implemented by the
implementations.)

Since NMConnection is no longer an instantiable type, this adds
NMSimpleConnection to replace the various non-D-Bus-based uses of
NMConnection throughout the code. nm_connection_new() becomes
nm_simple_connection_new(), nm_connection_new_from_hash() becomes
nm_simple_connection_new_from_hash(), and nm_connection_duplicate()
becomes nm_simple_connection_new_clone().
45 files changed:
callouts/tests/test-dispatcher-envp.c
clients/cli/connections.c
clients/cli/devices.c
clients/tui/nm-editor-utils.c
clients/tui/nmt-editor.c
examples/C/glib/add-connection-dbus-glib.c
examples/C/glib/add-connection-libnm.c
examples/C/glib/get-active-connections-dbus-glib.c
include/nm-test-utils.h
libnm-core/Makefile.libnm-core
libnm-core/nm-connection.c
libnm-core/nm-connection.h
libnm-core/nm-simple-connection.c [new file with mode: 0644]
libnm-core/nm-simple-connection.h [new file with mode: 0644]
libnm-core/nm-utils.h
libnm-core/tests/test-general.c
libnm-core/tests/test-secrets.c
libnm/NetworkManager.h
libnm/libnm.ver
libnm/nm-remote-connection.c
libnm/nm-remote-connection.h
libnm/nm-remote-settings.c
libnm/nm-secret-agent.c
libnm/nm-vpn-plugin.c
libnm/tests/test-nm-client.c
libnm/tests/test-remote-settings-client.c
src/devices/bluetooth/nm-bluez-device.c
src/devices/nm-device.c
src/devices/wifi/tests/test-wifi-ap-utils.c
src/nm-manager.c
src/settings/nm-agent-manager.c
src/settings/nm-secret-agent.c
src/settings/nm-settings-connection.c
src/settings/nm-settings-connection.h
src/settings/nm-settings.c
src/settings/plugins/ifcfg-rh/reader.c
src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
src/settings/plugins/ifnet/connection_parser.c
src/settings/plugins/ifupdown/tests/test-ifupdown.c
src/settings/plugins/keyfile/reader.c
src/settings/plugins/keyfile/tests/test-keyfile.c
src/settings/tests/test-wired-defname.c
src/supplicant-manager/tests/test-supplicant-config.c
src/tests/test-general.c
src/vpn-manager/nm-vpn-connection.c