diff options
author | Thomas Haller <thaller@redhat.com> | 2018-09-14 16:01:45 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-09-14 16:29:31 +0200 |
commit | a10156f5165f644e344fa5163a5958080a2a7393 (patch) | |
tree | 1797e1820a34b4a62f756fdc4bbf4c8ff5f4245f /libnm-core | |
parent | 6ebb9091d272c7af4e1eaab4a110f7de37fb2b4d (diff) |
libnm: drop API nm_connection_get_setting_{6lowpan,sriov,wpan}()
Note that NMSettingEthtool and NMSettingMatch don't have such
functions either.
We have API
nm_connection_get_setting (NMConnection *, GType)
nm_connection_get_setting_by_name (NMConnection *, const char *)
which can be used generically, meaning: the requested setting type
is an argument to the function. That is generally more useful and
flexible.
Don't add API which duplicates existing functionality and is (arguably)
inferiour. Drop it now. This is an ABI/API break for the current development
cycle where the 1.14.0 API is still unstable. Indeed it's already after
1.14-rc1, which is ugly. But it's also unlikely that somebody already uses
this API/ABI and is badly impacted by this change.
Note that nm_connection_get_setting() and nm_connection_get_setting_by_name()
are slightly inconvenient in C still, because they usually require a cast.
We should fix that by changing the return type to "void *". Such
a change may be possibly any time without breaking API/ABI (almost, it'd
be an API change when taking a function pointer without casting).
Diffstat (limited to 'libnm-core')
-rw-r--r-- | libnm-core/nm-connection.c | 50 | ||||
-rw-r--r-- | libnm-core/nm-connection.h | 6 |
2 files changed, 1 insertions, 55 deletions
diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index a5df08142..172f9c99e 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 312760f15..af91b1183 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,8 +229,6 @@ 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); NMSettingTun * nm_connection_get_setting_tun (NMConnection *connection); @@ -245,8 +241,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 |