clients: NMSecretAgentSimple API fixups

nm_secret_agent_simple_*() functions should take an
NMSecretAgentSimple, not an NMSecretAgent.

The type macros were incorrectly validating against
NM_TYPE_SECRET_AGENT rather than NM_TYPE_SECRET_AGENT_SIMPLE.
clients: merge nm_secret_agent_simple_set_connection_path() into nm_secret_agent_simple_enable()

set_connection_path() is almost always called right before enable(),
and it's unclear why it would be called anywhere else.  So just
merge the two methods.
libnm: rename NMSecretAgent to NMSecretAgentOld

As with NMVpnPluginOld, rename NMSecretAgent to NMSecretAgentOld, to
leave the name "NMSecretAgent" open for a new-and-improved version in
NM 1.2.
libnm: merge branch 'secret-agent-old-bgo740345'

Rename NMSecretAgent to NMSecretAgentOld, to leave the name
"NMSecretAgent" open for a new-and-improved version in NM 1.2.

Also, a handful of NMSecretAgentSimple fixups.

https://bugzilla.gnome.org/show_bug.cgi?id=740345
po: updated Ukranian translation (bgo #740533)

https://bugzilla.gnome.org/show_bug.cgi?id=740533
vlan: export parent device for VLANs as D-Bus property

and use the internal construct-time parent property for VLAN creation.
core: add NM_UNMANAGED_PARENT flag for a dependency on parent device

VLAN device depends on its parent, for instance. If the parent is not managed,
then the VLAN can't be either.
libnm-glib: add :parent property for VLAN devices
libnm: add :parent property for VLAN devices
cli: add parent device information for VLAN devices
merge: reflect parent device manage/unmanage state for VLANs (rh #1114681)

VLAN device watches the parent and reacts to its state change. However, on
creation, the device was made managed, even if the parent was unmanaged. Fix
that and export VLAN parent device property too. The property is added to
libnm/libnm-glib and nmcli as well.

https://bugzilla.redhat.com/show_bug.cgi?id=1114681
dhcp: fix expiry time logging/exporting

The previous nm-dhcp-systemd code for logging the lease expiry time,
and exporting that value to D-Bus was clamping the value to
G_MAXUINT32-1, but that's unnecessary on x86_64, and incorrect on x86
(since time_t is signed).

Correctly adding a value to the current time and not overflowing seems
to be more-or-less impossible without having separate cases for 4- and
8-byte time_t. Since this was basically just for logging purposes
anyway, just log the number of seconds rather than the timestamp, and
then we don't have to worry about sizeof(time_t).
dhcp: pass device specific route metric to nm_dhcp_systemd_get_lease_ip_configs()

Signed-off-by: Thomas Haller <thaller@redhat.com>
dhcp: fix printf format string for printing guint32 variable

Fixes: 9013fd42d6d3cf2ed458043744611c3a996b0c66
libnm: allow zero prefix length for NMIPRoute

NMIPRoute is used by NMSettingIPConfig, but also
NMIPConfig. In the former case, default routes are (still)
disallowed. But in the NMIPConfig use-case, it can make sense
to expose default routes as NMIPRoute instances.

Relax the restriction on the NMIPRoute API to allow this
future change.

No code actually supports having NMIPRoute instances with
prefix length zero (default routes). Up to now, all such uses
would be a bug.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm: add missing (transfer) annotation for nm_device_vlan_get_parent()
tui: fix a bug that hid the IP method popup (rh #1167710)
libnm-util: return empty hash, not NULL in nm_setting_to_hash() (bgo #740681)

The function was changed to return NULL instead of empty hash by commit
ad56cfa914d6a0f49b51e917ce89001f19c72d9f. Later, the condition had to be
relaxed for NMSettingGeneric (commit 4d32618264d7ca169036347a25f38689cce632f3).
Unforfunately, it shows up that there are other use cases that require
presence of a setting (that might have all properties default), such as
NMSettingBridgePort for bridge slave connections.

libnm already behaves this way, since commit
6325c596c093e34d290604e2ef24219427a1078d.

https://bugzilla.gnome.org/show_bug.cgi?id=740681
platform: add paramter to ip4_route_add to set src (RTA_PREFSRC)

Signed-off-by: Thomas Haller <thaller@redhat.com>
core: fix route metrics for subnet routes

For IPv4 addresses, the kernel automatically adds a route when
configuring an IP address. Unfortunately, there is no way to control
this behavior or to set the route metric.

Fix this, by adding our own route and removing the kernel provided
one.

Note that this adds a major change in that we no longer call
nm_ip4_config_commit() for assumed devices.

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

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