keyfile: allow "," as unmanaged-devices separator

Only using ";" (the GKeyFile default) often confuses people.
all: fix up multiple-include-guard defines

Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and
libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include
guard, which meant that nm-test-utils.h could not tell which of them
was being included (and so, eg, if you tried to include
nm-ip4-config.h in a libnm test, it would fail to compile because
nm-test-utils.h was referring to symbols in src/nm-ip4-config.h).

Fix this by changing the include guards in the non-API-stable parts of
the tree:

  - libnm-glib/nm-ip4-config.h remains   NM_IP4_CONFIG_H
  - libnm/nm-ip4-config.h now uses     __NM_IP4_CONFIG_H__
  - src/nm-ip4-config.h now uses       __NETWORKMANAGER_IP4_CONFIG_H__

And likewise for all other headers.

The two non-"nm"-prefixed headers, libnm/NetworkManager.h and
src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and
__NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely
consistent with the general scheme, do still mostly make sense in
isolation.
libnm-core: drop nm_connection_create_setting()

This was only used in one place, and is trivial to implement inline
there.
libnm-core: move some fake NMConnection methods over to NMSetting

nm_connection_lookup_setting_type() and
nm_connection_lookup_setting_type_by_quark() have nothing to do with
NMConnection. So move them to NMSetting (and rename them to
nm_setting_lookup_type() and nm_setting_lookup_type_by_quark()).
libnm-core: add missing NMConnection signal class handlers

Add class handlers for the "secrets-cleared" and "changed" signals.
("secrets-updated" already had one.)
libnm: get rid of redundant NMRemoteConnection properties

NMRemoteConnection had two DBusGConnection properties
(NMRemoteConnection:bus and NMRemoteConnection:dbus-connection) and
two D-Bus path properties (NMConnection:path and
NMRemoteConnection:dbus-path). The former of each pair were the
traditional names, and the latter were added for compatibility with
NMObject.

In libnm, we can just drop NMRemoteConnection:bus, and use the
NMObject-compatible :dbus-connection name instead.

For the path properties, we need to rename either NMConnection:path or
NMObject:dbus-path. Since NMObject already has "nm_object_get_path()"
rather than "nm_object_get_dbus_path()", and it already mistakenly
referred to the property as "NMObject:path" in the gtk-docs, it seemed
to make sense to rename that one rather than the NMConnection one.

(And then, for consistency, rename "nm_object_get_connection()" to
"nm_object_get_dbus_connection()" to also match its property.)
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().
libnm: make NMRemoteConnection an NMObject
Make NMConnection an interface, and NMRemoteConnection an NMObject (bgo #734746)
build: adjust `make cscope` paths for recent refactoring

Signed-off-by: Thomas Haller <thaller@redhat.com>
keyfile: fix crash due to uninitialized variable when reading invalid connection

Fixes: 2bfccab710f694c9f2d54033a305ba64533e3bc5
Signed-off-by: Thomas Haller <thaller@redhat.com>
cli: fix crash in `nmcli device wifi` with multiple wifi devices (bgo #734466)

And separate details for particular devices with an empty line.

https://bugzilla.gnome.org/show_bug.cgi?id=734466

Reported-by: Martin Pitt <martinpitt@gnome.org>
trivial: fix a typo in show_access_point_info() function name
libnm, libnm-glib: fix cut-and-paste-os

Several nm-device-*.c files apparently originally used
nm-device-ethernet.c as a template, but missed a reference to "eth" in
class_init.
libnm-core: fix crash in NMSettingAdsl:verify()

Signed-off-by: Thomas Haller <thaller@redhat.com>
settings: fix memory leak in get_settings_auth_cb()

Signed-off-by: Thomas Haller <thaller@redhat.com>
cli: succeed in master bring-up when device state reaches IP_CONFIG (bgo #733641)

When connecting a master connection, no slave devices will be activated
automatically. The user is supposed to activate them individually.

Hence nmcli should not wait for the connection to be fully activated
because that is not going to happen (unless the user connects a slave
connection from another terminal).

Instead, for master connections behave differently and signal success
once the master device reaches IP_CONFIG state.

This revises behavior introduced by commit
47710f8211f178cddf5f84c1a50146d7476115a7.

https://bugzilla.gnome.org/show_bug.cgi?id=733641

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
supplicant: fix expected return type of AddBlob D-Bus call

Commit fb6cde50 changed from setBlobs in the old wpa_supplicant D-Bus
interface, which returned an integer status code, to AddBlob in the new
one, which doesn't, but didn't account for that change. That caused
error messages of the form "Couldn't set network certificates: Too few
arguments in reply." on valid connection requests.

Signed-off-by: Geoffrey Thomas <gthomas@mokafive.com>
libnm-core: clear secrets from NMSimpleConnection and NMSettingsConnection dispose()

A few of the settings plugins were calling nm_connection_clear_secrets()
from their finalize() method, but this call can emit signals, and by
the time finalize() runs, the object has a refcount of 0.  Signals
cannot be emitted from a finalized object, but instead could be
emitted from dispose() before the object is finalized.

Instead of moving the nm_connection_clear_secrets() to dispose() in each
plugin, make the behavior generic instead.  The settings plugins' parent
object is NMSettingsConnection, so clear secrets there.  Plus,
NMSettingsConnection caches system & agent secrets with NMSimpleConnection
objects, so clear secrets in NMSimpleConnection's dispose too.
core: print warning message when skipping invalid device plugin file

https://mail.gnome.org/archives/networkmanager-list/2014-August/msg00042.html

Signed-off-by: Thomas Haller <thaller@redhat.com>