From 316abd62fd5edd947e2b7d8d3862253c391f32ae Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 21 Feb 2008 04:34:34 +0000 Subject: 2008-02-20 Dan Williams * libnm-util/nm-connection.c libnm-util/nm-connection.h - (nm_connection_compare): accept compare flags and pass them to the setting compare function * libnm-util/nm-setting.c libnm-util/nm-setting.h - (nm_setting_compare): accept compare flags; ignore properties that are marked fuzzy * libnm-util/nm-setting-connection.c libnm-util/nm-setting-wireless.c libnm-util/nm-setting-ppp.c libnm-util/nm-setting-wired.c - Mark some setting properties as ignorable when doing a fuzzy compare * src/nm-device.c - (device_activation_precheck): use exact compare git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3336 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- libnm-util/nm-setting.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'libnm-util/nm-setting.h') diff --git a/libnm-util/nm-setting.h b/libnm-util/nm-setting.h index 181e141f69..c127b4ddda 100644 --- a/libnm-util/nm-setting.h +++ b/libnm-util/nm-setting.h @@ -15,9 +15,10 @@ G_BEGIN_DECLS #define NM_IS_SETTING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING)) #define NM_SETTING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING, NMSettingClass)) -#define NM_SETTING_PARAM_SERIALIZE (1 << (0 + G_PARAM_USER_SHIFT)) -#define NM_SETTING_PARAM_REQUIRED (1 << (1 + G_PARAM_USER_SHIFT)) -#define NM_SETTING_PARAM_SECRET (1 << (2 + G_PARAM_USER_SHIFT)) +#define NM_SETTING_PARAM_SERIALIZE (1 << (0 + G_PARAM_USER_SHIFT)) +#define NM_SETTING_PARAM_REQUIRED (1 << (1 + G_PARAM_USER_SHIFT)) +#define NM_SETTING_PARAM_SECRET (1 << (2 + G_PARAM_USER_SHIFT)) +#define NM_SETTING_PARAM_FUZZY_IGNORE (1 << (3 + G_PARAM_USER_SHIFT)) #define NM_SETTING_NAME "name" @@ -59,8 +60,18 @@ const char *nm_setting_get_name (NMSetting *setting); gboolean nm_setting_verify (NMSetting *setting, GSList *all_settings); + +typedef enum { + /* Match all attributes exactly */ + COMPARE_FLAGS_EXACT = 0x00, + + /* Match only important attributes, like SSID, type, security settings, etc */ + COMPARE_FLAGS_FUZZY = 0x01, +} NMSettingCompareFlags; + gboolean nm_setting_compare (NMSetting *setting, - NMSetting *other); + NMSetting *other, + NMSettingCompareFlags flags); void nm_setting_enumerate_values (NMSetting *setting, NMSettingValueIterFn func, -- cgit v1.2.1