summaryrefslogtreecommitdiffstats
path: root/src/resolve/resolved-resolv-conf.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-09-29 17:25:15 +0200
committerLennart Poettering <lennart@poettering.net>2020-09-30 10:27:50 +0200
commit4261ab654c0df009b5a37a30593d58d47fec617f (patch)
tree22d01a94616ded315f1835243d0998f0ef66105f /src/resolve/resolved-resolv-conf.h
parentloginctl: add -P as short for --value --property= (diff)
downloadsystemd-4261ab654c0df009b5a37a30593d58d47fec617f.tar.xz
systemd-4261ab654c0df009b5a37a30593d58d47fec617f.zip
resolved: expose a new bus property that informs about the /etc/resolv.conf mode
It can be one of "foreign", "missing", "stub", "static", "uplink", depending on how /etc/resolv.conf is set up: foreign → someone/something else manages /etc/resolv.conf, systemd-resolved is just the consumer missing → /etc/resolv.conf is missing altogether stub/static/uplink → the file is managed by resolved, with the well-known modes Fixes: #17159
Diffstat (limited to 'src/resolve/resolved-resolv-conf.h')
-rw-r--r--src/resolve/resolved-resolv-conf.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/resolve/resolved-resolv-conf.h b/src/resolve/resolved-resolv-conf.h
index f69cf2a441..584d25c0f7 100644
--- a/src/resolve/resolved-resolv-conf.h
+++ b/src/resolve/resolved-resolv-conf.h
@@ -6,3 +6,18 @@
int manager_check_resolv_conf(const Manager *m);
int manager_read_resolv_conf(Manager *m);
int manager_write_resolv_conf(Manager *m);
+
+typedef enum ResolvConfMode {
+ RESOLV_CONF_UPLINK,
+ RESOLV_CONF_STUB,
+ RESOLV_CONF_STATIC,
+ RESOLV_CONF_FOREIGN,
+ RESOLV_CONF_MISSING,
+ _RESOLV_CONF_MODE_MAX,
+ _RESOLV_CONF_MODE_INVALID = -1,
+} ResolvConfMode;
+
+int resolv_conf_mode(void);
+
+const char* resolv_conf_mode_to_string(ResolvConfMode m) _const_;
+ResolvConfMode resolv_conf_mode_from_string(const char *s) _pure_;