]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
NOD handling
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 10 Jul 2024 09:58:05 +0000 (11:58 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 10 Jul 2024 11:25:48 +0000 (13:25 +0200)
ext/probds/meson.build [new file with mode: 0644]
meson/boost-filesystem/meson.build [new file with mode: 0644]
meson/nod/meson.build [new file with mode: 0644]
pdns/recursordist/ext/probds/meson.build [new symlink]
pdns/recursordist/meson.build
pdns/recursordist/meson_options.txt

diff --git a/ext/probds/meson.build b/ext/probds/meson.build
new file mode 100644 (file)
index 0000000..00ff3d8
--- /dev/null
@@ -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 (file)
index 0000000..8f0c5d7
--- /dev/null
@@ -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 (file)
index 0000000..ad0c2f4
--- /dev/null
@@ -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 (symlink)
index 0000000..4e5e7a6
--- /dev/null
@@ -0,0 +1 @@
+../../../../ext/probds/meson.build
\ No newline at end of file
index 5b0c5dc1b3c38e3c4837f92fc773dd6fa8d5e58c..6b868e0c9d067087edc49f0a5f53c408e9de1278 100644 (file)
@@ -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,
index e950a34a7b5d148445c4749f4b3eac8f718515c6..41d0e7f53dbc310612f580f9ad72b5097d75c5db 100644 (file)
@@ -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')