diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-04-14 14:31:42 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-04-20 10:04:15 +0200 |
commit | 4c398ab03f70c9ba8b0fddccff4735053bd3df78 (patch) | |
tree | 9789ae24364dbea9e2c8769815ff78b17403d184 /libnm | |
parent | fc6373bea918f359ebece75e500773c50f5375c7 (diff) | |
download | NetworkManager-4c398ab03f70c9ba8b0fddccff4735053bd3df78.tar.gz |
libnm: add nm-plugin-missing property indicating NM device plugin not available
Diffstat (limited to 'libnm')
-rw-r--r-- | libnm/libnm.ver | 1 | ||||
-rw-r--r-- | libnm/nm-device.c | 39 | ||||
-rw-r--r-- | libnm/nm-device.h | 3 |
3 files changed, 43 insertions, 0 deletions
diff --git a/libnm/libnm.ver b/libnm/libnm.ver index 44b83f6ecb..0b7bacc27e 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -847,6 +847,7 @@ local: libnm_1_2_0 { global: + nm_device_get_nm_plugin_missing; nm_setting_802_1x_check_cert_scheme; nm_setting_bridge_get_multicast_snooping; nm_setting_wireless_get_powersave; diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 96322e6392..48d0f42b50 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -84,6 +84,7 @@ typedef struct { NMDeviceCapabilities capabilities; gboolean managed; gboolean firmware_missing; + gboolean nm_plugin_missing; gboolean autoconnect; NMIPConfig *ip4_config; NMDhcpConfig *dhcp4_config; @@ -116,6 +117,7 @@ enum { PROP_MANAGED, PROP_AUTOCONNECT, PROP_FIRMWARE_MISSING, + PROP_NM_PLUGIN_MISSING, PROP_IP4_CONFIG, PROP_DHCP4_CONFIG, PROP_IP6_CONFIG, @@ -183,6 +185,7 @@ init_dbus (NMObject *object) { NM_DEVICE_MANAGED, &priv->managed }, { NM_DEVICE_AUTOCONNECT, &priv->autoconnect }, { NM_DEVICE_FIRMWARE_MISSING, &priv->firmware_missing }, + { NM_DEVICE_NM_PLUGIN_MISSING, &priv->nm_plugin_missing }, { NM_DEVICE_IP4_CONFIG, &priv->ip4_config, NULL, NM_TYPE_IP4_CONFIG }, { NM_DEVICE_DHCP4_CONFIG, &priv->dhcp4_config, NULL, NM_TYPE_DHCP4_CONFIG }, { NM_DEVICE_IP6_CONFIG, &priv->ip6_config, NULL, NM_TYPE_IP6_CONFIG }, @@ -413,6 +416,9 @@ get_property (GObject *object, case PROP_FIRMWARE_MISSING: g_value_set_boolean (value, nm_device_get_firmware_missing (device)); break; + case PROP_NM_PLUGIN_MISSING: + g_value_set_boolean (value, nm_device_get_nm_plugin_missing (device)); + break; case PROP_IP4_CONFIG: g_value_set_object (value, nm_device_get_ip4_config (device)); break; @@ -646,6 +652,21 @@ nm_device_class_init (NMDeviceClass *device_class) G_PARAM_STATIC_STRINGS)); /** + * NMDevice:nm-plugin-missing: + * + * When %TRUE indicates that the NetworkManager plugin for the device + * is not installed. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_NM_PLUGIN_MISSING, + g_param_spec_boolean (NM_DEVICE_NM_PLUGIN_MISSING, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** * NMDevice:ip4-config: * * The #NMIP4Config of the device. @@ -1105,6 +1126,24 @@ nm_device_get_firmware_missing (NMDevice *device) } /** + * nm_device_get_nm_plugin_missing: + * @device: a #NMDevice + * + * Indicates that the NetworkManager plugin for the device is not installed. + * + * Returns: %TRUE if the device plugin not installed. + * + * Since: 1.2 + **/ +gboolean +nm_device_get_nm_plugin_missing (NMDevice *device) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + + return NM_DEVICE_GET_PRIVATE (device)->nm_plugin_missing; +} + +/** * nm_device_get_ip4_config: * @device: a #NMDevice * diff --git a/libnm/nm-device.h b/libnm/nm-device.h index 5cc3735695..91cf13b1a0 100644 --- a/libnm/nm-device.h +++ b/libnm/nm-device.h @@ -48,6 +48,7 @@ G_BEGIN_DECLS #define NM_DEVICE_MANAGED "managed" #define NM_DEVICE_AUTOCONNECT "autoconnect" #define NM_DEVICE_FIRMWARE_MISSING "firmware-missing" +#define NM_DEVICE_NM_PLUGIN_MISSING "nm-plugin-missing" #define NM_DEVICE_IP4_CONFIG "ip4-config" #define NM_DEVICE_DHCP4_CONFIG "dhcp4-config" #define NM_DEVICE_IP6_CONFIG "ip6-config" @@ -104,6 +105,8 @@ gboolean nm_device_get_managed (NMDevice *device); gboolean nm_device_get_autoconnect (NMDevice *device); void nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect); gboolean nm_device_get_firmware_missing (NMDevice *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_get_nm_plugin_missing (NMDevice *device); NMIPConfig * nm_device_get_ip4_config (NMDevice *device); NMDhcpConfig * nm_device_get_dhcp4_config (NMDevice *device); NMIPConfig * nm_device_get_ip6_config (NMDevice *device); |