summaryrefslogtreecommitdiffstats
path: root/src/resolve/resolved-bus.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-03-19 06:29:22 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-03-19 16:44:44 +0100
commitbf4e5c4cc63dfbdb171771860858963b95915326 (patch)
treee725163dc49e4102294c8c26e53f151d0dd601c3 /src/resolve/resolved-bus.c
parentdoc: update TODO (diff)
downloadsystemd-bf4e5c4cc63dfbdb171771860858963b95915326.tar.xz
systemd-bf4e5c4cc63dfbdb171771860858963b95915326.zip
resolve: expose global LLMNR, MulticastDNS, and DNSSEC settings as bus property
Diffstat (limited to 'src/resolve/resolved-bus.c')
-rw-r--r--src/resolve/resolved-bus.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c
index ffd7c4824e..e7026d4320 100644
--- a/src/resolve/resolved-bus.c
+++ b/src/resolve/resolved-bus.c
@@ -31,6 +31,8 @@
#include "user-util.h"
#include "utf8.h"
+BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_resolve_support, resolve_support, ResolveSupport);
+
static int reply_query_state(DnsQuery *q) {
switch (q->state) {
@@ -1425,6 +1427,23 @@ static int bus_property_get_dnssec_supported(
return sd_bus_message_append(reply, "b", manager_dnssec_supported(m));
}
+static int bus_property_get_dnssec_mode(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *reply,
+ void *userdata,
+ sd_bus_error *error) {
+
+ Manager *m = userdata;
+
+ assert(reply);
+ assert(m);
+
+ return sd_bus_message_append(reply, "s", dnssec_mode_to_string(manager_get_dnssec_mode(m)));
+}
+
static int bus_property_get_ntas(
sd_bus *bus,
const char *path,
@@ -1814,10 +1833,13 @@ static int bus_method_unregister_service(sd_bus_message *message, void *userdata
static const sd_bus_vtable resolve_vtable[] = {
SD_BUS_VTABLE_START(0),
SD_BUS_PROPERTY("LLMNRHostname", "s", NULL, offsetof(Manager, llmnr_hostname), 0),
+ SD_BUS_PROPERTY("LLMNR", "s", bus_property_get_resolve_support, offsetof(Manager, llmnr_support), 0),
+ SD_BUS_PROPERTY("MulticastDNS", "s", bus_property_get_resolve_support, offsetof(Manager, mdns_support), 0),
SD_BUS_PROPERTY("DNS", "a(iiay)", bus_property_get_dns_servers, 0, 0),
SD_BUS_PROPERTY("Domains", "a(isb)", bus_property_get_domains, 0, 0),
SD_BUS_PROPERTY("TransactionStatistics", "(tt)", bus_property_get_transaction_statistics, 0, 0),
SD_BUS_PROPERTY("CacheStatistics", "(ttt)", bus_property_get_cache_statistics, 0, 0),
+ SD_BUS_PROPERTY("DNSSEC", "s", bus_property_get_dnssec_mode, 0, 0),
SD_BUS_PROPERTY("DNSSECStatistics", "(tttt)", bus_property_get_dnssec_statistics, 0, 0),
SD_BUS_PROPERTY("DNSSECSupported", "b", bus_property_get_dnssec_supported, 0, 0),
SD_BUS_PROPERTY("DNSSECNegativeTrustAnchors", "as", bus_property_get_ntas, 0, 0),