diff options
| author | Michael Biebl <biebl@debian.org> | 2012-03-24 01:37:02 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2012-03-24 01:37:02 +0100 |
| commit | de06e5715e780baade318f3490ac7a4c9ce84e32 (patch) | |
| tree | 23fbc3fafc12072476eff98bee60100eb54c29db /libnm-util/nm-setting.c | |
| parent | b436a68a20ff3114ded32a7a3d70cdd4954039f9 (diff) | |
Imported Upstream version 0.9.4.0 upstream/0.9.4.0
Diffstat (limited to 'libnm-util/nm-setting.c')
| -rw-r--r-- | libnm-util/nm-setting.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index 2b3bdc58..21dab0ba 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -60,27 +60,6 @@ nm_setting_error_quark (void) return quark; } -/* This should really be standard. */ -#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } - -GType -nm_setting_error_get_type (void) -{ - static GType etype = 0; - - if (etype == 0) { - static const GEnumValue values[] = { - ENUM_ENTRY (NM_SETTING_ERROR_UNKNOWN, "UnknownError"), - ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_NOT_FOUND, "PropertyNotFound"), - ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_NOT_SECRET, "PropertyNotSecret"), - ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH, "PropertyTypeMismatch"), - { 0, 0, 0 } - }; - etype = g_enum_register_static ("NMSettingError", values); - } - return etype; -} - G_DEFINE_ABSTRACT_TYPE (NMSetting, nm_setting, G_TYPE_OBJECT) #define NM_SETTING_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING, NMSettingPrivate)) @@ -992,6 +971,27 @@ nm_setting_to_string (NMSetting *setting) return g_string_free (string, FALSE); } +/** + * nm_setting_get_virtual_iface_name: + * @setting: the #NMSetting + * + * Returns the name of the virtual kernel interface which the connection + * needs to use if specified in the settings. + * + * Returns: Name of the virtual interface or %NULL if the setting does not + * support this feature + **/ +const char * +nm_setting_get_virtual_iface_name (NMSetting *setting) +{ + g_return_val_if_fail (NM_IS_SETTING (setting), NULL); + + if (NM_SETTING_GET_CLASS (setting)->get_virtual_iface_name) + return NM_SETTING_GET_CLASS (setting)->get_virtual_iface_name (setting); + + return NULL; +} + /*****************************************************************************/ static void |