#ifdef ENABLE_GSS_TSIG
bool g_doGssTSIG;
#endif
+bool g_views;
typedef Distributor<DNSPacket, DNSPacket, PacketHandler> DNSDistributor;
ArgvMap theArg;
#ifdef ENABLE_GSS_TSIG
::arg().setSwitch("enable-gss-tsig", "Enable GSS TSIG processing") = "no";
#endif
+
+ ::arg().setSwitch("views", "Enable views (variants) of zones, for backends which support them") = "no";
+
::arg().setDefaults();
}
#ifdef ENABLE_GSS_TSIG
g_doGssTSIG = ::arg().mustDo("enable-gss-tsig");
#endif
+ g_views = ::arg().mustDo("views");
DNSPacket::s_udpTruncationThreshold = std::max(512, ::arg().asNum("udp-truncation-threshold"));
DNSPacket::s_doEDNSSubnetProcessing = ::arg().mustDo("edns-subnet-processing");
#endif
}
+ // Check for mutually incompatible settings:
+ // - enabling views currently requires the zone cache to be active
+ if (g_views) {
+ if (::arg().asNum("zone-cache-refresh-interval") == 0) {
+ g_log << Logger::Error << R"(Error: use of views requires the zone cache to be enabled, please set "zone-cache-refresh-interval" to a nonzero value.)" << endl;
+ exit(1); // NOLINT(concurrency-mt-unsafe) we're single threaded at this point
+ }
+ }
+ // (no more checks yet)
+
PC.setTTL(::arg().asNum("cache-ttl"));
PC.setMaxEntries(::arg().asNum("max-packet-cache-entries"));
QC.setMaxEntries(::arg().asNum("max-cache-entries"));