diff options
author | Dan Winship <danw@gnome.org> | 2014-07-29 18:25:10 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2014-09-04 09:17:37 -0400 |
commit | 002b19f4f1110e90dac87f0c8876044b4ae57994 (patch) | |
tree | cf06ebff065b1f4a05630b03c077497e49f2ffe7 /libnm-core/nm-setting-private.h | |
parent | 504c292d7389e68e926a428cc5083359a6ba2e0b (diff) | |
download | NetworkManager-002b19f4f1110e90dac87f0c8876044b4ae57994.tar.gz |
libnm-core: add dbus-only properties to NMSettingClass
Add _nm_setting_class_add_dbus_only_property(), for declaring
properties that appear in the D-Bus serialization, but which don't
correspond to GObject properties.
Since some property overrides will require examining settings other
than the setting that they are on (eg, the value of
802-11-wireless.security depends on whether an
NMSettingWirelessSecurity setting is present, and
NMSettingConnection:interface-name might sometimes be set from, eg,
bond.interface-name), we also update _nm_setting_to_dbus() to take the
full NMConnection as an argument, and _nm_setting_new_from_dbus() to
take the full connection hash.
Additionally, with some deprecated properties, we'll want to validate
them on construction, but we don't need to keep the value around after
that. So allow _nm_setting_new_from_dbus() to return a verification
error directly, so we don't need to store the value until the verify()
call.
Diffstat (limited to 'libnm-core/nm-setting-private.h')
-rw-r--r-- | libnm-core/nm-setting-private.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libnm-core/nm-setting-private.h b/libnm-core/nm-setting-private.h index de9628e7b1..05a3ae3afe 100644 --- a/libnm-core/nm-setting-private.h +++ b/libnm-core/nm-setting-private.h @@ -116,9 +116,28 @@ gboolean _nm_setting_slave_type_is_valid (const char *slave_type, const char **o const char * _nm_setting_slave_type_detect_from_settings (GSList *all_settings, NMSetting **out_s_port); GHashTable *_nm_setting_to_dbus (NMSetting *setting, + NMConnection *connection, NMConnectionSerializationFlags flags); NMSetting *_nm_setting_new_from_dbus (GType setting_type, - GHashTable *hash); + GHashTable *setting_hash, + GHashTable *connection_hash, + GError **error); + +typedef gboolean (*NMSettingPropertyGetFunc) (NMSetting *setting, + NMConnection *connection, + const char *property, + GValue *value); +typedef gboolean (*NMSettingPropertySetFunc) (NMSetting *setting, + GHashTable *connection_hash, + const char *property, + const GValue *value, + GError **error); + +void _nm_setting_class_add_dbus_only_property (NMSettingClass *setting_class, + const char *property_name, + GType dbus_type, + NMSettingPropertyGetFunc get_func, + NMSettingPropertySetFunc set_func); #endif /* NM_SETTING_PRIVATE_H */ |