summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-private.h
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-11-14 11:46:19 -0500
committerDan Winship <danw@gnome.org>2014-11-15 09:52:29 -0500
commitc785a7dfcd282dcb7cc40bf61bd6767c08c0c91e (patch)
tree0da9366462b7c8331fa128c91ee9dbba9cc8cc78 /libnm-core/nm-setting-private.h
parent543416e5f624caf98d99c1c654bbdb3bb15904d3 (diff)
downloadNetworkManager-c785a7dfcd282dcb7cc40bf61bd6767c08c0c91e.tar.gz
libnm-core: change how new and legacy properties are serialized
Although libnm filters out properties received from the daemon that it doesn't understand, there may be other clients that do not. In particular, a client might call GetSettings() on a connection, update the ipv4.addresses property in the returned dictionary, and then pass the dictionary to Update(). In that case, the updated dictionary would contain ipv4.address-data, but it would not reflect the changes the client intended to make. Fix this by changing the daemon side to prefer the legacy properties to the new ones if both are set, and changing the client side to not send the legacy properties (since we don't support new clients talking to old servers anyway).
Diffstat (limited to 'libnm-core/nm-setting-private.h')
-rw-r--r--libnm-core/nm-setting-private.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-private.h b/libnm-core/nm-setting-private.h
index bb9f1d8ee1..2d34d509a5 100644
--- a/libnm-core/nm-setting-private.h
+++ b/libnm-core/nm-setting-private.h
@@ -86,6 +86,9 @@ gboolean _nm_setting_clear_secrets_with_flags (NMSetting *setting,
*/
#define NM_SETTING_PARAM_INFERRABLE (1 << (4 + G_PARAM_USER_SHIFT))
+/* This is a legacy property, which clients should not send to the daemon. */
+#define NM_SETTING_PARAM_LEGACY (1 << (5 + G_PARAM_USER_SHIFT))
+
/* Ensure the setting's GType is registered at library load time */
#define NM_SETTING_REGISTER_TYPE(x) \
static void __attribute__((constructor)) register_setting (void) \
@@ -145,6 +148,11 @@ void _nm_setting_class_transform_property (NMSettingClass *setting_class,
NMSettingPropertyTransformToFunc to_dbus,
NMSettingPropertyTransformFromFunc from_dbus);
+gboolean _nm_setting_use_legacy_property (NMSetting *setting,
+ GVariant *connection_dict,
+ const char *legacy_property,
+ const char *new_property);
+
GPtrArray *_nm_setting_need_secrets (NMSetting *setting);
#endif /* NM_SETTING_PRIVATE_H */