summary refs log tree commit diff
path: root/libnm-core
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-core')
-rw-r--r--libnm-core/meson.build1
-rw-r--r--libnm-core/nm-connection.c50
-rw-r--r--libnm-core/nm-connection.h7
-rw-r--r--libnm-core/nm-setting-ethtool.h1
-rw-r--r--libnm-core/nm-utils.c22
5 files changed, 16 insertions, 65 deletions
diff --git a/libnm-core/meson.build b/libnm-core/meson.build
index eb6fcce9..ac13a1be 100644
--- a/libnm-core/meson.build
+++ b/libnm-core/meson.build
@@ -16,6 +16,7 @@ libnm_core_headers = files(
   'nm-setting-connection.h',
   'nm-setting-dcb.h',
   'nm-setting-dummy.h',
+  'nm-setting-ethtool.h',
   'nm-setting-generic.h',
   'nm-setting-gsm.h',
   'nm-setting-infiniband.h',
diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c
index a5df0814..172f9c99 100644
--- a/libnm-core/nm-connection.c
+++ b/libnm-core/nm-connection.c
@@ -1216,7 +1216,7 @@ _normalize_sriov_vf_order (NMConnection *self, GHashTable *parameters)
 {
 	NMSettingSriov *s_sriov;
 
-	s_sriov = nm_connection_get_setting_sriov (self);
+	s_sriov = NM_SETTING_SRIOV (nm_connection_get_setting (self, NM_TYPE_SETTING_SRIOV));
 	if (!s_sriov)
 		return FALSE;
 
@@ -2279,22 +2279,6 @@ nm_connection_get_virtual_device_description (NMConnection *connection)
 /*****************************************************************************/
 
 /**
- * nm_connection_get_setting_6lowpan:
- * @connection: the #NMConnection
- *
- * A shortcut to return any #NMSetting6Lowpan the connection might contain.
- *
- * Returns: (transfer none): an #NMSetting6Lowpan if the connection contains one, otherwise %NULL
- *
- * Since: 1.14
- **/
-NMSetting6Lowpan *
-nm_connection_get_setting_6lowpan (NMConnection *connection)
-{
-	return _connection_get_setting_check (connection, NM_TYPE_SETTING_6LOWPAN);
-}
-
-/**
  * nm_connection_get_setting_802_1x:
  * @connection: the #NMConnection
  *
@@ -2701,22 +2685,6 @@ nm_connection_get_setting_serial (NMConnection *connection)
 }
 
 /**
- * nm_connection_get_setting_sriov:
- * @connection: the #NMConnection
- *
- * A shortcut to return any #NMSettingSriov the connection might contain.
- *
- * Returns: (transfer none): an #NMSettingSriov if the connection contains one, otherwise %NULL
- *
- * Since: 1.14
- **/
-NMSettingSriov *
-nm_connection_get_setting_sriov (NMConnection *connection)
-{
-	return _connection_get_setting_check (connection, NM_TYPE_SETTING_SRIOV);
-}
-
-/**
  * nm_connection_get_setting_tc_config:
  * @connection: the #NMConnection
  *
@@ -2876,22 +2844,6 @@ nm_connection_get_setting_vlan (NMConnection *connection)
 	return _connection_get_setting_check (connection, NM_TYPE_SETTING_VLAN);
 }
 
-/**
- * nm_connection_get_setting_wpan:
- * @connection: the #NMConnection
- *
- * A shortcut to return any #NMSettingWpan the connection might contain.
- *
- * Returns: (transfer none): an #NMSettingWpan if the connection contains one, otherwise %NULL
- *
- * Since: 1.14
- **/
-NMSettingWpan *
-nm_connection_get_setting_wpan (NMConnection *connection)
-{
-	return _connection_get_setting_check (connection, NM_TYPE_SETTING_WPAN);
-}
-
 NMSettingBluetooth *
 _nm_connection_get_setting_bluetooth_for_nap (NMConnection *connection)
 {
diff --git a/libnm-core/nm-connection.h b/libnm-core/nm-connection.h
index 312760f1..802f68ba 100644
--- a/libnm-core/nm-connection.h
+++ b/libnm-core/nm-connection.h
@@ -193,8 +193,6 @@ const char *  nm_connection_get_connection_type (NMConnection *connection);
 gboolean      nm_connection_is_virtual          (NMConnection *connection);
 char *        nm_connection_get_virtual_device_description (NMConnection *connection);
 
-NM_AVAILABLE_IN_1_14
-NMSetting6Lowpan *         nm_connection_get_setting_6lowpan           (NMConnection *connection);
 NMSetting8021x *           nm_connection_get_setting_802_1x            (NMConnection *connection);
 NMSettingBluetooth *       nm_connection_get_setting_bluetooth         (NMConnection *connection);
 NMSettingBond *            nm_connection_get_setting_bond              (NMConnection *connection);
@@ -231,10 +229,9 @@ NMSettingPppoe *           nm_connection_get_setting_pppoe             (NMConnec
 NM_AVAILABLE_IN_1_6
 NMSettingProxy *           nm_connection_get_setting_proxy             (NMConnection *connection);
 NMSettingSerial *          nm_connection_get_setting_serial            (NMConnection *connection);
-NM_AVAILABLE_IN_1_14
-NMSettingSriov *           nm_connection_get_setting_sriov             (NMConnection *connection);
 NM_AVAILABLE_IN_1_12
 NMSettingTCConfig *        nm_connection_get_setting_tc_config         (NMConnection *connection);
+NM_AVAILABLE_IN_1_2
 NMSettingTun *             nm_connection_get_setting_tun               (NMConnection *connection);
 NMSettingVpn *             nm_connection_get_setting_vpn               (NMConnection *connection);
 NMSettingWimax *           nm_connection_get_setting_wimax             (NMConnection *connection);
@@ -245,8 +242,6 @@ NMSettingWirelessSecurity *nm_connection_get_setting_wireless_security (NMConnec
 NMSettingVlan *            nm_connection_get_setting_vlan              (NMConnection *connection);
 NM_AVAILABLE_IN_1_2
 NMSettingVxlan *           nm_connection_get_setting_vxlan             (NMConnection *connection);
-NM_AVAILABLE_IN_1_14
-NMSettingWpan *            nm_connection_get_setting_wpan              (NMConnection *connection);
 
 G_END_DECLS
 
diff --git a/libnm-core/nm-setting-ethtool.h b/libnm-core/nm-setting-ethtool.h
index 6a0458a5..66a94489 100644
--- a/libnm-core/nm-setting-ethtool.h
+++ b/libnm-core/nm-setting-ethtool.h
@@ -84,6 +84,7 @@ G_BEGIN_DECLS
 #define NM_ETHTOOL_OPTNAME_FEATURE_TX_UDP_TNL_SEGMENTATION      "feature-tx-udp_tnl-segmentation"
 #define NM_ETHTOOL_OPTNAME_FEATURE_TX_VLAN_STAG_HW_INSERT       "feature-tx-vlan-stag-hw-insert"
 
+NM_AVAILABLE_IN_1_14
 gboolean nm_ethtool_optname_is_feature (const char *optname);
 
 /*****************************************************************************/
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index 47ec7a4e..f6e1555e 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -431,7 +431,7 @@ nm_utils_escape_ssid (const guint8 *ssid, gsize len)
 char *
 _nm_utils_ssid_to_string_arr (const guint8 *ssid, gsize len)
 {
-	char *s_copy;
+	gs_free char *s_copy = NULL;
 	const char *s_cnst;
 
 	if (len == 0)
@@ -2141,10 +2141,10 @@ _tc_read_common_opts (const char *str,
 	gs_unref_hashtable GHashTable *ht = NULL;
 	GVariant *variant;
 
-        ht = nm_utils_parse_variant_attributes (str,
-                                                ' ', ' ', FALSE,
-                                                tc_object_attribute_spec,
-                                                error);
+	ht = nm_utils_parse_variant_attributes (str,
+	                                        ' ', ' ', FALSE,
+	                                        tc_object_attribute_spec,
+	                                        error);
 	if (!ht)
 		return FALSE;
 
@@ -2504,10 +2504,10 @@ nm_utils_tc_tfilter_from_str (const char *str, GError **error)
 		return NULL;
 
 	if (rest) {
-	        ht = nm_utils_parse_variant_attributes (rest,
-	                                                ' ', ' ', FALSE,
-	                                                tc_tfilter_attribute_spec,
-	                                                error);
+		ht = nm_utils_parse_variant_attributes (rest,
+		                                        ' ', ' ', FALSE,
+		                                        tc_tfilter_attribute_spec,
+		                                        error);
 		if (!ht)
 			return NULL;
 
@@ -6035,7 +6035,9 @@ attribute_unescape (const char *start, const char *end)
  * Parse attributes from a string.
  *
  * Returns: (transfer full) (element-type utf8 GVariant): a #GHashTable mapping
- * attribute names to #GVariant values.
+ * attribute names to #GVariant values. Warning: the variant are still floating
+ * references, owned by the hash table. If you take a reference, ensure to sink
+ * the one of the hash table first.
  *
  * Since: 1.8
  */