diff --git a/pdns/dnsdistdist/Makefile.am b/pdns/dnsdistdist/Makefile.am index 897a4eb69881..f2184697d26a 100644 --- a/pdns/dnsdistdist/Makefile.am +++ b/pdns/dnsdistdist/Makefile.am @@ -35,10 +35,10 @@ dnslabeltext.cc: dnslabeltext.rl $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc BUILT_SOURCES=htmlfiles.h \ - dnsdist-actions-factories-generated.cc dnsdist-actions-factories-generated.hh \ + dnsdist-actions-factory-generated.cc dnsdist-actions-factory-generated.hh \ dnsdist-lua-ffi-interface.inc \ dnsdist-lua-actions-generated.cc dnsdist-lua-response-actions-generated.cc \ - dnsdist-response-actions-factories-generated.cc dnsdist-response-actions-factories-generated.hh \ + dnsdist-response-actions-factory-generated.cc dnsdist-response-actions-factory-generated.hh \ dnsdist-rust-bridge-actions-generated.cc dnsdist-rust-bridge-actions-generated.hh \ dnsdist-rust-bridge-selectors-generated.cc dnsdist-rust-bridge-selectors-generated.hh \ dnsdist-selectors-factory-generated.cc dnsdist-selectors-factory-generated.hh \ @@ -171,8 +171,8 @@ dnsdist_SOURCES = \ dns.cc dns.hh \ dns_random.hh \ dnscrypt.cc dnscrypt.hh \ - dnsdist-actions-factories-generated.hh \ - dnsdist-actions-factories.cc dnsdist-actions-factories.hh \ + dnsdist-actions-factory-generated.hh \ + dnsdist-actions-factory.cc dnsdist-actions-factory.hh \ dnsdist-actions.cc dnsdist-actions.hh \ dnsdist-async.cc dnsdist-async.hh \ dnsdist-backend.cc dnsdist-backend.hh \ diff --git a/pdns/dnsdistdist/dnsdist-actions-factories-generated.cc b/pdns/dnsdistdist/dnsdist-actions-factory-generated.cc similarity index 100% rename from pdns/dnsdistdist/dnsdist-actions-factories-generated.cc rename to pdns/dnsdistdist/dnsdist-actions-factory-generated.cc diff --git a/pdns/dnsdistdist/dnsdist-actions-factories-generated.hh b/pdns/dnsdistdist/dnsdist-actions-factory-generated.hh similarity index 100% rename from pdns/dnsdistdist/dnsdist-actions-factories-generated.hh rename to pdns/dnsdistdist/dnsdist-actions-factory-generated.hh diff --git a/pdns/dnsdistdist/dnsdist-actions-factories.cc b/pdns/dnsdistdist/dnsdist-actions-factory.cc similarity index 99% rename from pdns/dnsdistdist/dnsdist-actions-factories.cc rename to pdns/dnsdistdist/dnsdist-actions-factory.cc index 173d5d5ca78f..89c7e835e1f9 100644 --- a/pdns/dnsdistdist/dnsdist-actions-factories.cc +++ b/pdns/dnsdistdist/dnsdist-actions-factory.cc @@ -21,7 +21,7 @@ */ #include -#include "dnsdist-actions-factories.hh" +#include "dnsdist-actions-factory.hh" #include "config.h" #include "dnsdist.hh" @@ -2427,6 +2427,6 @@ std::shared_ptr getTeeAction(const ComboAddress& rca, std::optional(new TeeAction(rca, lca, addECS, addProxyProtocol)); } -#include "dnsdist-actions-factories-generated.cc" -#include "dnsdist-response-actions-factories-generated.cc" +#include "dnsdist-actions-factory-generated.cc" +#include "dnsdist-response-actions-factory-generated.cc" } diff --git a/pdns/dnsdistdist/dnsdist-actions-factories.hh b/pdns/dnsdistdist/dnsdist-actions-factory.hh similarity index 98% rename from pdns/dnsdistdist/dnsdist-actions-factories.hh rename to pdns/dnsdistdist/dnsdist-actions-factory.hh index 95354c110b72..4d2cd4537741 100644 --- a/pdns/dnsdistdist/dnsdist-actions-factories.hh +++ b/pdns/dnsdistdist/dnsdist-actions-factory.hh @@ -59,8 +59,8 @@ struct SOAParams uint32_t minimum; }; -#include "dnsdist-actions-factories-generated.hh" -#include "dnsdist-response-actions-factories-generated.hh" +#include "dnsdist-actions-factory-generated.hh" +#include "dnsdist-response-actions-factory-generated.hh" std::shared_ptr getContinueAction(std::shared_ptr action); #ifdef HAVE_DNS_OVER_HTTPS diff --git a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc index c62aebd25516..5dbdc4418a30 100644 --- a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc +++ b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc @@ -26,7 +26,7 @@ #if defined(HAVE_YAML_CONFIGURATION) #include "base64.hh" #include "dolog.hh" -#include "dnsdist-actions-factories.hh" +#include "dnsdist-actions-factory.hh" #include "dnsdist-backend.hh" #include "dnsdist-cache.hh" #include "dnsdist-discovery.hh" diff --git a/pdns/dnsdistdist/dnsdist-lua-actions.cc b/pdns/dnsdistdist/dnsdist-lua-actions.cc index 0d3808daf30a..dfee7a1084a0 100644 --- a/pdns/dnsdistdist/dnsdist-lua-actions.cc +++ b/pdns/dnsdistdist/dnsdist-lua-actions.cc @@ -21,7 +21,7 @@ */ #include "config.h" #include "dnsdist.hh" -#include "dnsdist-actions-factories.hh" +#include "dnsdist-actions-factory.hh" #include "dnsdist-lua.hh" #include "dnsdist-lua-ffi.hh" #include "dnsdist-protobuf.hh" diff --git a/pdns/dnsdistdist/dnsdist-response-actions-factories-generated.cc b/pdns/dnsdistdist/dnsdist-response-actions-factory-generated.cc similarity index 100% rename from pdns/dnsdistdist/dnsdist-response-actions-factories-generated.cc rename to pdns/dnsdistdist/dnsdist-response-actions-factory-generated.cc diff --git a/pdns/dnsdistdist/dnsdist-response-actions-factories-generated.hh b/pdns/dnsdistdist/dnsdist-response-actions-factory-generated.hh similarity index 100% rename from pdns/dnsdistdist/dnsdist-response-actions-factories-generated.hh rename to pdns/dnsdistdist/dnsdist-response-actions-factory-generated.hh diff --git a/pdns/dnsdistdist/dnsdist-rules-generator.py b/pdns/dnsdistdist/dnsdist-rules-generator.py index 395cdda50dcb..cb6c0d73f840 100644 --- a/pdns/dnsdistdist/dnsdist-rules-generator.py +++ b/pdns/dnsdistdist/dnsdist-rules-generator.py @@ -1,20 +1,20 @@ #!/usr/bin/python3 -"""Load action and selector definitions and generates C++ factories and Lua bindings code.""" +"""Load action and selector definitions and generates C++ factory and Lua bindings code.""" # 1/ Loads the action definitions from: # - dnsdist-actions-definitions.yml # - dnsdist-response-actions-definitions.yml -# and generates C++ factories to create the objects +# and generates C++ factory to create the objects # for these actions from the corresponding parameters: -# - dnsdist-actions-factories-generated.cc -# - dnsdist-actions-factories-generated.hh -# - dnsdist-response-actions-factories-generated.cc -# - dnsdist-response-actions-factories-generated.hh +# - dnsdist-actions-factory-generated.cc +# - dnsdist-actions-factory-generated.hh +# - dnsdist-response-actions-factory-generated.cc +# - dnsdist-response-actions-factory-generated.hh # as well as Lua bindings for them: # - dnsdist-lua-actions-generated.cc # - dnsdist-lua-response-actions-generated.cc # 2/ Loads the selector definitions from: # - dnsdist-selectors-definitions.yml -# and generates C++ factories to create the objects +# and generates C++ factory to create the objects # for these selectors from the corresponding parameters: # - dnsdist-selectors-factory-generated.cc # - dnsdist-selectors-factory-generated.hh @@ -145,7 +145,7 @@ def get_temporary_file_for_generated_code(): generated_fp.write('// !! This file has been generated by dnsdist-rules-generator.py, do not edit by hand!!\n') return generated_fp -def generate_actions_factories_header(definitions, response=False): +def generate_actions_factory_header(definitions, response=False): suffix = 'ResponseAction' if response else 'Action' shared_object_type = f'DNS{suffix}' generated_fp = get_temporary_file_for_generated_code() @@ -160,10 +160,10 @@ def generate_actions_factories_header(definitions, response=False): output += ');\n' generated_fp.write(output) - output_file_name = 'dnsdist-response-actions-factories-generated.hh' if response else 'dnsdist-actions-factories-generated.hh' + output_file_name = 'dnsdist-response-actions-factory-generated.hh' if response else 'dnsdist-actions-factory-generated.hh' os.rename(generated_fp.name, output_file_name) -def generate_actions_factories(definitions, response=False): +def generate_actions_factory(definitions, response=False): suffix = 'ResponseAction' if response else 'Action' generated_fp = get_temporary_file_for_generated_code() @@ -182,7 +182,7 @@ def generate_actions_factories(definitions, response=False): output += '}\n' generated_fp.write(output) - output_file_name = 'dnsdist-response-actions-factories-generated.cc' if response else 'dnsdist-actions-factories-generated.cc' + output_file_name = 'dnsdist-response-actions-factory-generated.cc' if response else 'dnsdist-actions-factory-generated.cc' os.rename(generated_fp.name, output_file_name) def generate_lua_actions_bindings(definitions, response=False): @@ -267,13 +267,13 @@ def generate_lua_selectors_bindings(definitions): def main(): definitions = get_definitions_from_file('dnsdist-actions-definitions.yml') - generate_actions_factories_header(definitions) - generate_actions_factories(definitions) + generate_actions_factory_header(definitions) + generate_actions_factory(definitions) generate_lua_actions_bindings(definitions) definitions = get_definitions_from_file('dnsdist-response-actions-definitions.yml') - generate_actions_factories_header(definitions, response=True) - generate_actions_factories(definitions, response=True) + generate_actions_factory_header(definitions, response=True) + generate_actions_factory(definitions, response=True) generate_lua_actions_bindings(definitions, response=True) definitions = get_definitions_from_file('dnsdist-selectors-definitions.yml')