summaryrefslogtreecommitdiff
path: root/src/nm-config.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-09-23 17:36:21 +0200
committerThomas Haller <thaller@redhat.com>2016-09-26 13:12:02 +0200
commit93396b8d526e99ac26a6e9c9d9b783333fc9b88e (patch)
treee2a3227e5a1e478f64688cc3105f6a0b76a447aa /src/nm-config.h
parent1eca446c8c9044c3643c59f73d4396e7ef18d54d (diff)
downloadNetworkManager-93396b8d526e99ac26a6e9c9d9b783333fc9b88e.tar.gz
config: store and load device runtime state to file
The data is still unused, the actual fields might change. Note that the actual state we store is subject to change, according to which data we need. The file format is non stable, as the files don't survive reboot. So there is no backward compatibility to maintain and the format can be changed later.
Diffstat (limited to 'src/nm-config.h')
-rw-r--r--src/nm-config.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nm-config.h b/src/nm-config.h
index ef5430ee6c..6ada27672d 100644
--- a/src/nm-config.h
+++ b/src/nm-config.h
@@ -189,6 +189,29 @@ extern char *_nm_config_match_env;
#define NM_CONFIG_DEVICE_STATE_DIR ""NMRUNDIR"/devices"
+typedef enum {
+ NM_CONFIG_DEVICE_STATE_MANAGED_TYPE_UNKNOWN = -1,
+ NM_CONFIG_DEVICE_STATE_MANAGED_TYPE_UNMANAGED = 0,
+ NM_CONFIG_DEVICE_STATE_MANAGED_TYPE_MANAGED = 1,
+} NMConfigDeviceStateManagedType;
+
+typedef struct {
+ int ifindex;
+ NMConfigDeviceStateManagedType managed;
+
+ /* the UUID of the last settings-connection active
+ * on the device. */
+ const char *connection_uuid;
+} NMConfigDeviceStateData;
+
+NMConfigDeviceStateData *nm_config_device_state_load (NMConfig *self,
+ int ifindex);
+gboolean nm_config_device_state_write (NMConfig *self,
+ int ifindex,
+ gboolean managed,
+ const char *connection_uuid);
+void nm_config_device_state_prune_unseen (NMConfig *self, GHashTable *seen_ifindexes);
+
/*****************************************************************************/
#endif /* __NETWORKMANAGER_CONFIG_H__ */