From 6518e361171f64bcaaa4bf868139362ed95cc2e0 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sat, 20 Oct 2018 01:30:31 +0200 Subject: New upstream version 1.14.2 --- libnm/NetworkManager.h | 10 +- libnm/generate-setting-docs.py | 10 +- libnm/libnm.ver | 60 ++++++++++ libnm/meson.build | 12 +- libnm/nm-access-point.c | 6 +- libnm/nm-access-point.h | 2 +- libnm/nm-autoptr.h | 8 ++ libnm/nm-client.c | 17 ++- libnm/nm-dbus-helpers.c | 2 +- libnm/nm-device-6lowpan.c | 193 ++++++++++++++++++++++++++++++ libnm/nm-device-6lowpan.h | 50 ++++++++ libnm/nm-device-ovs-bridge.c | 2 +- libnm/nm-device-ovs-bridge.h | 2 +- libnm/nm-device-ovs-port.c | 2 +- libnm/nm-device-ovs-port.h | 2 +- libnm/nm-device-wimax.c | 12 +- libnm/nm-device-wimax.h | 6 +- libnm/nm-device-wireguard.c | 220 +++++++++++++++++++++++++++++++++++ libnm/nm-device-wireguard.h | 56 +++++++++ libnm/nm-device-wpan.c | 179 ++++++++++++++++++++++++++++ libnm/nm-device-wpan.h | 48 ++++++++ libnm/nm-device.c | 11 +- libnm/nm-dns-manager.c | 2 +- libnm/nm-ip-config.c | 2 + libnm/nm-object.c | 24 ++-- libnm/nm-property-docs.xml | 79 +++++-------- libnm/nm-settings-docs-overrides.xml | 12 +- libnm/nm-settings-docs.xml | 79 +++++-------- libnm/nm-settings-ifcfg-rh-docs.xml | 28 ++++- libnm/nm-settings-keyfile-docs.xml | 14 ++- libnm/nm-types.h | 5 +- libnm/nm-vpn-service-plugin.c | 17 ++- libnm/tests/meson.build | 2 +- libnm/tests/test-secret-agent.c | 8 +- 34 files changed, 1016 insertions(+), 166 deletions(-) create mode 100644 libnm/nm-device-6lowpan.c create mode 100644 libnm/nm-device-6lowpan.h create mode 100644 libnm/nm-device-wireguard.c create mode 100644 libnm/nm-device-wireguard.h create mode 100644 libnm/nm-device-wpan.c create mode 100644 libnm/nm-device-wpan.h (limited to 'libnm') diff --git a/libnm/NetworkManager.h b/libnm/NetworkManager.h index 9226aa35..759a4131 100644 --- a/libnm/NetworkManager.h +++ b/libnm/NetworkManager.h @@ -15,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright 2014 - 2017 Red Hat, Inc. + * Copyright 2014 - 2018 Red Hat, Inc. */ #ifndef __NETWORKMANAGER_H__ @@ -29,6 +29,7 @@ #include "nm-connection.h" #include "nm-core-enum-types.h" #include "nm-dbus-interface.h" +#include "nm-device-6lowpan.h" #include "nm-device-adsl.h" #include "nm-device-bond.h" #include "nm-device-bridge.h" @@ -52,12 +53,15 @@ #include "nm-device-vxlan.h" #include "nm-device-wifi.h" #include "nm-device-wimax.h" +#include "nm-device-wireguard.h" +#include "nm-device-wpan.h" #include "nm-device.h" #include "nm-dhcp-config.h" #include "nm-enum-types.h" #include "nm-ip-config.h" #include "nm-object.h" #include "nm-remote-connection.h" +#include "nm-setting-6lowpan.h" #include "nm-setting-8021x.h" #include "nm-setting-adsl.h" #include "nm-setting-bluetooth.h" @@ -68,6 +72,7 @@ #include "nm-setting-connection.h" #include "nm-setting-dcb.h" #include "nm-setting-dummy.h" +#include "nm-setting-ethtool.h" #include "nm-setting-generic.h" #include "nm-setting-gsm.h" #include "nm-setting-infiniband.h" @@ -77,6 +82,7 @@ #include "nm-setting-ip-tunnel.h" #include "nm-setting-macsec.h" #include "nm-setting-macvlan.h" +#include "nm-setting-match.h" #include "nm-setting-olpc-mesh.h" #include "nm-setting-ovs-bridge.h" #include "nm-setting-ovs-interface.h" @@ -86,6 +92,7 @@ #include "nm-setting-pppoe.h" #include "nm-setting-proxy.h" #include "nm-setting-serial.h" +#include "nm-setting-sriov.h" #include "nm-setting-tc-config.h" #include "nm-setting-team.h" #include "nm-setting-team-port.h" @@ -98,6 +105,7 @@ #include "nm-setting-wired.h" #include "nm-setting-wireless.h" #include "nm-setting-wireless-security.h" +#include "nm-setting-wpan.h" #include "nm-setting.h" #include "nm-simple-connection.h" #include "nm-utils.h" diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py index 22552615..bf069cbd 100755 --- a/libnm/generate-setting-docs.py +++ b/libnm/generate-setting-docs.py @@ -111,7 +111,7 @@ def init_constants(girxml, settings): setting_name = constants[setting_name_symbol] setting_names[setting_type_name] = setting_name -def get_prop_type(setting, pspec, propxml): +def get_prop_type(setting, pspec): dbus_type = setting.get_dbus_property_type(pspec.name).dup_string() prop_type = dbus_type_name_map[dbus_type] @@ -156,11 +156,9 @@ def get_default_value(setting, pspec, propxml): if default_value is None: return default_value - value_type = get_prop_type(setting, pspec, propxml) + value_type = get_prop_type(setting, pspec) if value_type == 'string' and default_value != '' and pspec.name != 'name': default_value = '"%s"' % default_value - elif value_type == 'gchar' and default_value != '': - default_value = "'%s'" % default_value elif value_type == 'boolean': default_value = str(default_value).upper() elif value_type == 'byte array': @@ -230,7 +228,7 @@ for settingxml in settings: raise Exception("%s needs a gtk-doc block with one-line description" % setting.props.name) outfile.write(" \n" % (setting.props.name, class_desc, get_setting_name_define (settingxml))) - setting_properties = { prop.name: prop for prop in GObject.list_properties(setting) } + setting_properties = { prop.name: prop for prop in GObject.list_properties(setting) if prop.name != 'name' } if args.overrides is None: setting_overrides = {} else: @@ -251,7 +249,7 @@ for settingxml in settings: if propxml is None: propxml = ipxml.find('./gi:property[@name="%s"]' % pspec.name, ns_map) - value_type = get_prop_type(setting, pspec, propxml) + value_type = get_prop_type(setting, pspec) value_desc = get_docs(propxml) default_value = get_default_value(setting, pspec, propxml) diff --git a/libnm/libnm.ver b/libnm/libnm.ver index d937f531..476cfcc9 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -1379,3 +1379,63 @@ libnm_1_12_2 { nm_device_ovs_bridge_get_slaves; nm_device_ovs_port_get_slaves; } libnm_1_12_0; + +libnm_1_14_0 { +global: + nm_connection_multi_connect_get_type; + nm_device_6lowpan_get_type; + nm_device_wireguard_get_fwmark; + nm_device_wireguard_get_listen_port; + nm_device_wireguard_get_public_key; + nm_device_wireguard_get_type; + nm_device_wpan_get_type; + nm_setting_6lowpan_get_type; + nm_setting_connection_get_llmnr; + nm_setting_connection_get_multi_connect; + nm_setting_connection_llmnr_get_type; + nm_setting_ethtool_clear_features; + nm_setting_ethtool_get_feature; + nm_setting_ethtool_get_type; + nm_setting_ethtool_new; + nm_setting_ethtool_set_feature; + nm_setting_match_add_interface_name; + nm_setting_match_clear_interface_names; + nm_setting_match_get_interface_name; + nm_setting_match_get_interface_names; + nm_setting_match_get_num_interface_names; + nm_setting_match_get_type; + nm_setting_match_remove_interface_name; + nm_setting_match_remove_interface_name_by_value; + nm_setting_sriov_add_vf; + nm_setting_sriov_clear_vfs; + nm_setting_sriov_get_autoprobe_drivers; + nm_setting_sriov_get_num_vfs; + nm_setting_sriov_get_total_vfs; + nm_setting_sriov_get_type; + nm_setting_sriov_get_vf; + nm_setting_sriov_new; + nm_setting_sriov_remove_vf; + nm_setting_sriov_remove_vf_by_index; + nm_setting_wpan_get_type; + nm_sriov_vf_add_vlan; + nm_sriov_vf_dup; + nm_sriov_vf_equal; + nm_sriov_vf_get_attribute; + nm_sriov_vf_get_attribute_names; + nm_sriov_vf_get_index; + nm_sriov_vf_get_type; + nm_sriov_vf_get_vlan_ids; + nm_sriov_vf_get_vlan_protocol; + nm_sriov_vf_get_vlan_qos; + nm_sriov_vf_new; + nm_sriov_vf_ref; + nm_sriov_vf_remove_vlan; + nm_sriov_vf_set_attribute; + nm_sriov_vf_set_vlan_protocol; + nm_sriov_vf_set_vlan_qos; + nm_sriov_vf_unref; + nm_sriov_vf_vlan_protocol_get_type; + nm_ternary_get_type; + nm_utils_sriov_vf_from_str; + nm_utils_sriov_vf_to_str; +} libnm_1_12_0; diff --git a/libnm/meson.build b/libnm/meson.build index 76c77d0c..62e3e9d7 100644 --- a/libnm/meson.build +++ b/libnm/meson.build @@ -32,6 +32,7 @@ libnm_headers = files( 'nm-autoptr.h', 'nm-checkpoint.h', 'nm-client.h', + 'nm-device-6lowpan.h', 'nm-device-adsl.h', 'nm-device-bond.h', 'nm-device-bridge.h', @@ -56,6 +57,8 @@ libnm_headers = files( 'nm-device-vxlan.h', 'nm-device-wifi.h', 'nm-device-wimax.h', + 'nm-device-wireguard.h', + 'nm-device-wpan.h', 'nm-dhcp-config.h', 'nm-ip-config.h', 'nm-object.h', @@ -93,6 +96,7 @@ libnm_sources = files( 'nm-checkpoint.c', 'nm-client.c', 'nm-dbus-helpers.c', + 'nm-device-6lowpan.c', 'nm-device-adsl.c', 'nm-device-bond.c', 'nm-device-bridge.c', @@ -117,6 +121,8 @@ libnm_sources = files( 'nm-device-vxlan.c', 'nm-device-wifi.c', 'nm-device-wimax.c', + 'nm-device-wireguard.c', + 'nm-device-wpan.c', 'nm-dhcp-config.c', 'nm-dhcp4-config.c', 'nm-dhcp6-config.c', @@ -182,10 +188,10 @@ pkg.generate( ] ) -run_target( +test( 'check-local-exports-' + libnm_name, - command: [check_exports, libnm.full_path(), linker_script], - depends: libnm + check_exports, + args: [libnm.full_path(), linker_script], ) if enable_introspection diff --git a/libnm/nm-access-point.c b/libnm/nm-access-point.c index 75ea5570..1cac12f9 100644 --- a/libnm/nm-access-point.c +++ b/libnm/nm-access-point.c @@ -48,7 +48,7 @@ typedef struct { NM80211Mode mode; guint32 max_bitrate; guint8 strength; - gint last_seen; + int last_seen; } NMAccessPointPrivate; enum { @@ -233,14 +233,14 @@ nm_access_point_get_strength (NMAccessPoint *ap) * * Since: 1.2 **/ -gint +int nm_access_point_get_last_seen (NMAccessPoint *ap) { g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), -1); return NM_ACCESS_POINT_GET_PRIVATE (ap)->last_seen; } -NM_BACKPORT_SYMBOL (libnm_1_0_6, gint, nm_access_point_get_last_seen, (NMAccessPoint *ap), (ap)); +NM_BACKPORT_SYMBOL (libnm_1_0_6, int, nm_access_point_get_last_seen, (NMAccessPoint *ap), (ap)); /** * nm_access_point_connection_valid: diff --git a/libnm/nm-access-point.h b/libnm/nm-access-point.h index 177b6a9a..dccf2fe5 100644 --- a/libnm/nm-access-point.h +++ b/libnm/nm-access-point.h @@ -77,7 +77,7 @@ NM80211Mode nm_access_point_get_mode (NMAccessPoint *ap); guint32 nm_access_point_get_max_bitrate (NMAccessPoint *ap); guint8 nm_access_point_get_strength (NMAccessPoint *ap); NM_AVAILABLE_IN_1_2 -gint nm_access_point_get_last_seen (NMAccessPoint *ap); +int nm_access_point_get_last_seen (NMAccessPoint *ap); GPtrArray * nm_access_point_filter_connections (NMAccessPoint *ap, const GPtrArray *connections); diff --git a/libnm/nm-autoptr.h b/libnm/nm-autoptr.h index 6b2fd015..e96a03a0 100644 --- a/libnm/nm-autoptr.h +++ b/libnm/nm-autoptr.h @@ -37,6 +37,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMClient, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMConnection, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSetting, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSetting6Lowpan, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSetting8021x, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingAdsl, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingBluetooth, g_object_unref) @@ -47,6 +48,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingCdma, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingConnection, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingDcb, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingDummy, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingEthtool, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingGeneric, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingGsm, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingInfiniband, g_object_unref) @@ -56,6 +58,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingIPConfig, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingIPTunnel, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingMacsec, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingMacvlan, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingMatch, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingOlpcMesh, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingOvsBridge, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingOvsInterface, g_object_unref) @@ -65,6 +68,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingPpp, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingPppoe, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingProxy, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingSerial, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingSriov, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingTCConfig, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingTeam, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingTeamPort, g_object_unref) @@ -77,8 +81,12 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingWimax, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingWired, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingWireless, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingWirelessSecurity, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMSettingWpan, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMVpnEditor, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMVpnEditorPlugin, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMVpnPluginInfo, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (NMVpnServicePlugin, g_object_unref) #endif diff --git a/libnm/nm-client.c b/libnm/nm-client.c index 18d3e318..96db30c7 100644 --- a/libnm/nm-client.c +++ b/libnm/nm-client.c @@ -16,7 +16,7 @@ * Boston, MA 02110-1301 USA. * * Copyright 2007 - 2008 Novell, Inc. - * Copyright 2007 - 2014 Red Hat, Inc. + * Copyright 2007 - 2018 Red Hat, Inc. */ #include "nm-default.h" @@ -51,6 +51,7 @@ #include "nm-access-point.h" #include "nm-active-connection.h" #include "nm-checkpoint.h" +#include "nm-device-6lowpan.h" #include "nm-device-adsl.h" #include "nm-device-bond.h" #include "nm-device-bridge.h" @@ -74,6 +75,8 @@ #include "nm-device-vxlan.h" #include "nm-device-wifi.h" #include "nm-device-wimax.h" +#include "nm-device-wireguard.h" +#include "nm-device-wpan.h" #include "nm-dhcp4-config.h" #include "nm-dhcp6-config.h" #include "nm-dhcp-config.h" @@ -2463,8 +2466,8 @@ nm_client_checkpoint_adjust_rollback_timeout_finish (NMClient *client, static GType proxy_type (GDBusObjectManagerClient *manager, - const gchar *object_path, - const gchar *interface_name, + const char *object_path, + const char *interface_name, gpointer user_data) { /* ObjectManager asks us for an object proxy. Unfortunatelly, we can't @@ -2523,6 +2526,8 @@ obj_nm_for_gdbus_object (NMClient *self, GDBusObject *object, GDBusObjectManager type = NM_TYPE_ACCESS_POINT; else if (strcmp (ifname, NM_DBUS_INTERFACE_ACTIVE_CONNECTION) == 0 && type != NM_TYPE_VPN_CONNECTION) type = NM_TYPE_ACTIVE_CONNECTION; + else if (strcmp (ifname, NM_DBUS_INTERFACE_DEVICE_6LOWPAN) == 0) + type = NM_TYPE_DEVICE_6LOWPAN; else if (strcmp (ifname, NM_DBUS_INTERFACE_DEVICE_ADSL) == 0) type = NM_TYPE_DEVICE_ADSL; else if (strcmp (ifname, NM_DBUS_INTERFACE_DEVICE_BOND) == 0) @@ -2563,12 +2568,16 @@ obj_nm_for_gdbus_object (NMClient *self, GDBusObject *object, GDBusObjectManager type = NM_TYPE_DEVICE_TUN; else if (strcmp (ifname, NM_DBUS_INTERFACE_DEVICE_VLAN) == 0) type = NM_TYPE_DEVICE_VLAN; + else if (strcmp (ifname, NM_DBUS_INTERFACE_DEVICE_WPAN) == 0) + type = NM_TYPE_DEVICE_WPAN; else if (strcmp (ifname, NM_DBUS_INTERFACE_DEVICE_VXLAN) == 0) type = NM_TYPE_DEVICE_VXLAN; else if (strcmp (ifname, NM_DBUS_INTERFACE_DEVICE_WIRELESS) == 0) type = NM_TYPE_DEVICE_WIFI; else if (strcmp (ifname, NM_DBUS_INTERFACE_DEVICE_WIMAX) == 0) type = NM_TYPE_DEVICE_WIMAX; + else if (strcmp (ifname, NM_DBUS_INTERFACE_DEVICE_WIREGUARD) == 0) + type = NM_TYPE_DEVICE_WIREGUARD; else if (strcmp (ifname, NM_DBUS_INTERFACE_DHCP4_CONFIG) == 0) type = NM_TYPE_DHCP4_CONFIG; else if (strcmp (ifname, NM_DBUS_INTERFACE_DHCP6_CONFIG) == 0) @@ -3792,4 +3801,4 @@ NM_BACKPORT_SYMBOL (libnm_1_0_6, gboolean, nm_utils_enum_from_str, (GType type, const char *str, int *out_value, char **err_token), (type, str, out_value, err_token)); -NM_BACKPORT_SYMBOL (libnm_1_2_4, gint, nm_setting_ip_config_get_dns_priority, (NMSettingIPConfig *setting), (setting)); +NM_BACKPORT_SYMBOL (libnm_1_2_4, int, nm_setting_ip_config_get_dns_priority, (NMSettingIPConfig *setting), (setting)); diff --git a/libnm/nm-dbus-helpers.c b/libnm/nm-dbus-helpers.c index 90818a14..33c68191 100644 --- a/libnm/nm-dbus-helpers.c +++ b/libnm/nm-dbus-helpers.c @@ -115,7 +115,7 @@ _nm_dbus_proxy_replace_match (GDBusProxy *proxy) { GDBusConnection *connection = g_dbus_proxy_get_connection (proxy); static unsigned match_counter = 1024; - gchar *match; + char *match; if (match_counter == 1) { /* If we hit the low matches watermark, install a diff --git a/libnm/nm-device-6lowpan.c b/libnm/nm-device-6lowpan.c new file mode 100644 index 00000000..9a305d26 --- /dev/null +++ b/libnm/nm-device-6lowpan.c @@ -0,0 +1,193 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2018 Red Hat, Inc. + */ + +#include "nm-default.h" + +#include "nm-device-6lowpan.h" +#include "nm-object-private.h" + +typedef struct { + NMDevice *parent; + char *hw_address; +} NMDevice6LowpanPrivate; + +/** + * NMDevice6Lowpan: + */ +struct _NMDevice6Lowpan { + NMDevice parent; +}; + +typedef struct { + NMDeviceClass parent; + + /*< private >*/ + gpointer padding[4]; +} NMDevice6LowpanClass; + +G_DEFINE_TYPE (NMDevice6Lowpan, nm_device_6lowpan, NM_TYPE_DEVICE) + +#define NM_DEVICE_6LOWPAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_6LOWPAN, NMDevice6LowpanPrivate)) + +NM_GOBJECT_PROPERTIES_DEFINE_BASE ( + PROP_PARENT, + PROP_HW_ADDRESS, +); + +/** + * nm_device_6lowpan_get_parent: + * @device: a #NMDevice6Lowpan + * + * Returns: (transfer none): the device's parent device + * + * Since: 1.14 + **/ +NMDevice * +nm_device_6lowpan_get_parent (NMDevice6Lowpan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_6LOWPAN (device), NULL); + + return NM_DEVICE_6LOWPAN_GET_PRIVATE (device)->parent; +} + +/** + * nm_device_6lowpan_get_hw_address: + * @device: a #NMDevice6Lowpan + * + * Gets the hardware (MAC) address of the #NMDevice6Lowpan + * + * Returns: the hardware address. This is the internal string used by the + * device, and must not be modified. + * + * Since: 1.14 + **/ +const char * +nm_device_6lowpan_get_hw_address (NMDevice6Lowpan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_6LOWPAN (device), NULL); + + return NM_DEVICE_6LOWPAN_GET_PRIVATE (device)->hw_address; +} + +static const char * +get_hw_address (NMDevice *device) +{ + return nm_device_6lowpan_get_hw_address (NM_DEVICE_6LOWPAN (device)); +} + +/***********************************************************/ + +static void +nm_device_6lowpan_init (NMDevice6Lowpan *device) +{ +} + +static void +init_dbus (NMObject *object) +{ + NMDevice6LowpanPrivate *priv = NM_DEVICE_6LOWPAN_GET_PRIVATE (object); + const NMPropertiesInfo property_info[] = { + { NM_DEVICE_6LOWPAN_PARENT, &priv->parent, NULL, NM_TYPE_DEVICE }, + { NM_DEVICE_6LOWPAN_HW_ADDRESS, &priv->hw_address }, + { NULL }, + }; + + NM_OBJECT_CLASS (nm_device_6lowpan_parent_class)->init_dbus (object); + + _nm_object_register_properties (object, + NM_DBUS_INTERFACE_DEVICE_6LOWPAN, + property_info); +} + +static void +finalize (GObject *object) +{ + NMDevice6LowpanPrivate *priv = NM_DEVICE_6LOWPAN_GET_PRIVATE (object); + + g_free (priv->hw_address); + g_clear_object (&priv->parent); + + G_OBJECT_CLASS (nm_device_6lowpan_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDevice6Lowpan *device = NM_DEVICE_6LOWPAN (object); + + switch (prop_id) { + case PROP_PARENT: + g_value_set_object (value, nm_device_6lowpan_get_parent (device)); + break; + case PROP_HW_ADDRESS: + g_value_set_string (value, nm_device_6lowpan_get_hw_address (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_6lowpan_class_init (NMDevice6LowpanClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMObjectClass *nm_object_class = NM_OBJECT_CLASS (klass); + NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); + + g_type_class_add_private (klass, sizeof (NMDevice6LowpanPrivate)); + + object_class->finalize = finalize; + object_class->get_property = get_property; + + nm_object_class->init_dbus = init_dbus; + + device_class->get_hw_address = get_hw_address; + + /** + * NMDevice6Lowpan:parent: + * + * The devices's parent device. + * + * Since: 1.14 + **/ + obj_properties[PROP_PARENT] = + g_param_spec_object (NM_DEVICE_6LOWPAN_PARENT, "", "", + NM_TYPE_DEVICE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS); + + /** + * NMDevice6Lowpan:hw-address: + * + * The hardware (MAC) address of the device. + * + * Since: 1.14 + **/ + obj_properties[PROP_HW_ADDRESS] = + g_param_spec_string (NM_DEVICE_6LOWPAN_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties); +} diff --git a/libnm/nm-device-6lowpan.h b/libnm/nm-device-6lowpan.h new file mode 100644 index 00000000..96f34dc3 --- /dev/null +++ b/libnm/nm-device-6lowpan.h @@ -0,0 +1,50 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2018 Red Hat, Inc. + */ + +#ifndef __NM_DEVICE_6LOWPAN_H__ +#define __NM_DEVICE_6LOWPAN_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_6LOWPAN (nm_device_6lowpan_get_type ()) +#define NM_DEVICE_6LOWPAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_6LOWPAN, NMDevice6Lowpan)) +#define NM_DEVICE_6LOWPAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_6LOWPAN, NMDevice6LowpanClass)) +#define NM_IS_DEVICE_6LOWPAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_6LOWPAN)) +#define NM_IS_DEVICE_6LOWPAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_6LOWPAN)) +#define NM_DEVICE_6LOWPAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_6LOWPAN, NMDevice6LowpanClass)) + +#define NM_DEVICE_6LOWPAN_PARENT "parent" +#define NM_DEVICE_6LOWPAN_HW_ADDRESS "hw-address" + +NM_AVAILABLE_IN_1_14 +GType nm_device_6lowpan_get_type (void); + +NM_AVAILABLE_IN_1_14 +NMDevice * nm_device_6lowpan_get_parent (NMDevice6Lowpan *device); +NM_AVAILABLE_IN_1_14 +const char * nm_device_6lowpan_get_hw_address (NMDevice6Lowpan *device); +G_END_DECLS + +#endif /* __NM_DEVICE_6LOWPAN_H__ */ diff --git a/libnm/nm-device-ovs-bridge.c b/libnm/nm-device-ovs-bridge.c index 7b1c5f47..27ee97cf 100644 --- a/libnm/nm-device-ovs-bridge.c +++ b/libnm/nm-device-ovs-bridge.c @@ -61,7 +61,7 @@ G_DEFINE_TYPE (NMDeviceOvsBridge, nm_device_ovs_bridge, NM_TYPE_DEVICE) * #NMDevices that are slaves of @device. This is the internal * copy used by the device, and must not be modified. * - * Since: 1.12.2 + * Since: 1.14 **/ const GPtrArray * nm_device_ovs_bridge_get_slaves (NMDeviceOvsBridge *device) diff --git a/libnm/nm-device-ovs-bridge.h b/libnm/nm-device-ovs-bridge.h index 38f6fa87..13d542a3 100644 --- a/libnm/nm-device-ovs-bridge.h +++ b/libnm/nm-device-ovs-bridge.h @@ -42,7 +42,7 @@ typedef struct _NMDeviceOvsBridgeClass NMDeviceOvsBridgeClass; NM_AVAILABLE_IN_1_10 GType nm_device_ovs_bridge_get_type (void); -NM_AVAILABLE_IN_1_12_2 +NM_AVAILABLE_IN_1_14 const GPtrArray *nm_device_ovs_bridge_get_slaves (NMDeviceOvsBridge *device); G_END_DECLS diff --git a/libnm/nm-device-ovs-port.c b/libnm/nm-device-ovs-port.c index ab33163a..8be5549a 100644 --- a/libnm/nm-device-ovs-port.c +++ b/libnm/nm-device-ovs-port.c @@ -61,7 +61,7 @@ G_DEFINE_TYPE (NMDeviceOvsPort, nm_device_ovs_port, NM_TYPE_DEVICE) * #NMDevices that are slaves of @device. This is the internal * copy used by the device, and must not be modified. * - * Since: 1.12.2 + * Since: 1.14 **/ const GPtrArray * nm_device_ovs_port_get_slaves (NMDeviceOvsPort *device) diff --git a/libnm/nm-device-ovs-port.h b/libnm/nm-device-ovs-port.h index 56a84cb9..088e3692 100644 --- a/libnm/nm-device-ovs-port.h +++ b/libnm/nm-device-ovs-port.h @@ -42,7 +42,7 @@ typedef struct _NMDeviceOvsPortClass NMDeviceOvsPortClass; NM_AVAILABLE_IN_1_10 GType nm_device_ovs_port_get_type (void); -NM_AVAILABLE_IN_1_12_2 +NM_AVAILABLE_IN_1_14 const GPtrArray *nm_device_ovs_port_get_slaves (NMDeviceOvsPort *device); G_END_DECLS diff --git a/libnm/nm-device-wimax.c b/libnm/nm-device-wimax.c index 7134024f..08624594 100644 --- a/libnm/nm-device-wimax.c +++ b/libnm/nm-device-wimax.c @@ -45,9 +45,9 @@ typedef struct { GPtrArray *nsps; guint center_freq; - gint rssi; - gint cinr; - gint tx_power; + int rssi; + int cinr; + int tx_power; char *bsid; } NMDeviceWimaxPrivate; @@ -235,7 +235,7 @@ nm_device_wimax_get_center_frequency (NMDeviceWimax *self) * * Deprecated: 1.2: WiMAX is no longer supported. **/ -gint +int nm_device_wimax_get_rssi (NMDeviceWimax *self) { g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0); @@ -255,7 +255,7 @@ nm_device_wimax_get_rssi (NMDeviceWimax *self) * * Deprecated: 1.2: WiMAX is no longer supported. **/ -gint +int nm_device_wimax_get_cinr (NMDeviceWimax *self) { g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0); @@ -275,7 +275,7 @@ nm_device_wimax_get_cinr (NMDeviceWimax *self) * * Deprecated: 1.2: WiMAX is no longer supported. **/ -gint +int nm_device_wimax_get_tx_power (NMDeviceWimax *self) { g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0); diff --git a/libnm/nm-device-wimax.h b/libnm/nm-device-wimax.h index cc3fc6e1..3b50ac6b 100644 --- a/libnm/nm-device-wimax.h +++ b/libnm/nm-device-wimax.h @@ -81,11 +81,11 @@ const GPtrArray *nm_device_wimax_get_nsps (NMDeviceWimax *wimax); NM_DEPRECATED_IN_1_2 guint nm_device_wimax_get_center_frequency (NMDeviceWimax *self); NM_DEPRECATED_IN_1_2 -gint nm_device_wimax_get_rssi (NMDeviceWimax *self); +int nm_device_wimax_get_rssi (NMDeviceWimax *self); NM_DEPRECATED_IN_1_2 -gint nm_device_wimax_get_cinr (NMDeviceWimax *self); +int nm_device_wimax_get_cinr (NMDeviceWimax *self); NM_DEPRECATED_IN_1_2 -gint nm_device_wimax_get_tx_power (NMDeviceWimax *self); +int nm_device_wimax_get_tx_power (NMDeviceWimax *self); NM_DEPRECATED_IN_1_2 const char * nm_device_wimax_get_bsid (NMDeviceWimax *self); diff --git a/libnm/nm-device-wireguard.c b/libnm/nm-device-wireguard.c new file mode 100644 index 00000000..8a76ff44 --- /dev/null +++ b/libnm/nm-device-wireguard.c @@ -0,0 +1,220 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2018 Javier Arteaga + */ + +#include "nm-default.h" + +#include "nm-device-wireguard.h" +#include "nm-object-private.h" + +typedef struct { + GBytes *public_key; + guint listen_port; + guint fwmark; +} NMDeviceWireGuardPrivate; + +/** + * NMDeviceWireGuard: + */ +struct _NMDeviceWireGuard { + NMDevice parent; +}; + +struct _NMDeviceWireGuardClass { + NMDeviceClass parent; +}; + +G_DEFINE_TYPE (NMDeviceWireGuard, nm_device_wireguard, NM_TYPE_DEVICE) + +#define NM_DEVICE_WIREGUARD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_WIREGUARD, NMDeviceWireGuardPrivate)) + +NM_GOBJECT_PROPERTIES_DEFINE_BASE ( + PROP_PUBLIC_KEY, + PROP_LISTEN_PORT, + PROP_FWMARK, +); + +/** + * nm_device_wireguard_get_public_key: + * @device: a #NMDeviceWireGuard + * + * Gets the public key for this interface + * + * Returns: (transfer none): the #GBytes containing the 32-byte public key + * + * Since: 1.14 + **/ +GBytes * +nm_device_wireguard_get_public_key (NMDeviceWireGuard *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_WIREGUARD (device), NULL); + + return NM_DEVICE_WIREGUARD_GET_PRIVATE (device)->public_key; +} + +/** + * nm_device_wireguard_get_listen_port: + * @device: a #NMDeviceWireGuard + * + * Gets the local UDP port this interface listens on + * + * Returns: UDP listen port + * + * Since: 1.14 + **/ +guint16 +nm_device_wireguard_get_listen_port (NMDeviceWireGuard *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_WIREGUARD (device), 0); + + return NM_DEVICE_WIREGUARD_GET_PRIVATE (device)->listen_port; +} + +/** + * nm_device_wireguard_get_fwmark: + * @device: a #NMDeviceWireGuard + * + * Gets the fwmark (firewall mark) for this interface. + * It can be used to set routing policy for outgoing encrypted packets. + * See: ip-rule(8) + * + * Returns: 0 if fwmark not in use, 32-bit fwmark value otherwise + * + * Since: 1.14 + **/ +guint32 +nm_device_wireguard_get_fwmark (NMDeviceWireGuard *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_WIREGUARD (device), 0); + + return NM_DEVICE_WIREGUARD_GET_PRIVATE (device)->fwmark; +} + +/***********************************************************/ + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDeviceWireGuard *device = NM_DEVICE_WIREGUARD (object); + + switch (prop_id) { + case PROP_PUBLIC_KEY: + g_value_set_boxed (value, nm_device_wireguard_get_public_key (device)); + break; + case PROP_LISTEN_PORT: + g_value_set_uint (value, nm_device_wireguard_get_listen_port (device)); + break; + case PROP_FWMARK: + g_value_set_uint (value, nm_device_wireguard_get_fwmark (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_wireguard_init (NMDeviceWireGuard *device) +{ +} + +static void +init_dbus (NMObject *object) +{ + NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE (object); + const NMPropertiesInfo property_info[] = { + { NM_DEVICE_WIREGUARD_PUBLIC_KEY, &priv->public_key }, + { NM_DEVICE_WIREGUARD_LISTEN_PORT, &priv->listen_port }, + { NM_DEVICE_WIREGUARD_FWMARK, &priv->fwmark }, + { NULL } + }; + + NM_OBJECT_CLASS (nm_device_wireguard_parent_class)->init_dbus (object); + + _nm_object_register_properties (object, + NM_DBUS_INTERFACE_DEVICE_WIREGUARD, + property_info); +} + +static void +finalize (GObject *object) +{ + NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE (object); + + g_bytes_unref (priv->public_key); + + G_OBJECT_CLASS (nm_device_wireguard_parent_class)->finalize (object); +} + +static void +nm_device_wireguard_class_init (NMDeviceWireGuardClass *wireguard_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (wireguard_class); + NMObjectClass *nm_object_class = NM_OBJECT_CLASS (wireguard_class); + + g_type_class_add_private (wireguard_class, sizeof (NMDeviceWireGuardPrivate)); + + object_class->get_property = get_property; + object_class->finalize = finalize; + + nm_object_class->init_dbus = init_dbus; + + /** + * NMDeviceWireGuard:public-key: + * + * 32-byte public key, derived from the current private key. + * + * Since: 1.14 + **/ + obj_properties[PROP_PUBLIC_KEY] = + g_param_spec_boxed (NM_DEVICE_WIREGUARD_PUBLIC_KEY, "", "", + G_TYPE_BYTES, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + + /** + * NMDeviceWireGuard:listen-port: + * + * Local UDP listen port. + * Set to 0 to allow a random port to be chosen (default). + * + * Since: 1.14 + **/ + obj_properties[PROP_LISTEN_PORT] = + g_param_spec_uint (NM_DEVICE_WIREGUARD_LISTEN_PORT, "", "", + 0, G_MAXUINT16, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + + /** + * NMDeviceWireGuard:fwmark: + * + * Optional firewall mark - see ip-rule(8). + * Used when setting routing policy for outgoing encrypted packets. + * Set to 0 to disable the mark (default). + * + * Since: 1.14 + **/ + obj_properties[PROP_FWMARK] = + g_param_spec_uint (NM_DEVICE_WIREGUARD_FWMARK, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties); +} diff --git a/libnm/nm-device-wireguard.h b/libnm/nm-device-wireguard.h new file mode 100644 index 00000000..37e97a0a --- /dev/null +++ b/libnm/nm-device-wireguard.h @@ -0,0 +1,56 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2018 Javier Arteaga + */ + +#ifndef __NM_DEVICE_WIREGUARD_H__ +#define __NM_DEVICE_WIREGUARD_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_WIREGUARD (nm_device_wireguard_get_type ()) +#define NM_DEVICE_WIREGUARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_WIREGUARD, NMDeviceWireGuard)) +#define NM_DEVICE_WIREGUARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_WIREGUARD, NMDeviceWireGuardClass)) +#define NM_IS_DEVICE_WIREGUARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_WIREGUARD)) +#define NM_IS_DEVICE_WIREGUARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_WIREGUARD)) +#define NM_DEVICE_WIREGUARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WIREGUARD, NMDeviceWireGuardClass)) + +typedef struct _NMDeviceWireGuardClass NMDeviceWireGuardClass; + +#define NM_DEVICE_WIREGUARD_PUBLIC_KEY "public-key" +#define NM_DEVICE_WIREGUARD_LISTEN_PORT "listen-port" +#define NM_DEVICE_WIREGUARD_FWMARK "fwmark" + +NM_AVAILABLE_IN_1_14 +GType nm_device_wireguard_get_type (void); + +NM_AVAILABLE_IN_1_14 +GBytes* nm_device_wireguard_get_public_key (NMDeviceWireGuard *device); +NM_AVAILABLE_IN_1_14 +guint16 nm_device_wireguard_get_listen_port (NMDeviceWireGuard *device); +NM_AVAILABLE_IN_1_14 +guint32 nm_device_wireguard_get_fwmark (NMDeviceWireGuard *device); + +G_END_DECLS + +#endif /* __NM_DEVICE_WIREGUARD_H__ */ diff --git a/libnm/nm-device-wpan.c b/libnm/nm-device-wpan.c new file mode 100644 index 00000000..61183623 --- /dev/null +++ b/libnm/nm-device-wpan.c @@ -0,0 +1,179 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2018 Lubomir Rintel + */ + +#include "nm-default.h" + +#include + +#include "nm-device-wpan.h" +#include "nm-object-private.h" +#include "nm-setting-wpan.h" +#include "nm-setting-connection.h" + +enum { + PROP_0, + PROP_HW_ADDRESS, + + LAST_PROP +}; + +typedef struct { + char *hw_address; +} NMDeviceWpanPrivate; + +/** + * NMDeviceWpan: + */ +struct _NMDeviceWpan { + NMDevice parent; +}; + +typedef struct { + NMDeviceClass parent; +} NMDeviceWpanClass; + +G_DEFINE_TYPE (NMDeviceWpan, nm_device_wpan, NM_TYPE_DEVICE) + +#define NM_DEVICE_WPAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_WPAN, NMDeviceWpanPrivate)) + +/*****************************************************************************/ + +/** + * nm_device_wpan_get_hw_address: + * @device: a #NMDeviceWpan + * + * Gets the active hardware (MAC) address of the #NMDeviceWpan + * + * Returns: the active hardware address. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_wpan_get_hw_address (NMDeviceWpan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_WPAN (device), NULL); + + return nm_str_not_empty (NM_DEVICE_WPAN_GET_PRIVATE (device)->hw_address); +} + +static gboolean +connection_compatible (NMDevice *device, NMConnection *connection, GError **error) +{ + if (!NM_DEVICE_CLASS (nm_device_wpan_parent_class)->connection_compatible (device, connection, error)) + return FALSE; + + if (!nm_connection_is_type (connection, NM_SETTING_WPAN_SETTING_NAME)) { + g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("The connection was not a wpan connection.")); + return FALSE; + } + + return TRUE; +} + +static GType +get_setting_type (NMDevice *device) +{ + return NM_TYPE_SETTING_WPAN; +} + +static const char * +get_hw_address (NMDevice *device) +{ + return nm_device_wpan_get_hw_address (NM_DEVICE_WPAN (device)); +} + +/*****************************************************************************/ + +static void +get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +{ + switch (prop_id) { + case PROP_HW_ADDRESS: + g_value_set_string (value, nm_device_wpan_get_hw_address (NM_DEVICE_WPAN (object))); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_wpan_init (NMDeviceWpan *device) +{ +} + +static void +init_dbus (NMObject *object) +{ + NMDeviceWpanPrivate *priv = NM_DEVICE_WPAN_GET_PRIVATE (object); + const NMPropertiesInfo property_info[] = { + { NM_DEVICE_WPAN_HW_ADDRESS, &priv->hw_address }, + { NULL }, + }; + + NM_OBJECT_CLASS (nm_device_wpan_parent_class)->init_dbus (object); + + _nm_object_register_properties (object, + NM_DBUS_INTERFACE_DEVICE_WPAN, + property_info); +} + +static void +finalize (GObject *object) +{ + NMDeviceWpanPrivate *priv = NM_DEVICE_WPAN_GET_PRIVATE (object); + + g_free (priv->hw_address); + + G_OBJECT_CLASS (nm_device_wpan_parent_class)->finalize (object); +} + +static void +nm_device_wpan_class_init (NMDeviceWpanClass *wpan_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (wpan_class); + NMObjectClass *nm_object_class = NM_OBJECT_CLASS (wpan_class); + NMDeviceClass *device_class = NM_DEVICE_CLASS (wpan_class); + + g_type_class_add_private (wpan_class, sizeof (NMDeviceWpanPrivate)); + + /* virtual methods */ + object_class->finalize = finalize; + object_class->get_property = get_property; + + nm_object_class->init_dbus = init_dbus; + + device_class->connection_compatible = connection_compatible; + device_class->get_setting_type = get_setting_type; + device_class->get_hw_address = get_hw_address; + + /* properties */ + + /** + * NMDeviceWpan:hw-address: + * + * The active hardware (MAC) address of the device. + **/ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_WPAN_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); +} diff --git a/libnm/nm-device-wpan.h b/libnm/nm-device-wpan.h new file mode 100644 index 00000000..d20113dd --- /dev/null +++ b/libnm/nm-device-wpan.h @@ -0,0 +1,48 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2018 Lubomir Rintel + */ + +#ifndef __NM_DEVICE_WPAN_H__ +#define __NM_DEVICE_WPAN_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_WPAN (nm_device_wpan_get_type ()) +#define NM_DEVICE_WPAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_WPAN, NMDeviceWpan)) +#define NM_DEVICE_WPAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_WPAN, NMDeviceWpanClass)) +#define NM_IS_DEVICE_WPAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_WPAN)) +#define NM_IS_DEVICE_WPAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_WPAN)) +#define NM_DEVICE_WPAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WPAN, NMDeviceWpanClass)) + +#define NM_DEVICE_WPAN_HW_ADDRESS "hw-address" + +NM_AVAILABLE_IN_1_14 +GType nm_device_wpan_get_type (void); + +NM_AVAILABLE_IN_1_14 +const char *nm_device_wpan_get_hw_address (NMDeviceWpan *device); + +G_END_DECLS + +#endif /* __NM_DEVICE_WPAN_H__ */ diff --git a/libnm/nm-device.c b/libnm/nm-device.c index d841ca37..aa45c4ad 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -16,7 +16,7 @@ * Boston, MA 02110-1301 USA. * * Copyright 2007 - 2008 Novell, Inc. - * Copyright 2007 - 2012 Red Hat, Inc. + * Copyright 2007 - 2018 Red Hat, Inc. */ #include "nm-default.h" @@ -284,6 +284,9 @@ coerce_type (NMDeviceType type) case NM_DEVICE_TYPE_UNKNOWN: case NM_DEVICE_TYPE_DUMMY: case NM_DEVICE_TYPE_PPP: + case NM_DEVICE_TYPE_WPAN: + case NM_DEVICE_TYPE_6LOWPAN: + case NM_DEVICE_TYPE_WIREGUARD: return type; } return NM_DEVICE_TYPE_UNKNOWN; @@ -1345,6 +1348,12 @@ get_type_name (NMDevice *device) return _("Dummy"); case NM_DEVICE_TYPE_PPP: return _("PPP"); + case NM_DEVICE_TYPE_WPAN: + return _("IEEE 802.15.4"); + case NM_DEVICE_TYPE_6LOWPAN: + return _("6LoWPAN"); + case NM_DEVICE_TYPE_WIREGUARD: + return _("WireGuard"); case NM_DEVICE_TYPE_GENERIC: case NM_DEVICE_TYPE_UNUSED1: case NM_DEVICE_TYPE_UNUSED2: diff --git a/libnm/nm-dns-manager.c b/libnm/nm-dns-manager.c index b833d0c6..37117b72 100644 --- a/libnm/nm-dns-manager.c +++ b/libnm/nm-dns-manager.c @@ -277,7 +277,7 @@ demarshal_dns_configuration (NMObject *object, GParamSpec *pspec, GVariant *valu char **nameservers = NULL, **domains = NULL; gboolean vpn = FALSE; char *interface = NULL, *str; - gint priority; + int priority; if ( !g_variant_lookup (entry_var, "nameservers", "as", &iterp) || !g_variant_lookup (entry_var, "priority", "i", &priority)) { diff --git a/libnm/nm-ip-config.c b/libnm/nm-ip-config.c index d1a69f38..c1e888be 100644 --- a/libnm/nm-ip-config.c +++ b/libnm/nm-ip-config.c @@ -173,9 +173,11 @@ init_dbus (NMObject *object) { "address-data", &priv->addresses, demarshal_ip_address_data }, { NM_IP_CONFIG_ROUTES, &priv->routes, demarshal_ip_routes }, { "route-data", &priv->routes, demarshal_ip_route_data }, + /* Still use deprecated "Nameservers" property instead of "NameserverData" */ { NM_IP_CONFIG_NAMESERVERS, &priv->nameservers, demarshal_ip_array }, { NM_IP_CONFIG_DOMAINS, &priv->domains, }, { NM_IP_CONFIG_SEARCHES, &priv->searches, }, + /* Still use deprecated "WinsServers" property instead of "WinsServerData" */ { NM_IP_CONFIG_WINS_SERVERS, &priv->wins, demarshal_ip_array }, { NULL }, }; diff --git a/libnm/nm-object.c b/libnm/nm-object.c index da2fbb79..70f90b63 100644 --- a/libnm/nm-object.c +++ b/libnm/nm-object.c @@ -197,7 +197,7 @@ deferred_notify_cb (gpointer data) c_list_for_each (iter, &props) { NotifyItem *item = c_list_entry (iter, NotifyItem, lst); char buf[50]; - gint ret = 0; + int ret = 0; switch (item->pending) { case NOTIFY_SIGNAL_PENDING_ADDED: @@ -844,16 +844,12 @@ demarshal_generic (NMObject *object, g_free (newval); } else if (pspec->value_type == G_TYPE_BYTES) { GBytes **param = (GBytes **)field; - gconstpointer val, old_val = NULL; - gsize length, old_length = 0; + gconstpointer val; + gsize length = 0; val = g_variant_get_fixed_array (value, &length, 1); - if (*param) - old_val = g_bytes_get_data (*param, &old_length); - different = old_length != length - || ( length > 0 - && memcmp (old_val, val, length) != 0); + different = !nm_utils_gbytes_equal_mem (*param, val, length); if (different) { if (*param) g_bytes_unref (*param); @@ -893,10 +889,10 @@ demarshal_generic (NMObject *object, HANDLE_TYPE (G_VARIANT_TYPE_BYTE, guchar, g_variant_get_byte); else if (pspec->value_type == G_TYPE_DOUBLE) { NM_PRAGMA_WARNING_DISABLE("-Wfloat-equal") - HANDLE_TYPE (G_VARIANT_TYPE_DOUBLE, gdouble, g_variant_get_double); + HANDLE_TYPE (G_VARIANT_TYPE_DOUBLE, double, g_variant_get_double); NM_PRAGMA_WARNING_REENABLE } else if (pspec->value_type == G_TYPE_INT) - HANDLE_TYPE (G_VARIANT_TYPE_INT32, gint, g_variant_get_int32); + HANDLE_TYPE (G_VARIANT_TYPE_INT32, int, g_variant_get_int32); else if (pspec->value_type == G_TYPE_UINT) HANDLE_TYPE (G_VARIANT_TYPE_UINT32, guint, g_variant_get_uint32); else if (pspec->value_type == G_TYPE_INT64) @@ -904,7 +900,7 @@ demarshal_generic (NMObject *object, else if (pspec->value_type == G_TYPE_UINT64) HANDLE_TYPE (G_VARIANT_TYPE_UINT64, guint64, g_variant_get_uint64); else if (pspec->value_type == G_TYPE_LONG) - HANDLE_TYPE (G_VARIANT_TYPE_INT64, glong, g_variant_get_int64); + HANDLE_TYPE (G_VARIANT_TYPE_INT64, long, g_variant_get_int64); else if (pspec->value_type == G_TYPE_ULONG) HANDLE_TYPE (G_VARIANT_TYPE_UINT64, gulong, g_variant_get_uint64); else { @@ -1037,10 +1033,10 @@ init_dbus (NMObject *object) static void init_if (GDBusProxy *proxy, NMObject *self) { - gchar **props; + char **props; char **prop; GVariant *val; - gchar *str; + char *str; nm_assert (G_IS_DBUS_PROXY (proxy)); nm_assert (NM_IS_OBJECT (self)); @@ -1292,7 +1288,7 @@ nm_object_class_init (NMObjectClass *nm_object_class) /* Properties */ /** - * NMObject:path: (skip) + * NMObject:path: * * The D-Bus object path. **/ diff --git a/libnm/nm-property-docs.xml b/libnm/nm-property-docs.xml index 78d62e87..22aed0ea 100644 --- a/libnm/nm-property-docs.xml +++ b/libnm/nm-property-docs.xml @@ -13,10 +13,11 @@ + - + - + @@ -27,6 +28,9 @@ + + + @@ -41,7 +45,6 @@ - @@ -76,7 +79,6 @@ - @@ -86,11 +88,9 @@ - - @@ -101,19 +101,16 @@ - - - @@ -127,28 +124,26 @@ - - + - + - + - + - + + - - @@ -162,7 +157,6 @@ - @@ -183,8 +177,7 @@ - - + @@ -207,8 +200,7 @@ - - + @@ -223,7 +215,6 @@ - @@ -237,7 +228,6 @@ - @@ -245,30 +235,28 @@ - + + + - - - - @@ -276,7 +264,6 @@ - @@ -288,7 +275,6 @@ - @@ -302,7 +288,6 @@ - @@ -312,21 +297,23 @@ - - - - - + + + + + + + @@ -334,7 +321,6 @@ - @@ -353,7 +339,6 @@ - @@ -362,26 +347,22 @@ - - - - @@ -397,7 +378,6 @@ - @@ -409,7 +389,6 @@ - @@ -420,7 +399,6 @@ - @@ -435,13 +413,12 @@ - + - @@ -457,7 +434,6 @@ - @@ -472,4 +448,9 @@ + + + + + diff --git a/libnm/nm-settings-docs-overrides.xml b/libnm/nm-settings-docs-overrides.xml index f85b834c..276253c6 100644 --- a/libnm/nm-settings-docs-overrides.xml +++ b/libnm/nm-settings-docs-overrides.xml @@ -3,7 +3,9 @@ ]> - + + + @@ -29,6 +31,8 @@ bridge's interface name."/> + + @@ -112,6 +116,8 @@ also exist on some routes."/> + + @@ -132,6 +138,8 @@ also exist on some routes."/> + + @@ -186,4 +194,6 @@ only exists in D-Bus API. libnm and nmcli continue to call this property present in the connection dictionary, for compatibility with very old NetworkManager daemons."/> + + \ No newline at end of file diff --git a/libnm/nm-settings-docs.xml b/libnm/nm-settings-docs.xml index ab70aa7b..258d3558 100644 --- a/libnm/nm-settings-docs.xml +++ b/libnm/nm-settings-docs.xml @@ -13,10 +13,11 @@ + - + - + @@ -27,6 +28,9 @@ + + + @@ -41,7 +45,6 @@ - @@ -76,7 +79,6 @@ - @@ -86,12 +88,10 @@ - - @@ -103,19 +103,16 @@ - - - @@ -129,28 +126,26 @@ - - + - + - + - + - + + - - @@ -164,7 +159,6 @@ - @@ -186,8 +180,7 @@ - - + @@ -212,8 +205,7 @@ - - + @@ -229,7 +221,6 @@ - @@ -243,7 +234,6 @@ - @@ -251,30 +241,28 @@ - + + + - - - - @@ -282,7 +270,6 @@ - @@ -294,7 +281,6 @@ - @@ -308,7 +294,6 @@ - @@ -318,21 +303,23 @@ - - - - - + + + + + + + @@ -341,7 +328,6 @@ - @@ -360,7 +346,6 @@ - @@ -369,14 +354,12 @@ - - @@ -384,12 +367,10 @@ - - @@ -405,7 +386,6 @@ - @@ -417,7 +397,6 @@ - @@ -429,7 +408,6 @@ - @@ -445,13 +423,12 @@ - + - @@ -468,7 +445,6 @@ - @@ -483,4 +459,9 @@ + + + + + diff --git a/libnm/nm-settings-ifcfg-rh-docs.xml b/libnm/nm-settings-ifcfg-rh-docs.xml index bf041ab2..11f3115d 100644 --- a/libnm/nm-settings-ifcfg-rh-docs.xml +++ b/libnm/nm-settings-ifcfg-rh-docs.xml @@ -3,7 +3,9 @@ ]> - + + + @@ -89,6 +91,8 @@ specified users is logged into an active session."/> higher numbers are preferred when selecting profiles for automatic activation."/> + - + + @@ -134,6 +139,8 @@ The sum of the numbers must be 100."/> + + @@ -181,7 +188,7 @@ If zero, the default value will be used (50 for VPNs, 100 for other connections) A negative value prevents DNS from other connections with greater values to be used."/> - @@ -193,7 +200,7 @@ DHCP_FQDN are specified only the latter is used."/> ignore ~ IPV6INIT=no; auto ~ IPV6_AUTOCONF=yes; dhcp ~ IPV6_AUTOCONF=no and DHCPV6C=yes"/> - + @@ -226,6 +233,8 @@ each octet is separated by a colon is also accepted."/> + + @@ -249,9 +258,14 @@ proxy configuration, or set the PAC file via PAC_URL or PAC_SCRIPT."/> + + + + + - - + + @@ -370,4 +384,6 @@ is listed."/> + + \ No newline at end of file diff --git a/libnm/nm-settings-keyfile-docs.xml b/libnm/nm-settings-keyfile-docs.xml index 561b0588..09b119a2 100644 --- a/libnm/nm-settings-keyfile-docs.xml +++ b/libnm/nm-settings-keyfile-docs.xml @@ -3,7 +3,9 @@ ]> - + + + @@ -26,6 +28,8 @@ or semicolon separated list of 6 decimal bytes (obsolete)"/> + + @@ -53,6 +57,8 @@ route2=7.7.0.0/16" description="List of IP routes."/> + + @@ -74,6 +80,8 @@ route2=7.7.0.0/16" description="List of IP routes."/> versions of NetworkManager stored this as an integer: 69 ('E') for even, 111 ('o') for odd, or 110 ('n') for none."/> + + @@ -117,4 +125,8 @@ under [vpn-secrets] section."/> (e.g. 0;34;104;18;121;178)."/> + + + \ No newline at end of file diff --git a/libnm/nm-types.h b/libnm/nm-types.h index dff8cb90..bb77e642 100644 --- a/libnm/nm-types.h +++ b/libnm/nm-types.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright 2014 Red Hat, Inc. + * Copyright 2014 - 2018 Red Hat, Inc. */ #ifndef __NM_TYPES_H__ @@ -31,6 +31,7 @@ typedef struct _NMActiveConnection NMActiveConnection; typedef struct _NMCheckpoint NMCheckpoint; typedef struct _NMClient NMClient; typedef struct _NMDevice NMDevice; +typedef struct _NMDevice6Lowpan NMDevice6Lowpan; typedef struct _NMDeviceAdsl NMDeviceAdsl; typedef struct _NMDeviceBond NMDeviceBond; typedef struct _NMDeviceBridge NMDeviceBridge; @@ -54,6 +55,8 @@ typedef struct _NMDeviceVlan NMDeviceVlan; typedef struct _NMDeviceVxlan NMDeviceVxlan; typedef struct _NMDeviceWifi NMDeviceWifi; typedef struct _NMDeviceWimax NMDeviceWimax; +typedef struct _NMDeviceWireGuard NMDeviceWireGuard; +typedef struct _NMDeviceWpan NMDeviceWpan; typedef struct _NMDhcpConfig NMDhcpConfig; typedef struct _NMIPConfig NMIPConfig; typedef struct _NMObject NMObject; diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c index da4c2446..2213824e 100644 --- a/libnm/nm-vpn-service-plugin.c +++ b/libnm/nm-vpn-service-plugin.c @@ -27,6 +27,7 @@ #include #include +#include "nm-utils/nm-secret-utils.h" #include "nm-enum-types.h" #include "nm-utils.h" #include "nm-connection.h" @@ -385,6 +386,10 @@ nm_vpn_service_plugin_set_config (NMVpnServicePlugin *plugin, g_signal_emit (plugin, signals[CONFIG], 0, config); if (priv->dbus_vpn_service_plugin) nmdbus_vpn_plugin_emit_config (priv->dbus_vpn_service_plugin, config); + + if ( priv->has_ip4 == priv->got_ip4 + && priv->has_ip6 == priv->got_ip6) + nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STARTED); } void @@ -478,10 +483,10 @@ connect_timer_start (NMVpnServicePlugin *plugin) static void peer_vanished (GDBusConnection *connection, - const gchar *sender_name, - const gchar *object_path, - const gchar *interface_name, - const gchar *signal_name, + const char *sender_name, + const char *object_path, + const char *interface_name, + const char *signal_name, GVariant *parameters, gpointer user_data) { @@ -493,7 +498,7 @@ watch_peer (NMVpnServicePlugin *plugin, GDBusMethodInvocation *context) { GDBusConnection *connection = g_dbus_method_invocation_get_connection (context); - const gchar *peer = g_dbus_message_get_sender (g_dbus_method_invocation_get_message (context)); + const char *peer = g_dbus_message_get_sender (g_dbus_method_invocation_get_message (context)); return g_dbus_connection_signal_subscribe (connection, "org.freedesktop.DBus", @@ -784,7 +789,7 @@ nm_vpn_service_plugin_read_vpn_details (int fd, gboolean success = FALSE; char *key = NULL, *val = NULL; nm_auto_free_gstring GString *line = NULL; - gchar c; + char c; if (out_data) g_return_val_if_fail (*out_data == NULL, FALSE); diff --git a/libnm/tests/meson.build b/libnm/tests/meson.build index e2b88273..27fafb77 100644 --- a/libnm/tests/meson.build +++ b/libnm/tests/meson.build @@ -8,7 +8,7 @@ test_units = [ cflags = [ '-DNETWORKMANAGER_COMPILATION_TEST', '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM', -] + nm_build_cflags +] foreach test_unit: test_units exe = executable( diff --git a/libnm/tests/test-secret-agent.c b/libnm/tests/test-secret-agent.c index 746a9e64..53110be6 100644 --- a/libnm/tests/test-secret-agent.c +++ b/libnm/tests/test-secret-agent.c @@ -111,8 +111,8 @@ done: static void test_secret_agent_cancel_get_secrets (NMSecretAgentOld *agent, - const gchar *connection_path, - const gchar *setting_name) + const char *connection_path, + const char *setting_name) { g_assert_not_reached (); } @@ -120,7 +120,7 @@ test_secret_agent_cancel_get_secrets (NMSecretAgentOld *agent, static void test_secret_agent_save_secrets (NMSecretAgentOld *agent, NMConnection *connection, - const gchar *connection_path, + const char *connection_path, NMSecretAgentOldSaveSecretsFunc callback, gpointer callback_data) { @@ -130,7 +130,7 @@ test_secret_agent_save_secrets (NMSecretAgentOld *agent, static void test_secret_agent_delete_secrets (NMSecretAgentOld *agent, NMConnection *connection, - const gchar *connection_path, + const char *connection_path, NMSecretAgentOldDeleteSecretsFunc callback, gpointer callback_data) { -- cgit 1.3.0-6-gf8a5 From 3626b425d1bc017fdc6f1ea0cfd329d1e1681641 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Wed, 24 Oct 2018 21:01:12 +0200 Subject: New upstream version 1.14.4 --- libnm/libnm.ver | 5 +++++ libnm/nm-client.c | 4 ++++ libnm/tests/meson.build | 9 +++++---- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'libnm') diff --git a/libnm/libnm.ver b/libnm/libnm.ver index 476cfcc9..1f76dc0f 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -1332,6 +1332,11 @@ global: nm_utils_tc_tfilter_to_str; } libnm_1_10_0; +libnm_1_10_14 { + #nm_setting_connection_get_mdns@libnm_1_10_14; + #nm_setting_connection_mdns_get_type@libnm_1_10_14; +} libnm_1_10_2; + libnm_1_12_0 { global: nm_checkpoint_create_flags_get_type; diff --git a/libnm/nm-client.c b/libnm/nm-client.c index 96db30c7..1da22540 100644 --- a/libnm/nm-client.c +++ b/libnm/nm-client.c @@ -3802,3 +3802,7 @@ NM_BACKPORT_SYMBOL (libnm_1_0_6, gboolean, nm_utils_enum_from_str, (type, str, out_value, err_token)); NM_BACKPORT_SYMBOL (libnm_1_2_4, int, nm_setting_ip_config_get_dns_priority, (NMSettingIPConfig *setting), (setting)); + +NM_BACKPORT_SYMBOL (libnm_1_10_14, NMSettingConnectionMdns, nm_setting_connection_get_mdns, + (NMSettingConnection *setting), (setting)); +NM_BACKPORT_SYMBOL (libnm_1_10_14, GType, nm_setting_connection_mdns_get_type, (void), ()); diff --git a/libnm/tests/meson.build b/libnm/tests/meson.build index 27fafb77..ae2f7124 100644 --- a/libnm/tests/meson.build +++ b/libnm/tests/meson.build @@ -1,8 +1,8 @@ test_units = [ - ['test-general', [libnm_utils, libnm_core]], - ['test-nm-client', []], - ['test-remote-settings-client', []], - ['test-secret-agent', []], + ['test-general', [libnm_utils, libnm_core], 30], + ['test-nm-client', [], 90], + ['test-remote-settings-client', [], 90], + ['test-secret-agent', [], 90], ] cflags = [ @@ -28,6 +28,7 @@ foreach test_unit: test_units test( 'libnm/' + test_unit[0], test_script, + timeout: test_unit[2], args: test_args + [exe.full_path()] ) endforeach -- cgit 1.3.0-6-gf8a5