cli: Add mode option for wifi connecitons

Only default (infrastructure) mode connections can be created and as it's not
possible to write mode=ap connections with ifcfg-rh plugins, they can't be
switched to mode=ap.
libnm: (trivial) reorder NMClient function declarations/code

Rearrange the NMClient function declarations and the functions
themselves, and group them into "general", "device", and "active
connection" sections.

No code changes, just moving things around.
libnm: clean up NMClient semantics when NM is not running

Add a single function to check if NM is running and set a GError if
not, then use it as appropriate.

Don't bother to check if NM is running in get_*() functions if
nm_running_changed_cb() would have reset the field anyway (and fix
that up to reset a few more fields).
libnm: split "NMManager" out of NMClient

Clone NMClient as NMManager, and make NMClient just be a wrapper
around that new class.
cli: (trivial) rename NmCli.system_connections to connections

Rename NmCli.system_connections to connections, since the "user
connections" have been gone forever.
libnm: merge NMRemoteSettings into NMClient

Make NMRemoteSettings internal and have NMClient wrap all of its APIs,
just like it does with NMManager.
libnm: merge NMRemoteSettings into NMClient (bgo #738103)
libnm: add nm-types.h, to avoid include loops

Add nm-types.h defining all the type structs, to avoid future include
loops. Clean up the includes in all of the installed headers.
libnm: fix NMActiveConnection object-path-valued properties

NMActiveConnection:connection was an object path rather than an
NMRemoteConnection because in the past the NMObject property system
wasn't capable of handling NMRemoteConnection-valued properties.
NMActiveConnection:master was an object path rather than an NMDevice
entirely by accident. Fix both.

NMActiveConnection:specific-object can't currently be converted to an
object, because we don't know ahead of time what object type it is,
and NMObject can't deal with that. Instead, we rename it to
:specific-object-path (and likewise for its get function), both to
emphasize that it doesn't behave like other properties, and to leave
the old name open for an actual object-valued property later on.
libnm: fix NMActiveConnection object-path-valued properties (bgo #738103)
libnm: fix crash in nm_client_new_async(), add a test for it

nm_client_new_async() got broken in the NMManager split. Fix it, and
use it from one of the tests in test-nm-client to make sure it's
getting tested in the future.
contrib/nm-live-vm: install perl dependancy (YAML) in mock build

Signed-off-by: Thomas Haller <thaller@redhat.com>
nmtst: improve nmtst_assert_connection_verifies_without_normalization()

If the assertion in verifies_without_normalization() fails due to
@was_modified, the error message is not helpful.
Assert first against the content of the connection. This prints
most likely the settings that were actually modified.

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm: make @copy_func argument in _nm_utils_copy_strdict() optional

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm: add NMSettingConnection:autoconnect-priority setting

The autoconnect priority has only any relevance, if the connection
is autoconnect too.

The priority defaults to zero, with higher numbers meaning preferred.
The valid range is limited to [-999,999].

Signed-off-by: Thomas Haller <thaller@redhat.com>
ifcfg-rh: add svGetValueInt64() utility function

Signed-off-by: Thomas Haller <thaller@redhat.com>
ifcfg-rh: add support for NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY

Signed-off-by: Thomas Haller <thaller@redhat.com>
cli: fix type when setting variadic argument in nmc_property_set_uint()

Signed-off-by: Thomas Haller <thaller@redhat.com>
cli: add nmc_property_set_int() function

Signed-off-by: Thomas Haller <thaller@redhat.com>
cli: support connection.autoconnect-priority property

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