libnm-core: add nm_connection_get_setting_ip_config() helper

This commit is contained in:
Thomas Haller
2019-03-02 22:17:49 +01:00
parent be107c75c9
commit 02964c22a6
2 changed files with 17 additions and 0 deletions

View File

@@ -230,6 +230,18 @@ nm_connection_get_setting (NMConnection *connection, GType setting_type)
return _connection_get_setting_check (connection, setting_type);
}
NMSettingIPConfig *
nm_connection_get_setting_ip_config (NMConnection *connection,
int addr_family)
{
nm_assert_addr_family (addr_family);
return NM_SETTING_IP_CONFIG (_connection_get_setting (connection,
(addr_family == AF_INET)
? NM_TYPE_SETTING_IP4_CONFIG
: NM_TYPE_SETTING_IP6_CONFIG));
}
/**
* nm_connection_get_setting_by_name:
* @connection: a #NMConnection

View File

@@ -449,6 +449,11 @@ gboolean _nm_utils_generate_mac_address_mask_parse (const char *value,
/*****************************************************************************/
NMSettingIPConfig *nm_connection_get_setting_ip_config (NMConnection *connection,
int addr_family);
/*****************************************************************************/
typedef enum {
NM_BOND_OPTION_TYPE_INT,
NM_BOND_OPTION_TYPE_STRING,