summaryrefslogtreecommitdiff
path: root/libnm-util/nm-setting.h
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2011-01-29 13:34:24 -0600
committerDan Williams <dcbw@redhat.com>2011-01-29 13:34:24 -0600
commit5a7cf39a62442df3747dda304fb41df3b9587837 (patch)
treeb1ce90d236b5b37fe2c3341d55bc21f9843a32be /libnm-util/nm-setting.h
parent12908c8a1a71b0fde1bd8aed160244c01b979865 (diff)
downloadNetworkManager-5a7cf39a62442df3747dda304fb41df3b9587837.tar.gz
libnm-util: add secret flags for each secret describing how the secret is stored
This allows the necessary flexibility when handling secrets; otherwise it wouldn't be known when NM should save secrets returned from agents to backing storage, or when the agents should store the secrets. We can't simply use lack of a secret in persistent storage as the indicator of this, as (for example) when creating a new connection without secrets the storage method would be abmiguous. At the same time, fold in "always ask" functionality for OTP tokens so user agents don't have to store that attribute themselves out-of-band.
Diffstat (limited to 'libnm-util/nm-setting.h')
-rw-r--r--libnm-util/nm-setting.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/libnm-util/nm-setting.h b/libnm-util/nm-setting.h
index 07a38daad3..9079213585 100644
--- a/libnm-util/nm-setting.h
+++ b/libnm-util/nm-setting.h
@@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2007 - 2008 Red Hat, Inc.
+ * (C) Copyright 2007 - 2011 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@@ -185,6 +185,31 @@ void nm_setting_enumerate_values (NMSetting *setting,
char *nm_setting_to_string (NMSetting *setting);
/* Secrets */
+
+/**
+ * NMSettingSecretFlags:
+ * @NM_SETTING_SECRET_FLAG_SYTSEM_OWNED: the system is responsible for providing
+ * and storing this secret (default)
+ * @NM_SETTING_SECRET_FLAG_AGENT_OWNED: a user secret agent is responsible
+ * for providing and storing this secret; when it is required agents will be
+ * asked to retrieve it
+ * @NM_SETTING_SECRET_FLAG_NOT_SAVED: this secret should not be saved, but
+ * should be requested from the user each time it is needed
+ *
+ * These flags indicate specific behavior related to handling of a secret. Each
+ * secret has a corresponding set of these flags which indicate how the secret
+ * is to be stored and/or requested when it is needed.
+ *
+ **/
+typedef enum {
+ NM_SETTING_SECRET_FLAG_SYSTEM_OWNED = 0x00000000,
+ NM_SETTING_SECRET_FLAG_AGENT_OWNED = 0x00000001,
+ NM_SETTING_SECRET_FLAG_NOT_SAVED = 0x00000002,
+
+ /* Placeholder for bounds checking */
+ NM_SETTING_SECRET_FLAG_LAST = NM_SETTING_SECRET_FLAG_NOT_SAVED,
+} NMSettingSecretFlags;
+
void nm_setting_clear_secrets (NMSetting *setting);
GPtrArray *nm_setting_need_secrets (NMSetting *setting);
gboolean nm_setting_update_secrets (NMSetting *setting,