diff options
Diffstat (limited to 'src/settings/nm-settings-connection.h')
| -rw-r--r-- | src/settings/nm-settings-connection.h | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h index 29ec05dd..58901699 100644 --- a/src/settings/nm-settings-connection.h +++ b/src/settings/nm-settings-connection.h @@ -24,7 +24,7 @@ #include <net/ethernet.h> -#include "nm-exported-object.h" +#include "nm-dbus-object.h" #include "nm-connection.h" #define NM_TYPE_SETTINGS_CONNECTION (nm_settings_connection_get_type ()) @@ -34,14 +34,11 @@ #define NM_IS_SETTINGS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTINGS_CONNECTION)) #define NM_SETTINGS_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTINGS_CONNECTION, NMSettingsConnectionClass)) -/* Signals */ -#define NM_SETTINGS_CONNECTION_UPDATED "updated" #define NM_SETTINGS_CONNECTION_REMOVED "removed" #define NM_SETTINGS_CONNECTION_GET_SECRETS "get-secrets" #define NM_SETTINGS_CONNECTION_CANCEL_SECRETS "cancel-secrets" - -/* Internal signals */ #define NM_SETTINGS_CONNECTION_UPDATED_INTERNAL "updated-internal" +#define NM_SETTINGS_CONNECTION_FLAGS_CHANGED "flags-changed" /* Properties */ #define NM_SETTINGS_CONNECTION_UNSAVED "unsaved" @@ -53,32 +50,45 @@ /** - * NMSettingsConnectionFlags: - * @NM_SETTINGS_CONNECTION_FLAGS_NONE: no flag set - * @NM_SETTINGS_CONNECTION_FLAGS_UNSAVED: the connection is not saved to disk - * @NM_SETTINGS_CONNECTION_FLAGS_NM_GENERATED: A connection is "nm-generated" if + * NMSettingsConnectionIntFlags: + * @NM_SETTINGS_CONNECTION_INT_FLAGS_NONE: no flag set + * @NM_SETTINGS_CONNECTION_INT_FLAGS_UNSAVED: the connection is not saved to disk. + * See also #NM_SETTINGS_CONNECTION_FLAG_UNSAVED. + * @NM_SETTINGS_CONNECTION_INT_FLAGS_NM_GENERATED: A connection is "nm-generated" if * it was generated by NetworkManger. If the connection gets modified or saved * by the user, the flag gets cleared. A nm-generated is implicitly unsaved. - * @NM_SETTINGS_CONNECTION_FLAGS_VOLATILE: The connection will be deleted + * See also #NM_SETTINGS_CONNECTION_FLAG_NM_GENERATED. + * @NM_SETTINGS_CONNECTION_INT_FLAGS_VOLATILE: The connection will be deleted * when it disconnects. That is for in-memory connections (unsaved), which are * currently active but cleanup on disconnect. - * @NM_SETTINGS_CONNECTION_FLAGS_VISIBLE: The connection is visible - * @NM_SETTINGS_CONNECTION_FLAGS_ALL: special mask, for all known flags + * See also #NM_SETTINGS_CONNECTION_FLAG_VOLATILE. + * @NM_SETTINGS_CONNECTION_INT_FLAGS_VISIBLE: The connection is visible + * @NM_SETTINGS_CONNECTION_INT_FLAGS_EXPORTED_MASK: the entire enum is + * internal, however, parts of it is public API as #NMSettingsConnectionFlags. + * This mask, are the public flags. + * @NM_SETTINGS_CONNECTION_INT_FLAGS_ALL: special mask, for all known flags * * #NMSettingsConnection flags. **/ typedef enum { - NM_SETTINGS_CONNECTION_FLAGS_NONE = 0, + NM_SETTINGS_CONNECTION_INT_FLAGS_NONE = 0, + + NM_SETTINGS_CONNECTION_INT_FLAGS_UNSAVED = NM_SETTINGS_CONNECTION_FLAG_UNSAVED, + NM_SETTINGS_CONNECTION_INT_FLAGS_NM_GENERATED = NM_SETTINGS_CONNECTION_FLAG_NM_GENERATED, + NM_SETTINGS_CONNECTION_INT_FLAGS_VOLATILE = NM_SETTINGS_CONNECTION_FLAG_VOLATILE, + + NM_SETTINGS_CONNECTION_INT_FLAGS_VISIBLE = (1LL << 3), - NM_SETTINGS_CONNECTION_FLAGS_UNSAVED = (1LL << 0), - NM_SETTINGS_CONNECTION_FLAGS_NM_GENERATED = (1LL << 1), - NM_SETTINGS_CONNECTION_FLAGS_VOLATILE = (1LL << 2), + __NM_SETTINGS_CONNECTION_INT_FLAGS_LAST, - NM_SETTINGS_CONNECTION_FLAGS_VISIBLE = (1LL << 3), + NM_SETTINGS_CONNECTION_INT_FLAGS_EXPORTED_MASK = 0 + | NM_SETTINGS_CONNECTION_INT_FLAGS_UNSAVED + | NM_SETTINGS_CONNECTION_INT_FLAGS_NM_GENERATED + | NM_SETTINGS_CONNECTION_INT_FLAGS_VOLATILE + | 0, - __NM_SETTINGS_CONNECTION_FLAGS_LAST, - NM_SETTINGS_CONNECTION_FLAGS_ALL = ((__NM_SETTINGS_CONNECTION_FLAGS_LAST - 1) << 1) - 1, -} NMSettingsConnectionFlags; + NM_SETTINGS_CONNECTION_INT_FLAGS_ALL = ((__NM_SETTINGS_CONNECTION_INT_FLAGS_LAST - 1) << 1) - 1, +} NMSettingsConnectionIntFlags; typedef enum { NM_SETTINGS_CONNECTION_COMMIT_REASON_NONE = 0, @@ -106,12 +116,13 @@ typedef struct _NMSettingsConnectionClass NMSettingsConnectionClass; struct _NMSettingsConnectionPrivate; struct _NMSettingsConnection { - NMExportedObject parent; + NMDBusObject parent; struct _NMSettingsConnectionPrivate *_priv; + CList _connections_lst; }; struct _NMSettingsConnectionClass { - NMExportedObjectClass parent; + NMDBusObjectClass parent; gboolean (*commit_changes) (NMSettingsConnection *self, NMConnection *new_connection, @@ -199,9 +210,9 @@ void nm_settings_connection_signal_remove (NMSettingsConnection *self); gboolean nm_settings_connection_get_unsaved (NMSettingsConnection *self); -NMSettingsConnectionFlags nm_settings_connection_get_flags (NMSettingsConnection *self); -NMSettingsConnectionFlags nm_settings_connection_set_flags (NMSettingsConnection *self, NMSettingsConnectionFlags flags, gboolean set); -NMSettingsConnectionFlags nm_settings_connection_set_flags_full (NMSettingsConnection *self, NMSettingsConnectionFlags mask, NMSettingsConnectionFlags value); +NMSettingsConnectionIntFlags nm_settings_connection_get_flags (NMSettingsConnection *self); +NMSettingsConnectionIntFlags nm_settings_connection_set_flags (NMSettingsConnection *self, NMSettingsConnectionIntFlags flags, gboolean set); +NMSettingsConnectionIntFlags nm_settings_connection_set_flags_full (NMSettingsConnection *self, NMSettingsConnectionIntFlags mask, NMSettingsConnectionIntFlags value); int nm_settings_connection_cmp_timestamp (NMSettingsConnection *ac, NMSettingsConnection *ab); int nm_settings_connection_cmp_timestamp_p_with_data (gconstpointer pa, gconstpointer pb, gpointer user_data); |