summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-07-12 16:53:59 +0000
committerLaurent Bercot <ska@appnovation.com>2023-07-12 16:53:59 +0000
commit207845f50a8fb54fe8e584928078dc3687399caf (patch)
treef58eac67edc2dbaba13a48442a2093f76e869991 /src/include
parent8cf671e973a4ea2ef7c9ca1321531a7ceeaa5073 (diff)
downloads6-dns-207845f50a8fb54fe8e584928078dc3687399caf.tar.xz
Pass on all clients, add hosts support wherever applicable
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/s6-dns/hosts.h21
-rw-r--r--src/include/s6-dns/skadns.h2
2 files changed, 11 insertions, 12 deletions
diff --git a/src/include/s6-dns/hosts.h b/src/include/s6-dns/hosts.h
index 0f85d0b..e76bfcb 100644
--- a/src/include/s6-dns/hosts.h
+++ b/src/include/s6-dns/hosts.h
@@ -13,11 +13,8 @@ extern cdb s6dns_hosts_here ;
extern int s6dns_hosts_compile (int, int) ;
-extern int s6dns_hosts_init_r (cdb *, char const *, char const *, char const *) ;
-#define s6dns_hosts_init() s6dns_hosts_init_r(&s6dns_hosts_here, "/etc/hosts", "/etc/hosts.cdb", "/tmp/hosts.cdb")
-#define s6dns_hosts_free_r(c) cdb_free(c)
-#define s6dns_hosts_free() s6dns_hosts_free_r(&s6dns_hosts_here)
-
+extern int s6dns_hosts_init (cdb *, char const *, char const *, char const *) ;
+#define s6dns_hosts_free(c) cdb_free(c)
/* IP to name */
@@ -41,8 +38,8 @@ extern int s6dns_hosts_ip_string_r (cdb const *, char const *, stralloc *, unsig
#define s6dns_hosts_ip_noq(name, sa, is6) s6dns_hosts_ip_noq_r(&s6dns_hosts_here, (name), sa, is6)
#define s6dns_hosts_ip_unq(name, sa, is6) s6dns_hosts_ip_unq_r(&s6dns_hosts_here, (name), sa, is6)
-#define s6dns_hosts_a_string_r(c, name, sa, isalias) s6dns_hosts_ip_string_r(c, name, sa, !!(isunq) << 1)
-#define s6dns_hosts_aaaa_string_r(c, name, sa, isalias) s6dns_hosts_ip_string_r(c, name, sa, (!!(isunq) << 1) | 1)
+#define s6dns_hosts_a_string_r(c, name, sa, isunq) s6dns_hosts_ip_string_r(c, name, sa, !!(isunq) << 1)
+#define s6dns_hosts_aaaa_string_r(c, name, sa, isunq) s6dns_hosts_ip_string_r(c, name, sa, (!!(isunq) << 1) | 1)
extern int s6dns_hosts_aaaaa_string_r (cdb const *, char const *, genalloc *, int) ;
#define s6dns_hosts_a_string(name, sa, isunq) s6dns_hosts_a_string_r(&s6dns_hosts_here, (name), sa, isunq)
@@ -68,14 +65,14 @@ extern int s6dns_hosts_aaaaa_string_r (cdb const *, char const *, genalloc *, in
/* name to IP, with qualification */
-extern int s6dns_hosts_ip_q_r (cdb const *, char const *, stralloc *sa, char const *, unsigned int, int) ;
-#define s6dns_hosts_a_q_r(c, name, sa, rules, rulesnum) s6dns_hosts_ip_q_r(c, name, sa, rules, rulesnum, 0)
-#define s6dns_hosts_aaaa_q_r(c, name, rules, rulesnum, sa) s6dns_hosts_ip_q_r(c, name, sa, rules, rulesnum, 1)
+extern int s6dns_hosts_ip_q_r (cdb const *, char const *, stralloc *, char const *, unsigned int, int) ;
+#define s6dns_hosts_a_q_r(c, name, sa, rules, rulesnum) s6dns_hosts_ip_q_r(c, name, sa, rules, (rulesnum), 0)
+#define s6dns_hosts_aaaa_q_r(c, name, sa, rules, rulesnum) s6dns_hosts_ip_q_r(c, name, sa, rules, (rulesnum), 1)
extern int s6dns_hosts_aaaaa_q_r (cdb const *, char const *, genalloc *, char const *, unsigned int) ;
#define s6dns_hosts_ip_q(name, sa, is6) s6dns_hosts_ip_q_r(&s6dns_hosts_here, (name), sa, s6dns_rci_here.rules.s, s6dns_rci_here.rulesnum, is6)
#define s6dns_hosts_a_q(name, sa) s6dns_hosts_a_q_r(&s6dns_hosts_here, (name), sa, s6dns_rci_here.rules.s, s6dns_rci_here.rulesnum)
-#define s6dns_hosts_aaaa_q(name, sa) s6dns_hosts_ip_q_r(&s6dns_hosts_here, (name), sa, s6dns_rci_here.rules.s, s6dns_rci_here.rulesnum)
-#define s6dns_hosts_aaaaa_q(name, ga) s6dns_hosts_aaaaa_q_r(&s6dns_hosts_here, (name), ga)
+#define s6dns_hosts_aaaa_q(name, sa) s6dns_hosts_aaaa_q_r(&s6dns_hosts_here, (name), sa, s6dns_rci_here.rules.s, s6dns_rci_here.rulesnum)
+#define s6dns_hosts_aaaaa_q(name, ga) s6dns_hosts_aaaaa_q_r(&s6dns_hosts_here, (name), ga, s6dns_rci_here.rules.s, s6dns_rci_here.rulesnum)
#endif
diff --git a/src/include/s6-dns/skadns.h b/src/include/s6-dns/skadns.h
index 8f27d2e..32e3648 100644
--- a/src/include/s6-dns/skadns.h
+++ b/src/include/s6-dns/skadns.h
@@ -5,10 +5,12 @@
#include <stdint.h>
#include <errno.h>
+
#include <skalibs/tai.h>
#include <skalibs/genalloc.h>
#include <skalibs/gensetdyn.h>
#include <skalibs/textclient.h>
+
#include <s6-dns/config.h>
#include <s6-dns/s6dns-domain.h>