summaryrefslogtreecommitdiff
path: root/src/nm-config.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-11-06 16:45:27 +0100
committerThomas Haller <thaller@redhat.com>2016-04-07 10:15:01 +0200
commit1b43c880ba43260fe551b0ac923826f16737484f (patch)
tree5240da5f5db2f003f9fe1e467e7684407b51efe2 /src/nm-config.h
parent350d96a9eeb39f06ca7a139289c11f2a1d3f891c (diff)
downloadNetworkManager-1b43c880ba43260fe551b0ac923826f16737484f.tar.gz
config: let NMConfig handle "NetworkManager.state" file (bgo#764474)
Move reading and writing of the state file to NMConfig ("/var/lib/NetworkManager/NetworkManager.state" file). Originally, I intended to persist more state, thus it made sense to cleanup handling of the state file and move it all at one place. Now, it's not clear that will happen anytime soon. Still, the change is a worthy cleanup, so do it anyway. https://bugzilla.gnome.org/show_bug.cgi?id=764474
Diffstat (limited to 'src/nm-config.h')
-rw-r--r--src/nm-config.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nm-config.h b/src/nm-config.h
index 8bbab2ac6f..36007fa895 100644
--- a/src/nm-config.h
+++ b/src/nm-config.h
@@ -83,6 +83,24 @@ G_BEGIN_DECLS
typedef struct NMConfigCmdLineOptions NMConfigCmdLineOptions;
+typedef enum {
+ NM_CONFIG_RUN_STATE_PROPERTY_NONE,
+
+ /* 1 set-argument: (gboolean enabled) */
+ NM_CONFIG_RUN_STATE_PROPERTY_NETWORKING_ENABLED,
+ NM_CONFIG_RUN_STATE_PROPERTY_WIFI_ENABLED,
+ NM_CONFIG_RUN_STATE_PROPERTY_WWAN_ENABLED,
+} NMConfigRunStatePropertyType;
+
+typedef struct {
+ bool net_enabled;
+ bool wifi_enabled;
+ bool wwan_enabled;
+
+ /* Whether the runstate is modified and not saved to disk. */
+ bool dirty;
+} NMConfigRunState;
+
struct _NMConfig {
GObject parent;
};
@@ -131,6 +149,15 @@ NMConfig *nm_config_new (const NMConfigCmdLineOptions *cli, char **atomic_sectio
NMConfig *nm_config_setup (const NMConfigCmdLineOptions *cli, char **atomic_section_prefixes, GError **error);
void nm_config_reload (NMConfig *config, int signal);
+const NMConfigRunState *nm_config_run_state_get (NMConfig *config);
+
+void _nm_config_run_state_set (NMConfig *config,
+ gboolean allow_persist,
+ gboolean force_persist,
+ ...);
+#define nm_config_run_state_set(config, allow_persist, force_persist, ...) \
+ _nm_config_run_state_set (config, allow_persist, force_persist, ##__VA_ARGS__, 0)
+
gint nm_config_parse_boolean (const char *str, gint default_value);
GKeyFile *nm_config_create_keyfile (void);