From 85563b7fc7ec2cd21e38debb9b28db342e2e8e7c Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sun, 21 Apr 2019 21:09:51 +0200 Subject: New upstream version 1.18.0 --- libnm/libnm.ver | 86 +++++++++++++++++++++++++++++++++++++ libnm/meson.build | 8 ++-- libnm/nm-dbus-helpers.h | 2 +- libnm/nm-device.c | 66 +++++++++++++++++++++------- libnm/nm-device.h | 8 ++-- libnm/nm-manager.c | 2 +- libnm/nm-property-docs.xml | 4 ++ libnm/nm-secret-agent-old.c | 3 +- libnm/nm-settings-docs.xml | 4 ++ libnm/nm-settings-ifcfg-rh-docs.xml | 4 ++ libnm/nm-vpn-service-plugin.c | 2 +- libnm/tests/meson.build | 4 +- 12 files changed, 163 insertions(+), 30 deletions(-) (limited to 'libnm') diff --git a/libnm/libnm.ver b/libnm/libnm.ver index ece9686e..8100f3b6 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -1518,3 +1518,89 @@ global: nm_wireguard_peer_set_public_key; nm_wireguard_peer_unref; } libnm_1_14_0; + +libnm_1_18_0 { +global: + nm_bridge_vlan_cmp; + nm_bridge_vlan_from_str; + nm_bridge_vlan_get_type; + nm_bridge_vlan_get_vid_range; + nm_bridge_vlan_is_pvid; + nm_bridge_vlan_is_sealed; + nm_bridge_vlan_is_untagged; + nm_bridge_vlan_new; + nm_bridge_vlan_new_clone; + nm_bridge_vlan_ref; + nm_bridge_vlan_seal; + nm_bridge_vlan_set_pvid; + nm_bridge_vlan_set_untagged; + nm_bridge_vlan_to_str; + nm_bridge_vlan_unref; + nm_ip_routing_rule_as_string_flags_get_type; + nm_ip_routing_rule_cmp; + nm_ip_routing_rule_from_string; + nm_ip_routing_rule_get_action; + nm_ip_routing_rule_get_addr_family; + nm_ip_routing_rule_get_destination_port_end; + nm_ip_routing_rule_get_destination_port_start; + nm_ip_routing_rule_get_from; + nm_ip_routing_rule_get_from_len; + nm_ip_routing_rule_get_fwmark; + nm_ip_routing_rule_get_fwmask; + nm_ip_routing_rule_get_iifname; + nm_ip_routing_rule_get_invert; + nm_ip_routing_rule_get_ipproto; + nm_ip_routing_rule_get_oifname; + nm_ip_routing_rule_get_priority; + nm_ip_routing_rule_get_source_port_end; + nm_ip_routing_rule_get_source_port_start; + nm_ip_routing_rule_get_table; + nm_ip_routing_rule_get_to; + nm_ip_routing_rule_get_to_len; + nm_ip_routing_rule_get_tos; + nm_ip_routing_rule_get_type; + nm_ip_routing_rule_is_sealed; + nm_ip_routing_rule_new; + nm_ip_routing_rule_new_clone; + nm_ip_routing_rule_ref; + nm_ip_routing_rule_seal; + nm_ip_routing_rule_set_action; + nm_ip_routing_rule_set_destination_port; + nm_ip_routing_rule_set_from; + nm_ip_routing_rule_set_fwmark; + nm_ip_routing_rule_set_iifname; + nm_ip_routing_rule_set_invert; + nm_ip_routing_rule_set_ipproto; + nm_ip_routing_rule_set_oifname; + nm_ip_routing_rule_set_priority; + nm_ip_routing_rule_set_source_port; + nm_ip_routing_rule_set_table; + nm_ip_routing_rule_set_to; + nm_ip_routing_rule_set_tos; + nm_ip_routing_rule_to_string; + nm_ip_routing_rule_unref; + nm_ip_routing_rule_validate; + nm_lldp_neighbor_get_attr_value; + nm_setting_bridge_add_vlan; + nm_setting_bridge_clear_vlans; + nm_setting_bridge_get_num_vlans; + nm_setting_bridge_get_vlan; + nm_setting_bridge_get_vlan_default_pvid; + nm_setting_bridge_get_vlan_filtering; + nm_setting_bridge_port_add_vlan; + nm_setting_bridge_port_clear_vlans; + nm_setting_bridge_port_get_num_vlans; + nm_setting_bridge_port_get_vlan; + nm_setting_bridge_port_remove_vlan; + nm_setting_bridge_port_remove_vlan_by_vid; + nm_setting_bridge_remove_vlan; + nm_setting_bridge_remove_vlan_by_vid; + nm_setting_ip_config_add_routing_rule; + nm_setting_ip_config_clear_routing_rules; + nm_setting_ip_config_get_num_routing_rules; + nm_setting_ip_config_get_routing_rule; + nm_setting_ip_config_remove_routing_rule; + nm_tc_qdisc_get_attribute; + nm_tc_qdisc_get_attribute_names; + nm_tc_qdisc_set_attribute; +} libnm_1_16_0; diff --git a/libnm/meson.build b/libnm/meson.build index 558a587b..4b3df97f 100644 --- a/libnm/meson.build +++ b/libnm/meson.build @@ -9,8 +9,8 @@ libnm_utils_sources = files('nm-libnm-utils.c') deps = [ libnmdbus_dep, - shared_nm_utils_base_dep, - nm_core_dep, + shared_nm_glib_aux_dep, + libnm_core_dep, ] if have_fake_typelibs @@ -158,8 +158,8 @@ libnm = shared_library( dependencies: [ dl_dep, libudev_dep, - shared_nm_utils_base_dep, - nm_core_dep, + shared_nm_glib_aux_dep, + libnm_core_dep, uuid_dep, libnm_systemd_shared_no_logging_dep, ], diff --git a/libnm/nm-dbus-helpers.h b/libnm/nm-dbus-helpers.h index 0f2cabe8..eb5394f0 100644 --- a/libnm/nm-dbus-helpers.h +++ b/libnm/nm-dbus-helpers.h @@ -25,7 +25,7 @@ #error Cannot use this header. #endif -#include "nm-dbus-compat.h" +#include "nm-std-aux/nm-dbus-compat.h" GBusType _nm_dbus_bus_type (void); diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 5965cb3b..aba4e5c4 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -40,7 +40,7 @@ #include "nm-dbus-helpers.h" #include "nm-device-tun.h" #include "nm-setting-connection.h" -#include "shared/nm-utils/nm-udev-utils.h" +#include "nm-udev-aux/nm-udev-utils.h" #include "introspection/org.freedesktop.NetworkManager.Device.h" @@ -2649,6 +2649,18 @@ nm_device_get_setting_type (NMDevice *device) return NM_DEVICE_GET_CLASS (device)->get_setting_type (device); } +/*****************************************************************************/ + +static gboolean +NM_IS_LLDP_NEIGHBOR (const NMLldpNeighbor *self) +{ + nm_assert ( !self + || ( self->refcount > 0 + && self->attrs)); + return self + && self->refcount > 0; +} + /** * nm_lldp_neighbor_new: * @@ -2675,9 +2687,15 @@ static NMLldpNeighbor * nm_lldp_neighbor_dup (NMLldpNeighbor *neighbor) { NMLldpNeighbor *copy; + GHashTableIter iter; + const char *key; + GVariant *value; copy = nm_lldp_neighbor_new (); - copy->attrs = g_hash_table_ref (neighbor->attrs); + + g_hash_table_iter_init (&iter, neighbor->attrs); + while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &value)) + g_hash_table_insert (copy->attrs, g_strdup (key), g_variant_ref (value)); return copy; } @@ -2693,8 +2711,7 @@ nm_lldp_neighbor_dup (NMLldpNeighbor *neighbor) void nm_lldp_neighbor_ref (NMLldpNeighbor *neighbor) { - g_return_if_fail (neighbor); - g_return_if_fail (neighbor->refcount > 0); + g_return_if_fail (NM_IS_LLDP_NEIGHBOR (neighbor)); neighbor->refcount++; } @@ -2711,11 +2728,9 @@ nm_lldp_neighbor_ref (NMLldpNeighbor *neighbor) void nm_lldp_neighbor_unref (NMLldpNeighbor *neighbor) { - g_return_if_fail (neighbor); - g_return_if_fail (neighbor->refcount > 0); + g_return_if_fail (NM_IS_LLDP_NEIGHBOR (neighbor)); if (--neighbor->refcount == 0) { - g_return_if_fail (neighbor->attrs); g_hash_table_unref (neighbor->attrs); g_free (neighbor); } @@ -2738,8 +2753,7 @@ nm_lldp_neighbor_get_attr_names (NMLldpNeighbor *neighbor) const char *key; GPtrArray *names; - g_return_val_if_fail (neighbor, NULL); - g_return_val_if_fail (neighbor->attrs, NULL); + g_return_val_if_fail (NM_IS_LLDP_NEIGHBOR (neighbor), NULL); names = g_ptr_array_new (); @@ -2765,12 +2779,12 @@ nm_lldp_neighbor_get_attr_names (NMLldpNeighbor *neighbor) * Since: 1.2 **/ gboolean -nm_lldp_neighbor_get_attr_string_value (NMLldpNeighbor *neighbor, char *name, +nm_lldp_neighbor_get_attr_string_value (NMLldpNeighbor *neighbor, const char *name, const char **out_value) { GVariant *variant; - g_return_val_if_fail (neighbor, FALSE); + g_return_val_if_fail (NM_IS_LLDP_NEIGHBOR (neighbor), FALSE); g_return_val_if_fail (name && name[0], FALSE); variant = g_hash_table_lookup (neighbor->attrs, name); @@ -2795,12 +2809,12 @@ nm_lldp_neighbor_get_attr_string_value (NMLldpNeighbor *neighbor, char *name, * Since: 1.2 **/ gboolean -nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, char *name, +nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, const char *name, guint *out_value) { GVariant *variant; - g_return_val_if_fail (neighbor, FALSE); + g_return_val_if_fail (NM_IS_LLDP_NEIGHBOR (neighbor), FALSE); g_return_val_if_fail (name && name[0], FALSE); variant = g_hash_table_lookup (neighbor->attrs, name); @@ -2812,6 +2826,27 @@ nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, char *name, return FALSE; } +/** + * nm_lldp_neighbor_get_attr_value: + * @neighbor: the #NMLldpNeighbor + * @name: the attribute name + * + * Gets the value (as a GVariant) of attribute with name @name on @neighbor + * + * Returns: (transfer none): the value or %NULL if the attribute with @name was + * not found. + * + * Since: 1.18 + **/ +GVariant * +nm_lldp_neighbor_get_attr_value (NMLldpNeighbor *neighbor, const char *name) +{ + g_return_val_if_fail (NM_IS_LLDP_NEIGHBOR (neighbor), FALSE); + g_return_val_if_fail (name && name[0], FALSE); + + return g_hash_table_lookup (neighbor->attrs, name); +} + /** * nm_lldp_neighbor_get_attr_type: * @neighbor: the #NMLldpNeighbor @@ -2824,11 +2859,11 @@ nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, char *name, * Since: 1.2 **/ const GVariantType * -nm_lldp_neighbor_get_attr_type (NMLldpNeighbor *neighbor, char *name) +nm_lldp_neighbor_get_attr_type (NMLldpNeighbor *neighbor, const char *name) { GVariant *variant; - g_return_val_if_fail (neighbor, NULL); + g_return_val_if_fail (NM_IS_LLDP_NEIGHBOR (neighbor), NULL); g_return_val_if_fail (name && name[0], NULL); variant = g_hash_table_lookup (neighbor->attrs, name); @@ -2836,5 +2871,4 @@ nm_lldp_neighbor_get_attr_type (NMLldpNeighbor *neighbor, char *name) return g_variant_get_type (variant); else return NULL; - } diff --git a/libnm/nm-device.h b/libnm/nm-device.h index fcda93ab..62272297 100644 --- a/libnm/nm-device.h +++ b/libnm/nm-device.h @@ -227,13 +227,15 @@ void nm_lldp_neighbor_unref (NMLldpNeighbor *neighbor); NM_AVAILABLE_IN_1_2 char **nm_lldp_neighbor_get_attr_names (NMLldpNeighbor *neighbor); NM_AVAILABLE_IN_1_2 -gboolean nm_lldp_neighbor_get_attr_string_value (NMLldpNeighbor *neighbor, char *name, +gboolean nm_lldp_neighbor_get_attr_string_value (NMLldpNeighbor *neighbor, const char *name, const char **out_value); NM_AVAILABLE_IN_1_2 -gboolean nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, char *name, +gboolean nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, const char *name, guint *out_value); NM_AVAILABLE_IN_1_2 -const GVariantType *nm_lldp_neighbor_get_attr_type (NMLldpNeighbor *neighbor, char *name); +const GVariantType *nm_lldp_neighbor_get_attr_type (NMLldpNeighbor *neighbor, const char *name); +NM_AVAILABLE_IN_1_18 +GVariant *nm_lldp_neighbor_get_attr_value (NMLldpNeighbor *neighbor, const char *name); G_END_DECLS diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c index 7a169863..509586e0 100644 --- a/libnm/nm-manager.c +++ b/libnm/nm-manager.c @@ -25,7 +25,7 @@ #include "nm-utils.h" #include "nm-checkpoint.h" -#include "nm-common-macros.h" +#include "nm-libnm-core-intern/nm-common-macros.h" #include "nm-device-ethernet.h" #include "nm-device-wifi.h" #include "nm-core-internal.h" diff --git a/libnm/nm-property-docs.xml b/libnm/nm-property-docs.xml index 6344f784..f73ff6da 100644 --- a/libnm/nm-property-docs.xml +++ b/libnm/nm-property-docs.xml @@ -103,11 +103,15 @@ + + + + diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c index 56a88b00..40485ab6 100644 --- a/libnm/nm-secret-agent-old.c +++ b/libnm/nm-secret-agent-old.c @@ -892,8 +892,7 @@ nm_secret_agent_old_get_secrets (NMSecretAgentOld *self, g_return_if_fail (NM_IS_SECRET_AGENT_OLD (self)); g_return_if_fail (NM_IS_CONNECTION (connection)); g_return_if_fail (nm_connection_get_path (connection)); - g_return_if_fail (setting_name != NULL); - g_return_if_fail (strlen (setting_name) > 0); + g_return_if_fail (setting_name && setting_name[0]); g_return_if_fail (!(flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM)); g_return_if_fail (!(flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS)); g_return_if_fail (callback != NULL); diff --git a/libnm/nm-settings-docs.xml b/libnm/nm-settings-docs.xml index ee5f3641..0f1d8c97 100644 --- a/libnm/nm-settings-docs.xml +++ b/libnm/nm-settings-docs.xml @@ -105,11 +105,15 @@ + + + + diff --git a/libnm/nm-settings-ifcfg-rh-docs.xml b/libnm/nm-settings-ifcfg-rh-docs.xml index cec2d527..ca5a8449 100644 --- a/libnm/nm-settings-ifcfg-rh-docs.xml +++ b/libnm/nm-settings-ifcfg-rh-docs.xml @@ -58,6 +58,7 @@ lookaside file, or it can be owned by a secret agent."/> + + + + diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c index a2728342..abd02f18 100644 --- a/libnm/nm-vpn-service-plugin.c +++ b/libnm/nm-vpn-service-plugin.c @@ -26,7 +26,7 @@ #include #include -#include "nm-utils/nm-secret-utils.h" +#include "nm-glib-aux/nm-secret-utils.h" #include "nm-enum-types.h" #include "nm-utils.h" #include "nm-connection.h" diff --git a/libnm/tests/meson.build b/libnm/tests/meson.build index d0a2dd30..d76b9f5f 100644 --- a/libnm/tests/meson.build +++ b/libnm/tests/meson.build @@ -19,7 +19,7 @@ foreach test_unit: test_units ], dependencies: [ libnm_dep, - nm_core_dep, + libnm_core_dep, libnm_systemd_shared_no_logging_dep, ], c_args: cflags, @@ -39,6 +39,6 @@ libnm_vpn_plugin_utils_test = static_library( 'nm-vpn-plugin-utils-test', sources: shared_nm_utils_nm_vpn_plugin_utils_c + [libnm_enum[1]], include_directories: libnm_inc, - dependencies: nm_core_dep, + dependencies: libnm_core_dep, c_args: cflags, ) -- cgit 1.3.0-6-gf8a5