+/* SPDX-License-Identifier: LGPL-2.1+ */
#include "conf-files.h"
#include "conf-parser.h"
+#include "def.h"
#include "resolved-dnssd.h"
#include "resolved-dns-rr.h"
#include "resolved-manager.h"
#include "specifier.h"
#include "strv.h"
-const char* const dnssd_service_dirs[] = {
- "/etc/systemd/dnssd",
- "/run/systemd/dnssd",
- "/usr/lib/systemd/dnssd",
-#if HAVE_SPLIT_USR
- "/lib/systemd/dnssd",
-#endif
- NULL
-};
+#define DNSSD_SERVICE_DIRS ((const char* const*) CONF_PATHS_STRV("systemd/dnssd"))
DnssdTxtData *dnssd_txtdata_free(DnssdTxtData *txt_data) {
if (!txt_data)
dropin_dirname = strjoina(service->name, ".dnssd.d");
- r = config_parse_many(filename, dnssd_service_dirs, dropin_dirname,
+ r = config_parse_many(filename, DNSSD_SERVICE_DIRS, dropin_dirname,
"Service\0",
config_item_perf_lookup, resolved_dnssd_gperf_lookup,
false, service);
return 0;
}
-static int specifier_dnssd_host_name(char specifier, void *data, void *userdata, char **ret) {
+static int specifier_dnssd_host_name(char specifier, const void *data, const void *userdata, char **ret) {
DnssdService *s = (DnssdService *) userdata;
char *n;
if (manager->mdns_support != RESOLVE_SUPPORT_YES)
return 0;
- r = conf_files_list_strv(&files, ".dnssd", NULL, 0, dnssd_service_dirs);
+ r = conf_files_list_strv(&files, ".dnssd", NULL, 0, DNSSD_SERVICE_DIRS);
if (r < 0)
return log_error_errno(r, "Failed to enumerate .dnssd files: %m");