diff --git a/pdns/dnsdistdist/Makefile.am b/pdns/dnsdistdist/Makefile.am index b921d19594be..f296e58544d2 100644 --- a/pdns/dnsdistdist/Makefile.am +++ b/pdns/dnsdistdist/Makefile.am @@ -151,7 +151,7 @@ dnsdist_SOURCES = \ dns.cc dns.hh \ dns_random.hh \ dnscrypt.cc dnscrypt.hh \ - dnsdist-actions.hh \ + dnsdist-actions.cc dnsdist-actions.hh \ dnsdist-async.cc dnsdist-async.hh \ dnsdist-backend.cc dnsdist-backend.hh \ dnsdist-backoff.hh \ @@ -283,6 +283,7 @@ testrunner_SOURCES = \ credentials.cc credentials.hh \ dns.cc dns.hh \ dnscrypt.cc dnscrypt.hh \ + dnsdist-actions.cc dnsdist-actions.hh \ dnsdist-async.cc dnsdist-async.hh \ dnsdist-backend.cc dnsdist-backend.hh \ dnsdist-backoff.hh \ @@ -498,6 +499,7 @@ dnsdist_SOURCES += doq-common.cc endif if HAVE_YAML_CONFIGURATION +dnsdist_SOURCES += dnsdist-rust-lib/dnsdist-configuration-yaml-items-cxx.cc dnsdist_LDADD += $(DNSDIST_RUST_LIBS) endif diff --git a/pdns/dnsdistdist/dnsdist-actions.cc b/pdns/dnsdistdist/dnsdist-actions.cc new file mode 100644 index 000000000000..859919c53cdb --- /dev/null +++ b/pdns/dnsdistdist/dnsdist-actions.cc @@ -0,0 +1,95 @@ +/* + * This file is part of PowerDNS or dnsdist. + * Copyright -- PowerDNS.COM B.V. and its contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * In addition, for the avoidance of any doubt, permission is granted to + * link this program with OpenSSL and to (re)distribute the binaries + * produced as the result of such linking. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include + +#include + +#include "dnsdist-actions.hh" + +DNSAction::Action DNSAction::typeFromString(const std::string& str) +{ + static const std::unordered_map s_mappings{ + {"allow", Action::Allow }, + {"delay", Action::Delay }, + {"drop", Action::Drop }, + {"headermodify", Action::HeaderModify }, + {"none", Action::None }, + {"noop", Action::NoOp }, + {"norecurse", Action::NoRecurse }, + {"nxdomain", Action::Nxdomain }, + {"pool", Action::Pool }, + {"refused", Action::Refused }, + {"servfail", Action::ServFail }, + {"settag", Action::SetTag }, + {"spoof", Action::Spoof }, + {"spoofpacket", Action::SpoofPacket }, + {"spoofraw", Action::SpoofRaw }, + {"truncate", Action::Truncate }, + }; + + auto lower = boost::to_lower_copy(str); + boost::replace_all(lower, "-", ""); + auto mappingIt = s_mappings.find(lower); + if (mappingIt != s_mappings.end()) { + return mappingIt->second; + } + throw std::runtime_error("Unable to convert '" + str + "' into a DNS Action"); +} + +std::string DNSAction::typeToString(DNSAction::Action action) +{ + switch (action) { + case Action::Drop: + return "Drop"; + case Action::Nxdomain: + return "Send NXDomain"; + case Action::Refused: + return "Send Refused"; + case Action::Spoof: + return "Spoof an answer"; + case Action::SpoofPacket: + return "Spoof a raw answer from bytes"; + case Action::SpoofRaw: + return "Spoof an answer from raw bytes"; + case Action::Allow: + return "Allow"; + case Action::HeaderModify: + return "Modify the header"; + case Action::Pool: + return "Route to a pool"; + case Action::Delay: + return "Delay"; + case Action::Truncate: + return "Truncate over UDP"; + case Action::ServFail: + return "Send ServFail"; + case Action::SetTag: + return "Set Tag"; + case Action::None: + case Action::NoOp: + return "Do nothing"; + case Action::NoRecurse: + return "Set rd=0"; + } + + return "Unknown"; +} diff --git a/pdns/dnsdistdist/dnsdist-actions.hh b/pdns/dnsdistdist/dnsdist-actions.hh index 5bb08a0c6eac..30f7ec187a5a 100644 --- a/pdns/dnsdistdist/dnsdist-actions.hh +++ b/pdns/dnsdistdist/dnsdist-actions.hh @@ -21,6 +21,10 @@ */ #pragma once +#include +#include +#include + /* so what could you do: drop, fake up nxdomain, @@ -55,44 +59,8 @@ public: SpoofPacket, SetTag, }; - static std::string typeToString(const Action& action) - { - switch (action) { - case Action::Drop: - return "Drop"; - case Action::Nxdomain: - return "Send NXDomain"; - case Action::Refused: - return "Send Refused"; - case Action::Spoof: - return "Spoof an answer"; - case Action::SpoofPacket: - return "Spoof a raw answer from bytes"; - case Action::SpoofRaw: - return "Spoof an answer from raw bytes"; - case Action::Allow: - return "Allow"; - case Action::HeaderModify: - return "Modify the header"; - case Action::Pool: - return "Route to a pool"; - case Action::Delay: - return "Delay"; - case Action::Truncate: - return "Truncate over UDP"; - case Action::ServFail: - return "Send ServFail"; - case Action::SetTag: - return "Set Tag"; - case Action::None: - case Action::NoOp: - return "Do nothing"; - case Action::NoRecurse: - return "Set rd=0"; - } - - return "Unknown"; - } + static Action typeFromString(const std::string& str); + static std::string typeToString(Action action); virtual Action operator()(DNSQuestion*, std::string* ruleresult) const = 0; virtual ~DNSAction() = default; diff --git a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc index 0adb621192f3..f85bf3cf9977 100644 --- a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc +++ b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc @@ -41,6 +41,7 @@ namespace dnsdist::configuration::yaml { +void convertRuntimeFlatSettingsFromRust(const dnsdist::rust::settings::GlobalConfiguration& yamlConfig); static std::set getCPUPiningFromStr(const std::string& cpuStr) { @@ -427,6 +428,15 @@ bool loadConfigurationFromFile(const std::string fileName) }); } + if (!globalConfig.proxy_protocol.acl.empty()) { + dnsdist::configuration::updateRuntimeConfiguration([globalConfig](dnsdist::configuration::RuntimeConfiguration& config) { + config.d_proxyProtocolACL.clear(); + for (const auto& aclEntry : globalConfig.proxy_protocol.acl) { + config.d_proxyProtocolACL.addMask(std::string(aclEntry)); + } + }); + } + #ifndef DISABLE_CARBON for (const auto& carbonConfig : globalConfig.metrics.carbon) { auto newEndpoint = dnsdist::Carbon::newEndpoint(std::string(carbonConfig.address), @@ -485,9 +495,27 @@ bool loadConfigurationFromFile(const std::string fileName) config.d_dashboardRequiresAuthentication = webConfig.dashboard_requires_authentication; config.d_statsRequireAuthentication = webConfig.stats_require_authentication; dnsdist::webserver::setMaxConcurrentConnections(webConfig.max_concurrent_connections); + config.d_apiConfigDirectory = std::string(webConfig.api_configuration_directory); + config.d_apiReadWrite = webConfig.api_read_write; }); + } + if (globalConfig.query_count.enabled) { + dnsdist::configuration::updateRuntimeConfiguration([&globalConfig](dnsdist::configuration::RuntimeConfiguration& config) { + config.d_queryCountConfig.d_enabled = true; + if (!globalConfig.query_count.filter.empty()) { + getOptionalLuaFunction(config.d_queryCountConfig.d_filter, std::string(globalConfig.query_count.filter)); + } + }); } + + if (!globalConfig.dynamic_rules_settings.default_action.empty()) { + dnsdist::configuration::updateRuntimeConfiguration([default_action=globalConfig.dynamic_rules_settings.default_action](dnsdist::configuration::RuntimeConfiguration& config) { + config.d_dynBlockAction = DNSAction::typeFromString(std::string(default_action)); + }); + } + + convertRuntimeFlatSettingsFromRust(globalConfig); return true; } catch (const ::rust::Error& exp) { diff --git a/pdns/dnsdistdist/dnsdist-rust-lib/Makefile.am b/pdns/dnsdistdist/dnsdist-rust-lib/Makefile.am index a8d7497cef97..68d3881dace8 100644 --- a/pdns/dnsdistdist/dnsdist-rust-lib/Makefile.am +++ b/pdns/dnsdistdist/dnsdist-rust-lib/Makefile.am @@ -5,13 +5,25 @@ EXTRA_DIST = \ BUILT_SOURCES=rust/src/lib.rs +# all: rust/src/lib.rs libdnsdist_settings_cxx.a + +# dnsdist_settings_cxx.cc rust/src/lib%rs: settings-generator.py dnsdist-rules-definitions.yml rust-pre-in.rs rust-middle-in.rs rust-post-in.rs dnsdist_settings_cxx_pre-in.cc dnsdist_settings_cxx_post-in.cc +# @if test "$(PYTHON)" = ":"; then echo "Settings definitions have changed, python is needed to regenerate the related settings files but python was not found. Please install python and re-run configure"; exit 1; fi +# @if ! $(PYTHON) --version | grep -q "Python 3"; then echo $(PYTHON) should be at least version 3. Please install python 3 and re-run configure; exit 1; fi +# $(MAKE) -C rust clean +# (cd ${srcdir} && $(PYTHON) settings-generator.py dnsdist-rules-definitions.yml) + +# noinst_LIBRARIES = libdnsdist_settings_cxx.a +# libdnsdist_settings_cxx_a_SOURCES = dnsdist_settings_cxx.cc + all: rust/src/lib.rs -rust/src/lib%rs: settings-generator.py dnsdist-rules-definitions.yml rust-pre-in.rs rust-middle-in.rs rust-post-in.rs +rust/src/lib%rs: settings-generator.py dnsdist-rules-definitions.yml rust-pre-in.rs rust-middle-in.rs rust-post-in.rs dnsdist-configuration-yaml-items-cxx-pre-in.cc @if test "$(PYTHON)" = ":"; then echo "Settings definitions have changed, python is needed to regenerate the related settings files but python was not found. Please install python and re-run configure"; exit 1; fi @if ! $(PYTHON) --version | grep -q "Python 3"; then echo $(PYTHON) should be at least version 3. Please install python 3 and re-run configure; exit 1; fi $(MAKE) -C rust clean (cd ${srcdir} && $(PYTHON) settings-generator.py dnsdist-rules-definitions.yml) clean-local: + rm dnsdist-configuration-yaml-items-cxx.cc rm -f rust/src/lib.rs diff --git a/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-configuration-yaml-items-cxx-pre-in.cc b/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-configuration-yaml-items-cxx-pre-in.cc new file mode 100644 index 000000000000..bae85b634c0f --- /dev/null +++ b/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-configuration-yaml-items-cxx-pre-in.cc @@ -0,0 +1,24 @@ +/* + * This file is part of PowerDNS or dnsdist. + * Copyright -- PowerDNS.COM B.V. and its contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * In addition, for the avoidance of any doubt, permission is granted to + * link this program with OpenSSL and to (re)distribute the binaries + * produced as the result of such linking. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "dnsdist-configuration.hh" +#include "dnsdist-configuration-yaml.hh" diff --git a/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-rules-definitions.yml b/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-rules-definitions.yml index 2f1d6988ba61..1a4054e846bc 100644 --- a/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-rules-definitions.yml +++ b/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-rules-definitions.yml @@ -85,6 +85,12 @@ webserver: - name: "custom-headers" type: "Vec" default: true + - name: "api-configuration-directory" + type: "String" + default: "" + - name: "api-read-write" + type: "bool" + default: "false" console: section: "global" @@ -99,26 +105,57 @@ console: type: "Vec" default: "127.0.0.1, ::1" description: "List of network masks or IP addresses that are allowed to open a connection to the console server" + - name: "maximum-output-size" + type: "u32" + default: "10000000" + lua-name: "setConsoleOutputMaxMsgSize" + internal-field-name: "d_consoleOutputMsgMaxSize" + runtime-configurable: true + - name: "log-connections" + type: "bool" + default: "true" + lua-name: "setConsoleConnectionsLogging" + internal-field-name: "d_logConsoleConnections" + runtime-configurable: true edns-client-subnet: section: "global" parameters: - name: "override-existing" lua-name: "setECSOverride" + internal-field-name: "d_ecsOverride" + runtime-configurable: true type: "bool" default: "false" description: "When `useClientSubnet` in `newServer()` is set and dnsdist adds an EDNS Client Subnet Client option to the query, override an existing option already present in the query, if any. Please see Passing the source address to the backend for more information. Note that it’s not recommended to enable setECSOverride in front of an authoritative server responding with EDNS Client Subnet information as mismatching data (ECS scopes) can confuse clients and lead to SERVFAIL responses on downstream nameservers" - name: "source-prefix-v4" lua-name: "setECSSourcePrefixV4" + internal-field-name: "d_ECSSourcePrefixV4" + runtime-configurable: true type: "u8" default: 32 description: "When `useClientSubnet` in `newServer()` is set and dnsdist adds an EDNS Client Subnet Client option to the query, truncate the requestor's IPv4 address to `prefix` bits" - name: "source-prefix-v6" lua-name: "setECSSourcePrefixV6" + internal-field-name: "d_ECSSourcePrefixV6" + runtime-configurable: true type: "u8" default: 48 description: "When `useClientSubnet` in `newServer()` is set and dnsdist adds an EDNS Client Subnet Client option to the query, truncate the requestor's IPv6 address to `prefix` bits" +dynamic-rules-settings: + section: "global" + parameters: + - name: "purge-interval" + type: "u64" + default: "60" + lua-name: "setDynBlocksPurgeInterval" + internal-field-name: "d_dynBlocksPurgeInterval" + runtime-configurable: true + - name: "default-action" + type: "String" + default: "Drop" + acl: section: "global" type: "Vec" @@ -592,9 +629,49 @@ tcp: - name: "receive-timeout" type: "u32" default: 2 + lua-name: "setTCPRecvTimeout" + internal-field-name: "d_tcpRecvTimeout" + runtime-configurable: true - name: "send-timeout" type: "u32" default: 2 + lua-name: "setTCPSendTimeout" + internal-field-name: "d_tcpSendTimeout" + runtime-configurable: true + - name: "max-queries-per-connection" + type: "u64" + default: "0" + lua-name: "setMaxTCPQueriesPerConnection" + internal-field-name: "d_maxTCPQueriesPerConn" + runtime-configurable: true + - name: "max-connection-duration" + type: "u64" + default: "0" + lua-name: "setMaxTCPConnectionDuration" + internal-field-name: "d_maxTCPConnectionDuration" + runtime-configurable: true + +tls: + section: "tuning" + parameters: + - name: "outgoing-tickets-cache-cleanup-delay" + type: "u16" + default: "60" + lua-name: "setOutgoingTLSSessionsCacheCleanupDelay" + internal-field-name: "d_tlsSessionCacheCleanupDelay" + runtime-configurable: true + - name: "outgoing-tickets-cache-validity" + type: "u16" + default: "600" + lua-name: "setOutgoingTLSSessionsCacheMaxTicketValidity" + internal-field-name: "d_tlsSessionCacheSessionValidity" + runtime-configurable: true + - name: "max-outgoing-tickets-per-backend" + type: "u16" + default: "20" + lua-name: "setOutgoingTLSSessionsCacheMaxTicketsPerBackend" + internal-field-name: "d_tlsSessionCacheMaxSessionsPerBackend" + runtime-configurable: true doh: section: "tuning" @@ -603,6 +680,96 @@ doh: type: "u32" default: 10 +cache-settings: + section: "global" + parameters: + - name: "stale-entries-ttl" + type: "u32" + default: "0" + lua-name: "setStaleCacheEntriesTTL" + internal-field-name: "d_staleCacheEntriesTTL" + runtime-configurable: true + - name: "cleaning-delay" + type: "u16" + default: "60" + lua-name: "setCacheCleaningDelay" + internal-field-name: "d_cacheCleaningDelay" + runtime-configurable: true + - name: "cleaning-percentage" + type: "u16" + default: "100" + lua-name: "setCacheCleaningPercentage" + internal-field-name: "d_cacheCleaningPercentage" + runtime-configurable: true + +security-polling: + section: "global" + parameters: + - name: "polling-interval" + type: "u32" + default: "3600" + lua-name: "setSecurityPollInterval" + internal-field-name: "d_secPollInterval" + runtime-configurable: true + - name: "suffix" + type: "String" + default: "secpoll.powerdns.com." + lua-name: "setSecurityPollSuffix" + internal-field-name: "d_secPollSuffix" + runtime-configurable: true + +general: + section: "global" + parameters: + - name: "edns-udp-payload-size-self-generated-answers" + type: "u16" + default: "1232" + lua-name: "setPayloadSizeOnSelfGeneratedAnswers" + internal-field-name: "d_payloadSizeSelfGenAnswers" + runtime-configurable: true + - name: "add-edns-to-self-generated-answers" + type: "bool" + default: "true" + lua-name: "setAddEDNSToSelfGeneratedResponses" + internal-field-name: "d_addEDNSToSelfGeneratedResponses" + runtime-configurable: true + - name: "truncate-tc-answers" + type: "bool" + default: "false" + lua-name: "truncateTC" + internal-field-name: "d_truncateTC" + runtime-configurable: true + - name: "fixup-case" + type: "bool" + default: "false" + lua-name: "fixupCase" + internal-field-name: "d_fixupCase" + runtime-configurable: true + - name: "verbose" + type: "bool" + default: "false" + lua-name: "setVerbose" + internal-field-name: "d_verbose" + runtime-configurable: true + - name: "verbose-health-checks" + type: "bool" + default: "false" + lua-name: "setVerboseHealthChecks" + internal-field-name: "d_verboseHealthChecks" + runtime-configurable: true + - name: "allow-empty-responses" + type: "bool" + default: "false" + lua-name: "setAllowEmptyResponse" + internal-field-name: "d_allowEmptyResponse" + runtime-modifiable: true + - name: "drop-empty-queries" + type: "bool" + default: "false" + lua-name: "setDropEmptyQueries" + internal-field-name: "d_dropEmptyQueries" + runtime-modifiable: true + packet-caches: section: "global" type: "list" @@ -617,6 +784,45 @@ packet-caches: - name: "shards" type: "u32" +proxy-protocol: + section: "global" + parameters: + - name: "acl" + type: "Vec" + default: "" + - name: "maximum-payload-size" + type: "u32" + default: "512" + lua-name: "setProxyProtocolMaximumPayloadSize" + internal-field-name: "d_proxyProtocolMaximumSize" + runtime-configurable: true + - name: "apply-acl-to-proxied-clients" + type: "bool" + default: "false" + lua-name: "setProxyProtocolApplyACLToProxiedClients" + internal-field-name: "d_applyACLToProxiedClients" + runtime-configurable: true + +snmp: + section: "global" + parameters: + - name: "enabled" + type: "bool" + default: "false" + - name: "traps-enabled" + type: "bool" + default: "false" + +query-count: + section: "global" + parameters: + - name: "enabled" + type: "bool" + default: "false" + - name: "filter" + type: "String" + default: "" + pools: section: "global" type: "list" @@ -630,6 +836,38 @@ pools: type: "String" default: "least-outstanding" +custom-load-balancing-policy: + parameters: + - name: "name" + type: "String" + - name: "function" + type: "String" + - name: "ffi" + type: "bool" + default: "false" + - name: "per-thread" + type: "bool" + default: "false" + +load-balancing-policies: + section: "global" + parameters: + - name: "servfail-on-no-server" + type: "bool" + default: "false" + lua-name: "setServFailWhenNoServer" + internal-field-name: "d_servFailOnNoPolicy" + runtime-modifiable: true + - name: "round-robin-servfail-on-no-server" + type: "bool" + default: "false" + lua-name: "setRoundRobinFailOnNoServer" + internal-field-name: "d_roundrobinFailOnNoServer" + runtime-modifiable: true + - name: "custom-policies" + type: "Vec" + default: true + MaxQPSIPRule: section: "selectors" version-changed: diff --git a/pdns/dnsdistdist/dnsdist-rust-lib/settings-generator.py b/pdns/dnsdistdist/dnsdist-rust-lib/settings-generator.py index f27653657520..771726bd50c2 100644 --- a/pdns/dnsdistdist/dnsdist-rust-lib/settings-generator.py +++ b/pdns/dnsdistdist/dnsdist-rust-lib/settings-generator.py @@ -169,6 +169,47 @@ def include_file(out_fp, include_file_name): out_fp.write(in_fp.read()) out_fp.write(f'// END INCLUDE {include_file_name}\n') +def generate_flat_settings_for_cxx(definitions, out_file_path): + cxx_flat_settings_fp = tempfile.NamedTemporaryFile(mode='w+t', encoding='utf-8', dir=out_file_path) + + include_file(cxx_flat_settings_fp, out_file_path + 'dnsdist-configuration-yaml-items-cxx-pre-in.cc') + + # first we do runtime-settable settings + cxx_flat_settings_fp.write('''#if defined(HAVE_YAML_CONFIGURATION) +#include "rust/cxx.h" +#include "rust/lib.rs.h" + +namespace dnsdist::configuration::yaml +{ +void convertRuntimeFlatSettingsFromRust(const dnsdist::rust::settings::GlobalConfiguration& yamlConfig) +{ + dnsdist::configuration::updateRuntimeConfiguration([&yamlConfig](dnsdist::configuration::RuntimeConfiguration& config) {\n'''); + for category_name, keys in definitions.items(): + if not 'parameters' in keys or not 'section' in keys: + continue + + category_name = get_rust_field_name(category_name) if keys['section'] == 'global' else get_rust_field_name(keys['section']) + '.' + get_rust_field_name(category_name) + for parameter in keys['parameters']: + if not 'internal-field-name' in parameter or not 'runtime-configurable' in parameter or not parameter['runtime-configurable']: + continue + internal_field_name = parameter['internal-field-name'] + rust_field_name = get_rust_field_name(parameter['name']) if not 'rename' in parameter else parameter['rename'] + default = parameter['default'] if parameter['type'] != 'String' else '"' + parameter['default'] + '"' + cxx_flat_settings_fp.write(f' if (yamlConfig.{category_name}.{rust_field_name} != {default} && config.{internal_field_name} == {default}) {{\n') + if parameter['type'] != 'String': + cxx_flat_settings_fp.write(f' config.{internal_field_name} = yamlConfig.{category_name}.{rust_field_name};\n') + else: + cxx_flat_settings_fp.write(f' config.{internal_field_name} = std::string(yamlConfig.{category_name}.{rust_field_name});\n') + cxx_flat_settings_fp.write(f' }}\n') + + cxx_flat_settings_fp.write(' });\n'); + cxx_flat_settings_fp.write('''}\n +} +#endif /* defined(HAVE_YAML_CONFIGURATION) */ +''') + + os.rename(cxx_flat_settings_fp.name, out_file_path + 'dnsdist-configuration-yaml-items-cxx.cc') + def main(): if len(sys.argv) != 2: print(f'Usage: {sys.argv[0]} ') @@ -182,6 +223,8 @@ def main(): generated_fp = tempfile.NamedTemporaryFile(mode='w+t', encoding='utf-8', dir=src_dir + '/rust/src/') include_file(generated_fp, src_dir + 'rust-pre-in.rs') + generate_flat_settings_for_cxx(definitions, src_dir) + for definition_name, keys in definitions.items(): if 'section' in keys and keys['section'] != 'none': continue