summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-private.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-01-09 09:08:39 +0100
committerThomas Haller <thaller@redhat.com>2019-01-11 11:48:47 +0100
commit885c872d5a542f820afdf4e8ca59c55f39467c7a (patch)
tree1982a91850189b7b13ba9c309c26236fae2b2e8f /libnm-core/nm-setting-private.h
parent5aace3dfea61b2409d6b62127853bd5ed4721bf2 (diff)
downloadNetworkManager-885c872d5a542f820afdf4e8ca59c55f39467c7a.tar.gz
libnm: rework compare_property() implementation for NMSetting
NMSetting's compare_property() has and had two callers: nm_setting_compare() and nm_setting_diff(). compare_property() accepts a NMSettingCompareFlags argument, but at the same time, both callers have another complex (and inconsistent!) set of pre-checks for shortcuting the call of compare_property(): should_compare_prop(). Merge should_compare_prop() into compare_property(). This way, nm_setting_compare() and nm_setting_diff() has less additional code, and are simpler to follow. Especially nm_setting_compare() is now trivial. And nm_setting_diff() is still complicated, but not related to the question how the property compares or whether it should be compared at all. If you want to know whether it should be compared, all you need to do now is follow NMSettingClass.compare_property(). This changes function pointer NMSettingClass.compare_property(), which is public API. However, no user can actually use this (and shall not!), because _nm_setting_class_commit_full() etc. is private API. A user outside of libnm-core cannot create his/her own subclasses of NMSetting, and never could in the past. So, this API/ABI change doesn't matter.
Diffstat (limited to 'libnm-core/nm-setting-private.h')
-rw-r--r--libnm-core/nm-setting-private.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-private.h b/libnm-core/nm-setting-private.h
index 49d27336fa..2f46bc6770 100644
--- a/libnm-core/nm-setting-private.h
+++ b/libnm-core/nm-setting-private.h
@@ -201,6 +201,11 @@ gboolean _nm_setting_use_legacy_property (NMSetting *setting,
GPtrArray *_nm_setting_need_secrets (NMSetting *setting);
+gboolean _nm_setting_should_compare_secret_property (NMSetting *setting,
+ NMSetting *other,
+ const char *secret_name,
+ NMSettingCompareFlags flags);
+
/*****************************************************************************/
#endif /* NM_SETTING_PRIVATE_H */