From: Otto Moerbeek Date: Wed, 10 Jul 2024 09:58:05 +0000 (+0200) Subject: NOD handling X-Git-Tag: rec-5.2.0-alpha1~173^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09db482bcadb792d0e978024edeae066934b80dc;p=thirdparty%2Fpdns.git NOD handling --- diff --git a/ext/probds/meson.build b/ext/probds/meson.build new file mode 100644 index 0000000000..00ff3d8a3b --- /dev/null +++ b/ext/probds/meson.build @@ -0,0 +1,12 @@ +lib_probds = static_library( + 'probds', + 'murmur3.cc', + extra_files: [ + 'murmur3.h', + ], +) + +dep_probds = declare_dependency( + link_with: lib_probds, + include_directories: include_directories('.'), +) diff --git a/meson/boost-filesystem/meson.build b/meson/boost-filesystem/meson.build new file mode 100644 index 0000000000..8f0c5d7780 --- /dev/null +++ b/meson/boost-filesystem/meson.build @@ -0,0 +1,2 @@ +dep_boost_filesystem = dependency('boost', modules: ['filesystem'], required: false) +summary('Filesystem', dep_boost_filesystem.found(), bool_yn: true, section: 'Boost') diff --git a/meson/nod/meson.build b/meson/nod/meson.build new file mode 100644 index 0000000000..ad0c2f418a --- /dev/null +++ b/meson/nod/meson.build @@ -0,0 +1,13 @@ +opt_nod = get_option('nod') + +if not dep_boost_filesystem.found() and opt_nod + error('NOD support was requested but boost filesystem module not found') +endif + +enable_nod = dep_boost_filesystem.found() and opt_nod +dep_nod = declare_dependency( + dependencies: [dep_boost_filesystem, dep_probds], +) + +conf.set('NOD_ENABLED', enable_nod, description: 'NOD') +summary('NOD', enable_nod, bool_yn: true, section: 'Configuration') diff --git a/pdns/recursordist/ext/probds/meson.build b/pdns/recursordist/ext/probds/meson.build new file mode 120000 index 0000000000..4e5e7a6dd3 --- /dev/null +++ b/pdns/recursordist/ext/probds/meson.build @@ -0,0 +1 @@ +../../../../ext/probds/meson.build \ No newline at end of file diff --git a/pdns/recursordist/meson.build b/pdns/recursordist/meson.build index 5b0c5dc1b3..6b868e0c9d 100644 --- a/pdns/recursordist/meson.build +++ b/pdns/recursordist/meson.build @@ -54,6 +54,7 @@ subdir('meson' / 'clock-gettime') # Clock_gettime subdir('meson' / 'boost') # Boost subdir('meson' / 'boost-context') # Boost Context Switching Library subdir('meson' / 'boost-test') # Boost Testing Library +subdir('meson' / 'boost-filesystem') # Boost File System Library subdir('meson' / 'reproducible') # Reproducible Builds subdir('meson' / 'libsystemd') # Systemd notification subdir('meson' / 'systemd') # Systemd and unit file handling @@ -83,7 +84,9 @@ subdir('ext' / 'arc4random') subdir('ext' / 'json11') subdir('ext' / 'luawrapper') subdir('ext' / 'protozero') +subdir('ext' / 'probds') subdir('ext' / 'yahttp') +subdir('meson' / 'nod') # Newly Observed Domains common_sources += files( src_dir / 'aggressive_nsec.cc', @@ -183,6 +186,12 @@ conditional_sources = { ], 'condition': dep_dnstap.found(), }, + 'nod': { + 'sources': [ + src_dir / 'nod.cc', + ], + 'condition': dep_nod.found(), + }, } foreach name, info: conditional_sources @@ -279,7 +288,7 @@ libpdns_signers_openssl = declare_dependency( ) ) -# If we have pubsuff.x in the source tree, use it. Otherwise download and build it. +# If we have pubsuffix.cc in the source tree, use it. Otherwise download and build it. pubsuffix_dl_source = 'effective_tld_names.dat' pubsuffix_cc = src_dir / 'pubsuffix.cc' if not fs.is_file(pubsuffix_cc) @@ -356,6 +365,7 @@ tools = { 'manpages': ['pdns_recursor.1'], 'deps-extra': [ dep_boost, + dep_nod, dep_lua, dep_protozero, dep_yahttp, @@ -379,11 +389,8 @@ tools = { }, } -if get_option('unit-tests') - librec_test = declare_dependency( - link_whole: static_library( - 'rec-test', - config_h, +test_sources = [] +test_sources += files( src_dir / 'ednscookies.cc', src_dir / 'test-aggressive_nsec_cc.cc', src_dir / 'test-arguments_cc.cc', @@ -432,10 +439,23 @@ if get_option('unit-tests') src_dir / 'test-syncres_cc8.cc', src_dir / 'test-syncres_cc9.cc', src_dir / 'test-tsig.cc', +) + +if enable_nod + test_sources += files(src_dir / 'test-nod_cc.cc') +endif + +if get_option('unit-tests') + librec_test = declare_dependency( + link_whole: static_library( + 'rec-test', + config_h, + test_sources, dependencies: [ dep_boost, dep_boost_test, dep_lua, + dep_nod, dep_settings, dep_rust_settings, libpdns_signers_openssl, @@ -446,7 +466,9 @@ if get_option('unit-tests') ) tools += { 'testrunner': { - 'main': src_dir / 'testrunner.cc', + 'main': [ + src_dir / 'testrunner.cc', + ], 'deps-extra': [ librec_test, dep_boost_test, diff --git a/pdns/recursordist/meson_options.txt b/pdns/recursordist/meson_options.txt index e950a34a7b..41d0e7f53d 100644 --- a/pdns/recursordist/meson_options.txt +++ b/pdns/recursordist/meson_options.txt @@ -22,3 +22,4 @@ option('socket-dir', type: 'string', value: '/var/run', description: 'Where the option('snmp', type: 'boolean', value: false, description: 'Enable SNMP') option('dnstap', type: 'feature', value: 'auto', description: 'Enable DNSTAP support through libfstrm') option('libcurl', type: 'feature', value: 'auto', description: 'Enable Curl support') +option('nod', type: 'boolean', value: true, description: 'Enable Newly Obserbed Domains')