resolved-bus.c revision e40f0647b48b57af5e874501ad9c05dc459108de
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen This file is part of systemd.
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen Copyright 2014 Lennart Poettering
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen systemd is free software; you can redistribute it and/or modify it
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen under the terms of the GNU Lesser General Public License as published by
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen the Free Software Foundation; either version 2.1 of the License, or
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen (at your option) any later version.
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen systemd is distributed in the hope that it will be useful, but
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen Lesser General Public License for more details.
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen You should have received a copy of the GNU Lesser General Public License
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen switch (q->state) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_NAME_SERVERS, "No appropriate name servers or networks for name found");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_errorf(q->request, SD_BUS_ERROR_TIMEOUT, "Query timed out");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_errorf(q->request, SD_BUS_ERROR_TIMEOUT, "All attempts to contact name servers or networks failed");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_errorf(q->request, BUS_ERROR_INVALID_REPLY, "Received invalid reply");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_RESOURCES, "Not enough resources");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_errorf(q->request, BUS_ERROR_ABORTED, "Query aborted");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_errorf(q->request, BUS_ERROR_DNSSEC_FAILED, "DNSSEC validation failed: %s",
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen dnssec_result_to_string(q->answer_dnssec_result));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_TRUST_ANCHOR, "No suitable trust anchor known");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_errorf(q->request, BUS_ERROR_RR_TYPE_UNSUPPORTED, "Server does not support requested resource record type");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen sd_bus_error_setf(&error, _BUS_ERROR_DNS "NXDOMAIN", "'%s' not found", dns_query_string(q));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen const char *rc, *n;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen sd_bus_error_setf(&error, n, "Could not resolve '%s', server or network returned error %s", dns_query_string(q), rc);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_reply_method_error(q->request, &error);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersenstatic int append_address(sd_bus_message *reply, DnsResourceRecord *rr, int ifindex) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_open_container(reply, 'r', "iiay");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_append(reply, "i", ifindex);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_append(reply, "i", AF_INET);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_append_array(reply, 'y', &rr->a.in_addr, sizeof(struct in_addr));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_append(reply, "i", AF_INET6);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_append_array(reply, 'y', &rr->aaaa.in6_addr, sizeof(struct in6_addr));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersenstatic void bus_method_resolve_hostname_complete(DnsQuery *q) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen _cleanup_(dns_resource_record_unrefp) DnsResourceRecord *canonical = NULL;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen unsigned added = 0;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_CNAME_LOOP, "CNAME loop detected, or CNAME resolving disabled on '%s'", dns_query_string(q));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen if (r == DNS_QUERY_RESTARTED) /* This was a cname, and the query was restarted. */
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_new_method_return(q->request, &reply);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_open_container(reply, 'a', "(iiay)");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen DNS_ANSWER_FOREACH_IFINDEX(rr, ifindex, q->answer) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen question = dns_query_question_for_protocol(q, q->answer_protocol);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = dns_question_matches_rr(question, rr, DNS_SEARCH_DOMAIN_NAME(q->answer_search_domain));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR, "'%s' does not have any RR of the requested type", dns_query_string(q));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen /* Return the precise spelling and uppercasing and CNAME target reported by the server */
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen SD_RESOLVED_FLAGS_MAKE(q->answer_protocol, q->answer_family, q->answer_authenticated));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_send(q->manager->bus, reply, NULL);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen log_error_errno(r, "Failed to send hostname reply: %m");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen sd_bus_reply_method_errno(q->request, r, NULL);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersenstatic int check_ifindex_flags(int ifindex, uint64_t *flags, uint64_t ok, sd_bus_error *error) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid interface index");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen if (*flags & ~(SD_RESOLVED_PROTOCOLS_ALL|SD_RESOLVED_NO_CNAME|ok))
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid flags parameter");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen if ((*flags & SD_RESOLVED_PROTOCOLS_ALL) == 0) /* If no protocol is enabled, enable all */
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersenstatic int bus_method_resolve_hostname(sd_bus_message *message, void *userdata, sd_bus_error *error) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen _cleanup_(dns_question_unrefp) DnsQuestion *question_idna = NULL, *question_utf8 = NULL;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_read(message, "isit", &ifindex, &hostname, &family, &flags);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen if (!IN_SET(family, AF_INET, AF_INET6, AF_UNSPEC))
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unknown address family %i", family);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid hostname '%s'", hostname);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = check_ifindex_flags(ifindex, &flags, SD_RESOLVED_NO_SEARCH, error);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = dns_question_new_address(&question_utf8, family, hostname, false);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = dns_question_new_address(&question_idna, family, hostname, true);
52efd56a6369e19c2400a42981a197cd2eef924aLennart Poettering r = dns_query_new(m, &q, question_utf8, question_idna, ifindex, flags);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen q->complete = bus_method_resolve_hostname_complete;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersenstatic void bus_method_resolve_address_complete(DnsQuery *q) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen unsigned added = 0;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_CNAME_LOOP, "CNAME loop detected, or CNAME resolving disabled on '%s'", dns_query_string(q));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen if (r == DNS_QUERY_RESTARTED) /* This was a cname, and the query was restarted. */
7e518afab9fb55b8052f68888210927259275560Thomas Hindoe Paaboel Andersen r = sd_bus_message_new_method_return(q->request, &reply);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_open_container(reply, 'a', "(is)");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen question = dns_query_question_for_protocol(q, q->answer_protocol);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen DNS_ANSWER_FOREACH_IFINDEX(rr, ifindex, q->answer) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = dns_question_matches_rr(question, rr, NULL);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_append(reply, "(is)", ifindex, rr->ptr.name);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen in_addr_to_string(q->request_family, &q->request_address, &ip);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR, "Address '%s' does not have any RR of requested type", strna(ip));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_append(reply, "t", SD_RESOLVED_FLAGS_MAKE(q->answer_protocol, q->answer_family, q->answer_authenticated));
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_send(q->manager->bus, reply, NULL);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen log_error_errno(r, "Failed to send address reply: %m");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen sd_bus_reply_method_errno(q->request, r, NULL);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersenstatic int bus_method_resolve_address(sd_bus_message *message, void *userdata, sd_bus_error *error) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen _cleanup_(dns_question_unrefp) DnsQuestion *question = NULL;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen const void *d;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_read(message, "ii", &ifindex, &family);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unknown address family %i", family);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_read_array(message, 'y', &d, &sz);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid address size");
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_read(message, "t", &flags);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = check_ifindex_flags(ifindex, &flags, 0, error);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = dns_question_new_reverse(&question, family, d);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = dns_query_new(m, &q, question, question, ifindex, flags|SD_RESOLVED_NO_SEARCH);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen q->complete = bus_method_resolve_address_complete;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersenstatic int bus_message_append_rr(sd_bus_message *m, DnsResourceRecord *rr, int ifindex) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_open_container(m, 'r', "iqqay");
8927b1dad2d4a7330174cb924090b4635a2547fbDavid Herrmann r = dns_resource_record_to_wire_format(rr, false);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen r = sd_bus_message_append_array(m, 'y', rr->wire_format, rr->wire_format_size);
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersenstatic void bus_method_resolve_record_complete(DnsQuery *q) {
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
23fbe14f503c1e98292efc4ba1238adb7dc38d80Tom Gundersen unsigned added = 0;
assert(q);
r = reply_query_state(q);
goto finish;
r = dns_query_process_cname(q);
if (r == -ELOOP) {
r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_CNAME_LOOP, "CNAME loop detected, or CNAME resolving disabled on '%s'", dns_query_string(q));
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
added ++;
if (added <= 0) {
r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR, "Name '%s' does not have any RR of the requested type", dns_query_string(q));
goto finish;
goto finish;
r = sd_bus_message_append(reply, "t", SD_RESOLVED_FLAGS_MAKE(q->answer_protocol, q->answer_family, q->answer_authenticated));
goto finish;
dns_query_free(q);
static int bus_method_resolve_record(sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *name;
int r, ifindex;
DnsQuery *q;
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Specified resource record type %" PRIu16 " may not be used in a query.", type);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Specified DNS resource record type %" PRIu16 " is obsolete.", type);
if (!question)
return -ENOMEM;
if (!key)
return -ENOMEM;
goto fail;
r = dns_query_go(q);
goto fail;
fail:
dns_query_free(q);
assert(q);
if (canonical)
if (!canonical)
int ifindex;
r = sd_bus_message_append(reply, "s", canonical ? DNS_RESOURCE_KEY_NAME(canonical->key) : rr->srv.name);
DnsTxtItem *i;
if (i->length <= 0)
unsigned added = 0;
assert(q);
if (q->block_all_complete > 0)
bool have_success = false;
case DNS_TRANSACTION_PENDING:
case DNS_TRANSACTION_SUCCESS:
have_success = true;
if (!have_success) {
r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_CNAME_LOOP, "CNAME loop detected, or CNAME resolving disabled on '%s'", dns_query_string(bad));
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
if (!canonical)
added++;
if (added <= 0) {
r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR, "'%s' does not have any RR of the requested type", dns_query_string(q));
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
dns_query_free(q);
assert(q);
r = dns_query_process_cname(q);
q->auxiliary_result = r;
assert(q);
if (r == -EAGAIN) {
goto fail;
goto fail;
fail:
bool has_root_domain = false;
unsigned found = 0;
int ifindex, r;
assert(q);
r = reply_query_state(q);
goto finish;
r = dns_query_process_cname(q);
if (r == -ELOOP) {
r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_CNAME_LOOP, "CNAME loop detected, or CNAME resolving disabled on '%s'", dns_query_string(q));
goto finish;
goto finish;
goto finish;
has_root_domain = true;
q->block_all_complete ++;
q->block_all_complete --;
goto finish;
found++;
r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_SERVICE, "'%s' does not provide the requested service", dns_query_string(q));
goto finish;
if (found <= 0) {
r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR, "'%s' does not have any RR of the requested type", dns_query_string(q));
goto finish;
dns_query_free(q);
static int bus_method_resolve_service(sd_bus_message *message, void *userdata, sd_bus_error *error) {
DnsQuery *q;
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Service name cannot be specified without service type.");
r = dns_question_new_service(&question_utf8, name, type, domain, !(flags & SD_RESOLVED_NO_TXT), false);
r = dns_question_new_service(&question_idna, name, type, domain, !(flags & SD_RESOLVED_NO_TXT), true);
goto fail;
r = dns_query_go(q);
goto fail;
fail:
dns_query_free(q);
assert(s);
static int bus_property_get_dns_servers(
const char *path,
const char *interface,
const char *property,
void *userdata,
DnsServer *s;
Iterator i;
Link *l;
assert(m);
static int bus_property_get_search_domains(
const char *path,
const char *interface,
const char *property,
void *userdata,
DnsSearchDomain *d;
Iterator i;
Link *l;
assert(m);
static int bus_property_get_transaction_statistics(
const char *path,
const char *interface,
const char *property,
void *userdata,
assert(m);
static int bus_property_get_cache_statistics(
const char *path,
const char *interface,
const char *property,
void *userdata,
DnsScope *s;
assert(m);
static int bus_property_get_dnssec_statistics(
const char *path,
const char *interface,
const char *property,
void *userdata,
assert(m);
static int bus_property_get_dnssec_supported(
const char *path,
const char *interface,
const char *property,
void *userdata,
bool supported = true;
Iterator i;
Link *l;
assert(m);
if (server)
if (server)
static int bus_method_reset_statistics(sd_bus_message *message, void *userdata, sd_bus_error *error) {
DnsScope *s;
assert(m);
m->n_transactions_total = 0;
Link *l;
assert(m);
if (ifindex <= 0)
if (l->is_managed)
*ret = l;
static int bus_method_set_link_dns_servers(sd_bus_message *message, void *userdata, sd_bus_error *error) {
int ifindex, r;
Link *l;
assert(m);
int family;
return -ENOMEM;
DnsServer *s;
goto clear;
static int bus_method_set_link_domains(sd_bus_message *message, void *userdata, sd_bus_error *error) {
int ifindex, r;
Link *l;
assert(m);
r = dns_name_is_valid(*i);
if (dns_name_is_root(*i))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Root domain is not suitable as search domain");
DnsSearchDomain *d;
goto clear;
goto clear;
static int bus_method_set_link_llmnr(sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *llmnr;
int ifindex, r;
Link *l;
assert(m);
if (mode < 0)
link_add_rrs(l, false);
const char *mdns;
int ifindex, r;
Link *l;
assert(m);
if (mode < 0)
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid MulticastDNS setting: %s", mdns);
link_add_rrs(l, false);
static int bus_method_set_link_dnssec(sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *dnssec;
int ifindex, r;
Link *l;
assert(m);
if (mode < 0)
static int bus_method_set_link_dnssec_negative_trust_anchors(sd_bus_message *message, void *userdata, sd_bus_error *error) {
int ifindex, r;
Link *l;
assert(m);
r = dns_name_is_valid(*i);
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid search negative trust anchor domain: %s", *i);
if (!ns)
return -ENOMEM;
int ifindex;
Link *l;
assert(m);
link_add_rrs(l, false);
SD_BUS_METHOD("ResolveHostname", "isit", "a(iiay)st", bus_method_resolve_hostname, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResolveAddress", "iiayt", "a(is)t", bus_method_resolve_address, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResolveRecord", "isqqt", "a(iqqay)t", bus_method_resolve_record, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ResolveService", "isssit", "a(qqqsa(iiay)s)aayssst", bus_method_resolve_service, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetLinkDNSSECNegativeTrustAnchors", "ias", NULL, bus_method_set_link_dnssec_negative_trust_anchors, 0),
assert(s);
assert(m);
static int match_prepare_for_sleep(sd_bus_message *message, void *userdata, sd_bus_error *ret_error) {
assert(m);
assert(m);
if (m->bus)
r = sd_event_add_time(m->event, &m->bus_retry_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + 5*USEC_PER_SEC, 0, on_bus_retry, m);
r = sd_bus_add_object_vtable(m->bus, NULL, "/org/freedesktop/resolve1", "org.freedesktop.resolve1.Manager", resolve_vtable, m);
"path='/org/freedesktop/login1'",