summaryrefslogtreecommitdiff
path: root/src/nm-config.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-06-10 11:59:46 +0200
committerThomas Haller <thaller@redhat.com>2015-07-02 16:01:20 +0200
commit40c57fa7f197ad9456b1359862d6bf1a7c3fd352 (patch)
tree916763501b5ae53f50ca7934d1f3a161c6114c77 /src/nm-config.h
parent947fc9a27885c268ea742e33d18f27666fa9a043 (diff)
downloadNetworkManager-40c57fa7f197ad9456b1359862d6bf1a7c3fd352.tar.gz
config: add write support to atomic-sections
We already support setting configuration values, either: (1) set any internal section, i.e. groups starting with [.intern*]. Those values don't ever interfere with that the user can configure. (2) set individual properties that overwrite user configuration. When doing that, we record the value from user configuration and on load, we reject our internal overwrite if the user configuration changed in the meantime. This is done by storing the values with ".set." and ".was." prefixes. Now add support for "atomic sections". In this case, certain groups can be marked as "atomic". When writing to such sections, we overwrite the entire user-provided setting. We also record the values from user configuration, and reject our internal value if we notice modifications. This basically extends (2) from individual properties to the entire section.
Diffstat (limited to 'src/nm-config.h')
-rw-r--r--src/nm-config.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nm-config.h b/src/nm-config.h
index d4ff887ba3..3caf0c5c31 100644
--- a/src/nm-config.h
+++ b/src/nm-config.h
@@ -39,6 +39,7 @@ G_BEGIN_DECLS
/* Properties */
#define NM_CONFIG_CMD_LINE_OPTIONS "cmd-line-options"
+#define NM_CONFIG_ATOMIC_SECTION_PREFIXES "atomic-section-prefixes"
/* Signals */
#define NM_CONFIG_SIGNAL_CONFIG_CHANGED "config-changed"
@@ -60,6 +61,7 @@ G_BEGIN_DECLS
#define NM_CONFIG_KEYFILE_GROUP_IFUPDOWN "ifupdown"
#define NM_CONFIG_KEYFILE_GROUP_IFNET "ifnet"
+#define NM_CONFIG_KEYFILE_KEY_ATOMIC_SECTION_WAS ".was"
#define NM_CONFIG_KEYFILE_KEY_IFNET_AUTO_REFRESH "auto_refresh"
#define NM_CONFIG_KEYFILE_KEY_IFNET_MANAGED "managed"
#define NM_CONFIG_KEYFILE_KEY_IFUPDOWN_MANAGED "managed"
@@ -115,8 +117,8 @@ void nm_config_cmd_line_options_add_to_entries (NMConfigCmdLi
gboolean nm_config_get_no_auto_default_for_device (NMConfig *config, NMDevice *device);
void nm_config_set_no_auto_default_for_device (NMConfig *config, NMDevice *device);
-NMConfig *nm_config_new (const NMConfigCmdLineOptions *cli, GError **error);
-NMConfig *nm_config_setup (const NMConfigCmdLineOptions *cli, GError **error);
+NMConfig *nm_config_new (const NMConfigCmdLineOptions *cli, char **atomic_section_prefixes, GError **error);
+NMConfig *nm_config_setup (const NMConfigCmdLineOptions *cli, char **atomic_section_prefixes, GError **error);
void nm_config_reload (NMConfig *config, int signal);
gint nm_config_parse_boolean (const char *str, gint default_value);