Skip to content

Commit

Permalink
Merge branch 'next' for the 0.10.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
reedjc committed Dec 4, 2019
2 parents dcaa5bd + 9e70b71 commit b6482ac
Show file tree
Hide file tree
Showing 32 changed files with 658 additions and 179 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.*swp
*.gcda
*.gcno
*.la
*.lo
*.o
Expand All @@ -11,6 +13,9 @@
/build-aux
/config.*
/configure
/coverage-html
/coverage.info
/coveragereport
/libtool
/stamp-h1
/test-suite.log
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2009-2017 by Farsight Security, Inc.
Copyright (c) 2009-2019 by Farsight Security, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
34 changes: 31 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
wdns (0.10.0)

* Handle corner case of NSEC3 hash field with length zero.

* Preserve name case when parsing rdata strings.

* Fix printing of bitmap entries for rrtypes larger than 255.
Improve rrtype sorting.

* Preserve character-string boundaries when formatting TXT rdata.

* Add ./configure --with-coverage option to build with code coverage
and make targets: clean-coverage to remove the coverage data and results
and report-coverage to generate report (after running the code such as
with "make check").

* Configure check for python which is used to generate some of the C code.

* Lots of compiler warning cleanups.

* Unit testing improvements and additional tests added.

* Added library versioning API: wdns_get_version() and
wdns_get_version_number() available at run-time and WDNS_LIBRARY_VERSION
and WDNS_LIBRARY_VERSION_NUMBER for compile-time.

-- Farsight Security, Inc. <[email protected]> Wed, 27 Nov 2019 13:03:14 -0500

wdns (0.9.1)

* t/: Fix format specifiers for size_t in some tests.
* t/: Fix format specifiers for size_t in some tests.

* Add README.md.
* Add README.md.

* Don't install the compiled example programs.
* Don't install the compiled example programs.

-- Farsight Security <[email protected]> Tue, 3 Jan 2017 17:56:25 +0000

Expand Down
78 changes: 66 additions & 12 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ noinst_PROGRAMS =
TESTS =
EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}

EXTRA_DIST += COPYRIGHT
Expand All @@ -13,28 +14,67 @@ EXTRA_DIST += README.md
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I$(top_srcdir)/wdns
AM_CFLAGS = $(my_CFLAGS)
AM_CFLAGS = $(my_CFLAGS) \
-I$(top_builddir)/wdns
AM_LDFLAGS =

LIBWDNS_CURRENT=1
USE_LCOV=@USE_LCOV@
LCOV=@LCOV@
GENHTML=@GENHTML@

clean-coverage:
@if [ $(USE_LCOV) = yes ] ; then \
$(LCOV) --directory . --zerocounters ; \
echo "Removing coverage info files and generated $(abs_top_builddir)/coverage-html/ directory" ; \
rm -rf all.coverage report.coverage ; \
rm -rf $(abs_top_builddir)/coverage-html/ ; \
else \
echo "Code coverage not enabled at configuration time." ; \
echo "Use: ./configure --with-coverage" ; \
fi

report-coverage:
@if [ $(USE_LCOV) = yes ] ; then \
$(LCOV) --capture --directory . --output-file all.coverage ; \
$(LCOV) --remove all.coverage \
$(abs_top_srcdir)/t/\* \
/usr/include/\* \
--output report.coverage ; \
$(GENHTML) --legend -o $(abs_top_builddir)/coverage-html report.coverage ; \
echo "Generated Code Coverage report in HTML at $(abs_top_builddir)/coverage-html" ; \
else \
echo "Code coverage not enabled at configuration time." ; \
echo "Use: ./configure --with-coverage" ; \
fi

#
##
### library
##
#

LIBWDNS_CURRENT=3
LIBWDNS_REVISION=0
LIBWDNS_AGE=0
LIBWDNS_AGE=2

include_HEADERS = wdns/wdns.h
lib_LTLIBRARIES = wdns/libwdns.la

EXTRA_DIST += wdns/gen_rcode_to_str
EXTRA_DIST += wdns/gen_rrclass_to_str
EXTRA_DIST += wdns/gen_rrtype_to_str
DISTCLEANFILES += wdns/rrtype_to_str.c \
wdns/rcode_to_str.c \
wdns/rrclass_to_str.c

wdns/rcode_to_str.c: wdns/wdns.h wdns/gen_rcode_to_str
$(AM_V_GEN)wdns/gen_rcode_to_str wdns/wdns.h wdns/rcode_to_str.c
$(PYTHON) $(top_srcdir)/wdns/gen_rcode_to_str wdns/wdns.h wdns/rcode_to_str.c

wdns/rrclass_to_str.c: wdns/wdns.h wdns/gen_rrclass_to_str
$(AM_V_GEN)wdns/gen_rrclass_to_str wdns/wdns.h wdns/rrclass_to_str.c
$(PYTHON) $(top_srcdir)/wdns/gen_rrclass_to_str wdns/wdns.h wdns/rrclass_to_str.c

wdns/rrtype_to_str.c: wdns/wdns.h wdns/gen_rrtype_to_str
$(AM_V_GEN)wdns/gen_rrtype_to_str wdns/wdns.h wdns/rrtype_to_str.c
$(PYTHON) $(top_srcdir)/wdns/gen_rrtype_to_str wdns/wdns.h wdns/rrtype_to_str.c

wdns_libwdns_la_CPPFLAGS = \
-include $(top_builddir)/wdns/wdns-private.h
Expand Down Expand Up @@ -107,7 +147,8 @@ wdns_libwdns_la_SOURCES = \
wdns/skip_name.c \
wdns/str_to_name.c \
wdns/str_to_rdata_ubuf.c \
wdns/unpack_name.c
wdns/unpack_name.c \
wdns/version.c

pkgconfig_DATA = wdns/libwdns.pc
EXTRA_DIST += wdns/libwdns.pc.in
Expand All @@ -127,6 +168,12 @@ examples_wdns_dump_pcap_SOURCES = \
examples/wdns-dump-pcap.c
endif

noinst_PROGRAMS += examples/wdns-print-version
examples_wdns_print_version_LDADD = wdns/libwdns.la
examples_wdns_print_version_SOURCES = \
examples/private.h \
examples/wdns-print-version.c

noinst_PROGRAMS += examples/wdns-test-deserialize-rrset
examples_wdns_test_deserialize_rrset_LDADD = wdns/libwdns.la
examples_wdns_test_deserialize_rrset_SOURCES = \
Expand Down Expand Up @@ -161,30 +208,37 @@ examples_wdns_test_serialize_rrset_SOURCES = \
##
#

EXTRA_DIST += t/test-common.h

AM_TESTS_ENVIRONMENT = top_builddir='$(top_builddir)'; top_srcdir='$(top_srcdir)'; export top_builddir top_srcdir;
TESTS_ENVIRONMENT = $(AM_TESTS_ENVIRONMENT)

TESTS += t/test-name_to_str
check_PROGRAMS += t/test-name_to_str
t_test_name_to_str_SOURCES = t/test-name_to_str.c t/test-common.c
t_test_name_to_str_LDADD = wdns/libwdns.la

TESTS += t/test-str_to_name
check_PROGRAMS += t/test-str_to_name
t_test_str_to_name_SOURCES = t/test-str_to_name.c
t_test_str_to_name_SOURCES = t/test-str_to_name.c t/test-common.c
t_test_str_to_name_LDADD = wdns/libwdns.la

TESTS += t/test-str_to_rcode
check_PROGRAMS += t/test-str_to_rcode
t_test_str_to_rcode_SOURCES = t/test-str_to_rcode.c
t_test_str_to_rcode_SOURCES = t/test-str_to_rcode.c t/test-common.c
t_test_str_to_rcode_LDADD = wdns/libwdns.la

TESTS += t/test-str_to_rdata
check_PROGRAMS += t/test-str_to_rdata
t_test_str_to_rdata_SOURCES = t/test-str_to_rdata.c
t_test_str_to_rdata_SOURCES = t/test-str_to_rdata.c t/test-common.c
t_test_str_to_rdata_LDADD = wdns/libwdns.la

TESTS += t/test-rdata_to_str
check_PROGRAMS += t/test-rdata_to_str
t_test_rdata_to_str_SOURCES = t/test-rdata_to_str.c
t_test_rdata_to_str_SOURCES = t/test-rdata_to_str.c t/test-common.c
t_test_rdata_to_str_LDADD = wdns/libwdns.la

TESTS += t/test-str_to_rrtype
check_PROGRAMS += t/test-str_to_rrtype
t_test_str_to_rrtype_SOURCES = t/test-str_to_rrtype.c
t_test_str_to_rrtype_SOURCES = t/test-str_to_rrtype.c t/test-common.c
t_test_str_to_rrtype_LDADD = wdns/libwdns.la
58 changes: 55 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
AC_PREREQ(2.64)

m4_define(wdns_major_version, 0)
m4_define(wdns_minor_version, 10)
m4_define(wdns_patchlevel_version, 0)
m4_define(wdns_version,
wdns_major_version.wdns_minor_version.wdns_patchlevel_version)

AC_INIT([wdns],
[0.9.1],
[wdns_version()],
[https://github.com/farsightsec/wdns/issues],
[wdns],
[https://github.com/farsightsec/wdns])
AC_CONFIG_SRCDIR([wdns/wdns.h])
AC_CONFIG_SRCDIR([wdns/wdns.h.in])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules subdir-objects])
AC_PROG_CC_STDC
Expand All @@ -14,8 +21,18 @@ AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
LT_INIT

WDNS_MAJOR_VERSION=wdns_major_version()
WDNS_MINOR_VERSION=wdns_minor_version()
WDNS_PATCHLEVEL_VERSION=wdns_patchlevel_version()
WDNS_VERSION=wdns_version()

AC_SUBST(WDNS_MAJOR_VERSION)
AC_SUBST(WDNS_MINOR_VERSION)
AC_SUBST(WDNS_PATCHLEVEL_VERSION)
AC_SUBST(WDNS_VERSION)

AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES([Makefile wdns/libwdns.pc])
AC_CONFIG_FILES([Makefile wdns/libwdns.pc wdns/wdns.h])

PKG_PROG_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
Expand Down Expand Up @@ -53,6 +70,39 @@ AM_CONDITIONAL([LIBPCAP], [test "$have_libpcap" = "true"])

gl_LD_VERSION_SCRIPT

AM_PATH_PYTHON(,, [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])

AC_ARG_WITH(coverage,
[ --with-coverage[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")


USE_LCOV="no"
if test "$lcov" != "no"; then
if test "$lcov" != "yes"; then
LCOV=$lcov
else
AC_PATH_PROG([LCOV], [lcov])
fi
if test -x "${LCOV}"; then
USE_LCOV="yes"
else
AC_MSG_ERROR([Cannot find lcov.])
fi
# is genhtml always in the same directory?
GENHTML=`echo "$LCOV" | ${SED} s/lcov$/genhtml/`
if test ! -x $GENHTML; then
AC_MSG_ERROR([genhtml not found, needed for lcov])
fi
CFLAGS="$CFLAGS --coverage"
LIBS=" $LIBS -lgcov"
AC_SUBST(CPPFLAGS)
AC_SUBST(LIBS)
AC_SUBST(LCOV)
AC_SUBST(GENHTML)
fi
AC_SUBST(USE_LCOV)

AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
Expand All @@ -67,4 +117,6 @@ AC_MSG_RESULT([
libdir: ${libdir}
includedir: ${includedir}
pkgconfigdir: ${pkgconfigdir}
code coverage enabled: ${USE_LCOV}
])
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wdns (0.10.0-1) debian-fsi; urgency=medium

* New release.

-- Farsight Security, Inc. <[email protected]> Wed, 27 Nov 2019 13:03:14 -0500

wdns (0.9.1-1) wheezy-farsightsec; urgency=medium

* New release.
Expand Down
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Build-Depends:
debhelper (>= 9~),
dh-autoreconf (>= 5~),
dpkg-dev (>= 1.16.0~),
lcov,
pkg-config,
python,
Standards-Version: 3.9.6
Standards-Version: 3.9.8

Package: libwdns-dev
Section: libdevel
Expand Down
2 changes: 1 addition & 1 deletion debian/copyright
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/

Files: *
Copyright: 2009-2015 by Farsight Security, Inc.
Copyright: 2009-2019 by Farsight Security, Inc.
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
Expand Down
3 changes: 3 additions & 0 deletions debian/libwdns1.docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ChangeLog
COPYRIGHT
README.md
3 changes: 3 additions & 0 deletions debian/libwdns1.symbols
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
libwdns.so.1 libwdns1 #MINVER#
LIBWDNS_0.10.0@LIBWDNS_0.10.0 0.10.0
LIBWDNS_0.6.0@LIBWDNS_0.6.0 0.6.0
LIBWDNS_0.7.0@LIBWDNS_0.7.0 0.7.0
LIBWDNS_0.8.0@LIBWDNS_0.8.0 0.8.0
Expand All @@ -15,6 +16,8 @@ libwdns.so.1 libwdns1 #MINVER#
wdns_downcase_rdata@LIBWDNS_0.6.0 0.6.0
wdns_downcase_rrset@LIBWDNS_0.6.0 0.6.0
wdns_file_load_names@LIBWDNS_0.6.0 0.6.0
wdns_get_version@LIBWDNS_0.10.0 0.10.0
wdns_get_version_number@LIBWDNS_0.10.0 0.10.0
wdns_is_subdomain@LIBWDNS_0.6.0 0.6.0
wdns_left_chop@LIBWDNS_0.6.0 0.6.0
wdns_len_uname@LIBWDNS_0.6.0 0.6.0
Expand Down
2 changes: 1 addition & 1 deletion examples/wdns-dump-pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ packet_handler(u_char *dumper,
packet_dump(dumper, hdr, pkt);
}

VERBOSE("\n");
VERBOSE("%s", "\n");
return;
}

Expand Down
27 changes: 27 additions & 0 deletions examples/wdns-print-version.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>

#include <wdns.h>

int
main(void) {

/* to do compile-time checking, do something like the following: */
#if WDNS_LIBRARY_VERSION_NUMBER > 9001
printf("your install of libwdns supports compile-time versioning ");
printf("(WDNS_LIBRARY_VERSION_NUMBER == %lu)\n",
WDNS_LIBRARY_VERSION_NUMBER);
/* to do run-time checking, do something like the following: */
printf("libwdns run-time version is %d\n", wdns_get_version_number());

/* and to emit a stringified version number, do this: */
printf("this program was linked against libwdns version %s\n",
wdns_get_version());
return (EXIT_SUCCESS);
#else
printf("your install of libwdns predates versioning, consider an upgrade\n");
return (EXIT_SUCCESS);
#endif
}
2 changes: 1 addition & 1 deletion libmy/ubuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "vector.h"

VECTOR_GENERATE(ubuf, uint8_t);
VECTOR_GENERATE(ubuf, uint8_t)

static inline ubuf *
ubuf_new(void)
Expand Down
Loading

0 comments on commit b6482ac

Please sign in to comment.