$(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
$(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
duration.lo duration.o: $(srcdir)/duration.c ldns/config.h $(srcdir)/ldns/duration.h
+edns.lo edns.o: $(srcdir)/edns.c $(srcdir)/ldns/ldns.h $(srcdir)/ldns/common.h
error.lo error.o: $(srcdir)/error.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
#include <ldns/dnssec_verify.h>
#include <ldns/dnssec_sign.h>
#include <ldns/duration.h>
+#include <ldns/edns.h>
#include <ldns/error.h>
#include <ldns/higher.h>
#include <ldns/host2str.h>
#include <ldns/rbtree.h>
#include <ldns/sha1.h>
#include <ldns/sha2.h>
-#include <ldns/edns.h>
#ifdef __cplusplus
extern "C" {
--- /dev/null
+# Standard installation pathnames
+# See the file LICENSE for the license
+SHELL = @SHELL@
+VERSION = @PACKAGE_VERSION@
+basesrcdir = $(shell basename `pwd`)
+srcdir = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+mandir = @mandir@
+datarootdir = @datarootdir@
+
+CC = @CC@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@ @LIBSSL_CPPFLAGS@ -I../..
+LDFLAGS = @LDFLAGS@ @LIBSSL_LDFLAGS@ -L../../.libs
+LIBS = @LIBS@ @LIBSSL_SSL_LIBS@ -lldns
+
+COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS)
+
+HEADER = config.h
+TESTS = 16-unit-tests-edns
+
+.PHONY: all clean realclean
+%.o:
+ $(COMPILE) -c $(srcdir)/$*.c
+
+all: $(TESTS)
+
+13-unit-tests-base: 16-unit-tests-edns.o
+ $(LINK) -o $@ $+ $(LIBS)
+
+clean:
+ rm -f *.o
+ rm -f $(TESTS)
+ rm -f lua-rns
+
+realclean: clean
+ rm -rf autom4te.cache/
+ rm -f config.log config.status aclocal.m4 config.h.in configure Makefile
+ rm -f config.h
+
+confclean: clean
+ rm -rf config.log config.status config.h Makefile
--- /dev/null
+
+
+#include "config.h"
+
+#include <ldns/ldns.h>
+
+static int
+check_option()
+{
+ ldns_edns_option *edns;
+ uint8_t *data = LDNS_XMALLOC(uint8_t, 4);
+ data[0] = 74;
+ data[1] = 65;
+ data[2] = 73;
+ data[3] = 74;
+
+ edns = ldns_edns_new(LDNS_EDNS_EDE, 4, data);
+
+ if (ldns_edns_get_size(edns) != 4) {
+ printf("Error: EDNS size is incorrect\n");
+ return 1;
+ }
+ if (ldns_edns_get_code(edns) != LDNS_EDNS_EDE) {
+ printf("Error: EDNS code is incorrect\n");
+ return 1;
+ }
+ // if (ldns_edns_get_data(edns)) {}
+ // if (ldns_edns_get_wireformat_buffer(edns)) {}
+
+
+
+ // ldns_edns_option *edns2 = ldns_edns_new_from_data(LDNS_EDNS_EDE, size_t size, const void *data);
+
+ return 0;
+}
+
+int main(void)
+{
+ int result = EXIT_SUCCESS;
+
+ if (!check_option()) {
+ printf("check_option() failed.\n");
+ result = EXIT_FAILURE;
+ }
+
+ exit(result);
+}
--- /dev/null
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.57)
+AC_INIT(drill, 1.1.0, ldns-team@nlnetlabs.nl, ldns-team)
+AC_CONFIG_SRCDIR([13-unit-tests-base.c])
+
+AC_AIX
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_MAKE_SET
+
+# Checks for libraries.
+# Checks for header files.
+#AC_HEADER_STDC
+#AC_HEADER_SYS_WAIT
+# do the very minimum - we can always extend this
+AC_CHECK_HEADERS([getopt.h stdlib.h stdio.h assert.h netinet/in.hctype.h time.h])
+AC_CHECK_HEADERS(sys/param.h sys/mount.h,,,
+[
+ [
+ #if HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+ ]
+])
+
+# ssl dir if needed
+AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=PATH], [set ssl library directory]),
+[
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval -L$withval/lib"
+])
+
+# check for ldns
+AC_ARG_WITH(ldns,
+ AC_HELP_STRING([--with-ldns=PATH specify prefix of path of ldns library to use])
+ ,
+ [
+ specialldnsdir="$withval"
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ ]
+)
+
+AC_CHECK_LIB(ldns, ldns_rr_new,, [
+ AC_MSG_ERROR([Can't find ldns library])
+ ]
+)
+
+AC_CHECK_HEADER(ldns/ldns.h,, [
+ AC_MSG_ERROR([Can't find ldns headers])
+ ]
+)
+
+AH_BOTTOM([
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <assert.h>
+
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+])
+
+
+#AC_CHECK_FUNCS([mkdir rmdir strchr strrchr strstr])
+
+#AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
+
+AC_CONFIG_FILES([13-unit-tests-base.Makefile])
+AC_CONFIG_HEADER([config.h])
+AC_OUTPUT
--- /dev/null
+BaseName: 16-unit-tests-edns
+Version: 1.0
+Description: Run EDNS unit tests on base 32 / 64 converters and sha1/sha2 functions
+CreationDate: Wed Mar 15 10:15:57 CET 2006
+Maintainer: Tom Carpay
+Category:
+Component:
+CmdDepends:
+Depends:
+Help:
+Pre: 16-unit-tests-edns.pre
+Post:
+Test: 16-unit-tests-edns.test
+AuxFiles: 16-unit-tests-edns.Makefile.in 16-unit-tests-edns.configure.ac 16-unit-tests-edns.c
+Passed:
+Failure:
--- /dev/null
+# #-- 16-unit-tests-edns.pre--#
+# source the master var file when it's there
+[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
+# use .tpkg.var.test for in test variable passing
+[ -f .tpkg.var.test ] && source .tpkg.var.test
+# svnserve resets the path, you may need to adjust it, like this:
+export PATH=$PATH:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:.
+
+conf=`which autoconf` ||\
+conf=`which autoconf-2.59` ||\
+conf=`which autoconf-2.61` ||\
+conf=`which autoconf259`
+
+hdr=`which autoheader` ||\
+hdr=`which autoheader-2.59` ||\
+hdr=`which autoheader-2.61` ||\
+hdr=`which autoheader259`
+
+mk=`which gmake` ||\
+mk=`which make`
+
+echo "autoconf: $conf"
+echo "autoheader: $hdr"
+echo "make: $mk"
+
+opts=`../../config.status --config`
+echo options: $opts
+
+if [ ! $mk ] || [ ! $conf ] || [ ! $hdr ] ; then
+ echo "Error, one or more build tools not found, aborting"
+ exit 1
+fi;
+
+ssl=``
+if [[ "$OSTYPE" == "darwin"* && -d "/opt/homebrew/Cellar/openssl@1.1" ]]; then
+ ssl=/opt/homebrew/Cellar/openssl@1.1/1.1.1n/
+fi;
+
+#$conf 13-unit-tests-base.configure.ac > configure && \
+#chmod +x configure && \
+#$hdr 13-unit-tests-base.configure.ac &&\
+#eval ./configure --with-ldns=../../ with-ssl=$ssl "$opts" && \
+../../config.status --file 16-unit-tests-edns.Makefile
+$mk -f 16-unit-tests-edns.Makefile
+
--- /dev/null
+# #-- 16-unit-tests-edns.test --#
+# source the master var file when it's there
+[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
+# use .tpkg.var.test for in test variable passing
+[ -f .tpkg.var.test ] && source .tpkg.var.test
+# svnserve resets the path, you may need to adjust it, like this:
+#PATH=$PATH:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:.
+
+export LD_LIBRARY_PATH="../../lib:$LD_LIBRARY_PATH"
+export DYLD_LIBRARY_PATH="../../lib:$DYLD_LIBRARY_PATH"
+
+# run the test
+./16-unit-tests-edns
+exit $?