Commit 9bddf379 authored by Daniel Salzman's avatar Daniel Salzman

zscanner: move to libzscanner

parent 2faf8f99
......@@ -17,8 +17,8 @@
/Makefile.in
/src/Makefile
/src/Makefile.in
/src/zscanner/Makefile
/src/zscanner/Makefile.in
/src/libzscanner/Makefile
/src/libzscanner/Makefile.in
/python/Makefile
/python/Makefile.in
/samples/Makefile
......@@ -66,9 +66,9 @@
/src/contrib/dnstap/dnstap.pb-c.h
# zscanner
/src/zscanner/libzscanner.pc
/src/zscanner/scanner.c
/src/zscanner/version.h
/src/libzscanner/libzscanner.pc
/src/libzscanner/scanner.c
/src/libzscanner/version.h
# Binaries
/src/kdig
......
......@@ -784,7 +784,7 @@ WARN_LOGFILE = doc/html/doxygen.warn
INPUT = Doxy.page.h \
src/libdnssec \
src/libknot \
src/zscanner \
src/libzscanner \
src/knot/include
# This tag can be used to specify the character encoding of the source files
......
......@@ -359,6 +359,13 @@ src/libknot/yparser/ypschema.c
src/libknot/yparser/ypschema.h
src/libknot/yparser/yptrafo.c
src/libknot/yparser/yptrafo.h
src/libzscanner/error.c
src/libzscanner/error.h
src/libzscanner/functions.c
src/libzscanner/functions.h
src/libzscanner/scanner.h
src/libzscanner/scanner.rl
src/libzscanner/scanner_body.rl
src/utils/common/cert.c
src/utils/common/cert.h
src/utils/common/exec.c
......@@ -414,13 +421,6 @@ src/utils/knsupdate/knsupdate_params.h
src/utils/kzonecheck/main.c
src/utils/kzonecheck/zone_check.c
src/utils/kzonecheck/zone_check.h
src/zscanner/error.c
src/zscanner/error.h
src/zscanner/functions.c
src/zscanner/functions.h
src/zscanner/scanner.h
src/zscanner/scanner.rl
src/zscanner/scanner_body.rl
tests-fuzz/fuzz_packet.c
tests-fuzz/fuzz_zscanner.c
tests-fuzz/knotd_wrap/afl-loop.h
......@@ -513,10 +513,10 @@ tests/libknot/test_wire.c
tests/libknot/test_yparser.c
tests/libknot/test_ypschema.c
tests/libknot/test_yptrafo.c
tests/libzscanner/processing.c
tests/libzscanner/processing.h
tests/libzscanner/zscanner-tool.c
tests/modules/test_onlinesign.c
tests/modules/test_rrl.c
tests/utils/test_cert.c
tests/utils/test_lookup.c
tests/zscanner/processing.c
tests/zscanner/processing.h
tests/zscanner/zscanner-tool.c
......@@ -2,7 +2,7 @@ src
src/contrib
src/libdnssec
src/libdnssec/shared
src/zscanner
src/libzscanner
tests
tests-fuzz
tests-fuzz/knotd_wrap
......@@ -17,10 +17,10 @@ CODE_COVERAGE_INFO = coverage.info
CODE_COVERAGE_HTML = coverage.html
CODE_COVERAGE_DIRS = \
src/contrib \
src/libdnssec \
src/knot \
src/libdnssec \
src/libknot \
src/zscanner
src/libzscanner
code_coverage_quiet = --quiet
......
......@@ -24,8 +24,8 @@ AC_SUBST([KNOT_VERSION_PATCH], knot_VERSION_PATCH)
AC_SUBST([KNOT_VERSION_EXTRA], knot_VERSION_EXTRA)
AC_CONFIG_FILES([src/libknot/version.h
src/zscanner/version.h
src/libdnssec/version.h])
src/libdnssec/version.h
src/libzscanner/version.h])
# Store ./configure parameters into macro
AC_DEFINE_UNQUOTED([CONFIGURE_PARAMS],["$configure_params"],[Params passed to configure])
......@@ -62,7 +62,7 @@ m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], ['${libdi
AC_CONFIG_FILES([src/knotd.pc
src/libknot.pc
src/libdnssec/libdnssec.pc
src/zscanner/libzscanner.pc
src/libzscanner/libzscanner.pc
])
# Build Knot DNS daemon
......@@ -588,9 +588,9 @@ AC_CONFIG_FILES([Makefile
python/Makefile
src/Makefile
src/contrib/dnstap/Makefile
src/libdnssec/Makefile
src/knot/modules/static_modules.h
src/zscanner/Makefile
src/libdnssec/Makefile
src/libzscanner/Makefile
])
AC_CONFIG_FILES([src/utils/pykeymgr/pykeymgr], [chmod +x src/utils/pykeymgr/pykeymgr])
......
......@@ -6,7 +6,7 @@ IN="./scanner.rl"
OUT_T0="./scanner.c.t0"
OUT_G2="./scanner.c.g2"
pushd ../src/zscanner/
pushd ../src/libzscanner/
# Generate slower/small zone parser.
ragel -T0 -s -o $OUT_T0 $IN
......
ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4
SUBDIRS = zscanner libdnssec contrib/dnstap .
SUBDIRS = libzscanner libdnssec contrib/dnstap .
lib_LTLIBRARIES = \
libknot.la
......@@ -364,7 +364,7 @@ libknotd_la_SOURCES = \
libknotd_la_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAG_VISIBILITY) $(systemd_CFLAGS) \
$(liburcu_CFLAGS) -DKNOTD_MOD_STATIC
libknotd_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^knotd_'
libknotd_la_LIBADD = libknot.la zscanner/libzscanner.la $(systemd_LIBS) \
libknotd_la_LIBADD = libknot.la libzscanner/libzscanner.la $(systemd_LIBS) \
$(liburcu_LIBS)
###################
......@@ -411,7 +411,7 @@ knotc_LDADD = libknotd.la libcontrib.la libknotus.la $(libedit_LIBS)
knotc_LDFLAGS = $(AM_LDFLAGS) -rdynamic
keymgr_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/libdnssec $(gnutls_CFLAGS)
keymgr_LDADD = libknotd.la libcontrib.la libknotus.la libdnssec/libdnssec.la \
libdnssec/libshared.la zscanner/libzscanner.la
libdnssec/libshared.la libzscanner/libzscanner.la
####################################
# Optional Knot DNS Daemon modules #
......@@ -476,7 +476,7 @@ kdig_LDADD = libknotus.la
khost_CPPFLAGS = $(AM_CPPFLAGS) $(gnutls_CFLAGS)
khost_LDADD = libknotus.la
knsupdate_CPPFLAGS = $(AM_CPPFLAGS) $(gnutls_CFLAGS)
knsupdate_LDADD = libknotus.la zscanner/libzscanner.la
knsupdate_LDADD = libknotus.la libzscanner/libzscanner.la
knsec3hash_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/libdnssec
knsec3hash_LDADD = libknot.la libcontrib.la libdnssec/libdnssec.la libdnssec/libshared.la
kzonecheck_CPPFLAGS = $(AM_CPPFLAGS)
......
......@@ -35,7 +35,7 @@
#include "contrib/mempattern.h"
#include "contrib/string.h"
#include "contrib/ucw/lists.h"
#include "zscanner/scanner.h"
#include "libzscanner/scanner.h"
#include "contrib/strtonum.h"
#define MATCH_OR_FILTER(args, code) ((args)->data[KNOT_CTL_IDX_FILTER] == NULL || \
......
......@@ -21,7 +21,7 @@
#include "knot/zone/zone.h"
#include "knot/zone/semantic-check.h"
#include "zscanner/scanner.h"
#include "libzscanner/scanner.h"
/*!
* \brief Zone creator structure.
*/
......
......@@ -16,7 +16,7 @@
#include <stdlib.h>
#include "zscanner/error.h"
#include "libzscanner/error.h"
typedef struct {
int code;
......
......@@ -17,8 +17,8 @@
#include <stdint.h>
#include <stdlib.h>
#include "zscanner/error.h"
#include "zscanner/functions.h"
#include "libzscanner/error.h"
#include "libzscanner/functions.h"
const uint8_t digit_to_num[] = {
['0'] = 0, ['1'] = 1, ['2'] = 2, ['3'] = 3, ['4'] = 4,
......
......@@ -31,8 +31,8 @@
#include <sys/types.h>
#include <unistd.h>
#include "zscanner/scanner.h"
#include "zscanner/functions.h"
#include "libzscanner/scanner.h"
#include "libzscanner/functions.h"
#include "libknot/descriptor.h"
/*! \brief Maximal length of rdata item. */
......@@ -31,8 +31,8 @@
#include <sys/types.h>
#include <unistd.h>
#include "zscanner/scanner.h"
#include "zscanner/functions.h"
#include "libzscanner/scanner.h"
#include "libzscanner/functions.h"
#include "libknot/descriptor.h"
/*! \brief Maximal length of rdata item. */
......
......@@ -28,7 +28,7 @@
#include <stddef.h>
#include <stdint.h>
#include "zscanner/error.h"
#include "libzscanner/error.h"
/*! \brief Maximal length of rdata. */
#define ZS_MAX_RDATA_LENGTH 65535
......@@ -95,8 +95,8 @@ typedef enum {
* - Output variables (r_ prefix) containing all parts of zone record. These
* data are useful during processing via callback function.
*/
typedef struct scanner zs_scanner_t; // Forward declaration due to arguments.
struct scanner {
typedef struct zs_scanner zs_scanner_t; // Forward declaration due to arguments.
struct zs_scanner {
/*! Current state (Ragel internals). */
int cs;
/*! Stack top (Ragel internals). */
......
......@@ -30,8 +30,8 @@
#include <sys/types.h>
#include <unistd.h>
#include "zscanner/scanner.h"
#include "zscanner/functions.h"
#include "libzscanner/scanner.h"
#include "libzscanner/functions.h"
#include "libknot/descriptor.h"
/*! \brief Maximal length of rdata item. */
......
......@@ -30,7 +30,7 @@
#include "libdnssec/shared/shared.h"
#include "knot/dnssec/kasp/policy.h"
#include "knot/dnssec/zone-keys.h"
#include "zscanner/scanner.h"
#include "libzscanner/scanner.h"
static bool is_timestamp(char *arg, knot_kasp_key_timing_t *timing)
{
......
......@@ -25,7 +25,7 @@
#pragma once
#include "contrib/qp-trie/trie.h"
#include "zscanner/scanner.h"
#include "libzscanner/scanner.h"
/*!
* \brief Memory estimation context.
......
......@@ -32,7 +32,7 @@
#include "utils/common/params.h"
#include "utils/common/sign.h"
#include "libknot/libknot.h"
#include "zscanner/scanner.h"
#include "libzscanner/scanner.h"
#include "contrib/ucw/lists.h"
/*! \brief knsupdate-specific params data. */
......
......@@ -42,7 +42,7 @@ fuzz_packet_LDADD = $(top_builddir)/src/libknot.la
fuzz_zscanner_SOURCES = fuzz_zscanner.c
fuzz_zscanner_CPPFLAGS = $(AM_CPPFLAGS)
fuzz_zscanner_LDADD = $(top_builddir)/src/zscanner/libzscanner.la
fuzz_zscanner_LDADD = $(top_builddir)/src/libzscanner/libzscanner.la
if OSS_FUZZ
......
......@@ -16,7 +16,7 @@
#include <stdint.h>
#include "zscanner/scanner.h"
#include "libzscanner/scanner.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
......
......@@ -16,26 +16,6 @@
/contrib/test_time
/contrib/test_wire_ctx
/libdnssec/test_binary
/libdnssec/test_crypto
/libdnssec/test_key
/libdnssec/test_key_algorithm
/libdnssec/test_key_ds
/libdnssec/test_keyid
/libdnssec/test_keystore_pkcs11
/libdnssec/test_keystore_pkcs8
/libdnssec/test_keystore_pkcs8_dir
/libdnssec/test_keytag
/libdnssec/test_list
/libdnssec/test_nsec_bitmap
/libdnssec/test_nsec_hash
/libdnssec/test_random
/libdnssec/test_sign
/libdnssec/test_sign_der
/libdnssec/test_shared_bignum
/libdnssec/test_shared_dname
/libdnssec/test_tsig
/knot/test_acl
/knot/test_changeset
/knot/test_conf
......@@ -62,6 +42,26 @@
/knot/test_zone_timers
/knot/test_zonedb
/libdnssec/test_binary
/libdnssec/test_crypto
/libdnssec/test_key
/libdnssec/test_key_algorithm
/libdnssec/test_key_ds
/libdnssec/test_keyid
/libdnssec/test_keystore_pkcs11
/libdnssec/test_keystore_pkcs8
/libdnssec/test_keystore_pkcs8_dir
/libdnssec/test_keytag
/libdnssec/test_list
/libdnssec/test_nsec_bitmap
/libdnssec/test_nsec_hash
/libdnssec/test_random
/libdnssec/test_sign
/libdnssec/test_sign_der
/libdnssec/test_shared_bignum
/libdnssec/test_shared_dname
/libdnssec/test_tsig
/libknot/test_control
/libknot/test_cookies
/libknot/test_db
......@@ -82,12 +82,12 @@
/libknot/test_yptrafo
/libknot/test_wire
/libzscanner/tmp
/libzscanner/test_zscanner
/libzscanner/zscanner-tool
/modules/test_onlinesign
/modules/test_rrl
/utils/test_cert
/utils/test_lookup
/zscanner/tmp
/zscanner/test_zscanner
/zscanner/zscanner-tool
......@@ -15,15 +15,15 @@ LDADD = \
$(top_builddir)/src/libknot.la \
$(top_builddir)/src/libknotd.la \
$(top_builddir)/src/libcontrib.la \
$(top_builddir)/src/zscanner/libzscanner.la
$(top_builddir)/src/libzscanner/libzscanner.la
EXTRA_DIST = \
libdnssec/sample_keys.h \
knot/semantic_check_data \
knot/test_semantic_check.in \
zscanner/data \
zscanner/test_zscanner.in \
zscanner/TESTS
libzscanner/data \
libzscanner/test_zscanner.in \
libzscanner/TESTS
check_PROGRAMS = \
contrib/test_base32hex \
......@@ -154,16 +154,16 @@ utils_test_cert_LDADD = \
$(libedit_LIBS)
EXTRA_PROGRAMS = \
zscanner/zscanner-tool
libzscanner/zscanner-tool
zscanner_zscanner_tool_SOURCES = \
zscanner/zscanner-tool.c \
zscanner/processing.h \
zscanner/processing.c
libzscanner_zscanner_tool_SOURCES = \
libzscanner/zscanner-tool.c \
libzscanner/processing.h \
libzscanner/processing.c
check_SCRIPTS = \
knot/test_semantic_check \
zscanner/test_zscanner
libzscanner/test_zscanner
edit = $(SED) \
-e 's|@top_srcdir[@]|$(abs_top_srcdir)|g' \
......@@ -173,7 +173,7 @@ knot/test_semantic_check:
@$(edit) < $(top_srcdir)/tests/$@.in > $(top_builddir)/tests/$@
@chmod +x $(top_builddir)/tests/$@
zscanner/test_zscanner: zscanner/zscanner-tool
libzscanner/test_zscanner: libzscanner/zscanner-tool
@$(edit) < $(top_srcdir)/tests/$@.in > $(top_builddir)/tests/$@
@chmod +x $(top_builddir)/tests/$@
......
......@@ -23,7 +23,7 @@
#include "contrib/getline.h"
#include "knot/updates/zone-update.h"
#include "knot/zone/node.h"
#include "zscanner/scanner.h"
#include "libzscanner/scanner.h"
#include "knot/server/server.h"
static const char *zone_str1 = "test. 600 IN SOA ns.test. m.test. 1 900 300 4800 900 \n";
......