$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS)
-AM_CFLAGS += -Wall -pedantic
+AM_CFLAGS += -Wall -pedantic -Wno-zero-length-array
noinst_LTLIBRARIES = libdummyrpz.la
libdummyrpz_la_SOURCES= dummylib.c test-data.c trpz.h test-data.h
#include <time.h>
#include <unistd.h>
+#ifdef HAVE_ARPA_NAMESER_COMPAT_H
+#include <arpa/nameser_compat.h>
+#endif /* HAVE_ARPA_NAMESER_COMPAT_H */
+
#include <isc/endian.h>
#include <isc/util.h>
/* If there's CNAME wild card expansion */
if (qname != NULL && qname_size != 0 &&
- (this_rr->type == ns_t_cname) &&
+ (this_rr->type == T_CNAME) &&
(this_rr->rdlength > 2))
{
if (this_rr->rdata[0] == 1 &&
trsp->rstack[0].result.next_rr = this_rr->rrn;
last_result->rridx++;
} else {
- SET_IF_NOT_NULL(typep, ns_t_invalid);
+ SET_IF_NOT_NULL(typep, 0);
if (rrp != NULL) {
*rrp = NULL;
#include <stdlib.h>
#include <unistd.h>
+#ifdef HAVE_ARPA_NAMESER_COMPAT_H
+#include <arpa/nameser_compat.h>
+#endif /* HAVE_ARPA_NAMESER_COMPAT_H */
+
#include <isc/atomic.h>
#include <isc/util.h>
*modified = 0;
- nrec.class = ns_c_in;
+ nrec.class = C_IN;
nrec.ttl = ttl;
nrec.rrn = atomic_fetch_add_relaxed(&rrn, 1);
return (-1);
}
- nrec.type = ns_t_a;
+ nrec.type = T_A;
nrec.rdlength = sizeof(uint32_t);
nrec.rdata = malloc(nrec.rdlength);
return (-1);
}
- nrec.type = ns_t_aaaa;
+ nrec.type = T_AAAA;
nrec.rdlength = sizeof(addr);
nrec.rdata = malloc(nrec.rdlength);
memmove(nrec.rdata, addr, nrec.rdlength);
} else if (!strcasecmp(rrtype, "TXT")) {
- nrec.type = ns_t_txt;
+ nrec.type = T_TXT;
nrec.rdlength = 1 + strlen(val);
nrec.rdata = calloc(nrec.rdlength, 1);
} else if (!strcasecmp(rrtype, "CNAME")) {
int ret;
- nrec.type = ns_t_cname;
+ nrec.type = T_CNAME;
ret = wdns_str_to_name(val, &(nrec.rdata), 1);
if (ret <= 0) {
} else if (!strcasecmp(rrtype, "DNAME")) {
int ret;
- nrec.type = ns_t_dname;
+ nrec.type = T_DNAME;
ret = wdns_str_to_name(val, &(nrec.rdata), 1);
if (ret <= 0) {
* limitations under the License.
*/
-#define LIBRPZ_LIB_OPEN 2
#include <dns/librpz.h>
-#if __NAMESER < 19991006
-/*
- * If the new API is not available define the values we use.
- */
-
-#define ns_c_in 1
-
-#define ns_t_invalid 0
-#define ns_t_a 1
-#define ns_t_cname 5
-#define ns_t_txt 16
-#define ns_t_aaaa 28
-#define ns_t_dname 39
-
-#endif
-
#include "trpz.h"
#define NODE_FLAG_IPV6_ADDRESS 0x1
#
AC_CHECK_HEADERS([threads.h])
+#
+# Also missing from OpenBSD
+#
+AC_CHECK_HEADERS([arpa/nameser_compat.h])
+
#
# C11 Atomic Operations
#
# modern C compiler. It is enabled on systems with dlopen() and librpz.so.
#
dnsrps_avail=yes
-AC_MSG_CHECKING([for librpz __attribute__s])
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[]],
- [[
- extern void f(char *p __attribute__((unused)), ...)
- __attribute__((format(printf,1,2))) __attribute__((__noreturn__));
- ]])],
- [
- librpz_have_attr=yes
- AC_DEFINE([LIBRPZ_HAVE_ATTR], [1], [have __attribute__s used in librpz.h])
- AC_MSG_RESULT([yes])
- ],[
- librpz_have_attr=no
- AC_MSG_RESULT([no])
- ])
# [pairwise: --enable-dnsrps --enable-dnsrps-dl, --disable-dnsrps]
AC_ARG_ENABLE([dnsrps-dl],
[default=yes]])],
[enable_dnsrps_dl="$enableval"], [enable_dnsrps_dl="yes"])
-AS_IF([test "$enable_dnsrps_dl" = "yes" -a "$with_dlopen" = "no"],
- [AC_MSG_ERROR([DNS Response Policy Service delayed link requires dlopen to be enabled])])
-
# [pairwise: skip]
AC_ARG_WITH([dnsrps-libname],
[AS_HELP_STRING([--with-dnsrps-libname],
char c[120];
} librpz_emsg_t;
-#ifdef LIBRPZ_HAVE_ATTR
-#define LIBRPZ_UNUSED ISC_ATTR_UNUSED
-#define LIBRPZ_PF(f, l) __attribute__((format(printf, f, l)))
+#define LIBRPZ_UNUSED __attribute__((__unused__))
+#define LIBRPZ_PF(f, l) __attribute__((__format__(printf, f, l)))
#define LIBRPZ_NORET __attribute__((__noreturn__))
-#else /* ifdef LIBRPZ_HAVE_ATTR */
-#define LIBRPZ_UNUSED
-#define LIBRPZ_PF(f, l)
-#define LIBRPZ_NORET
-#endif /* ifdef LIBRPZ_HAVE_ATTR */
typedef bool(librpz_parse_log_opt_t)(librpz_emsg_t *emsg, const char *arg);
LIBDEF_F(parse_log_opt)