template<typename T>
string doSetDnssecLogBogus(T begin, T end)
{
+ if(checkDNSSECDisabled())
+ return "DNSSEC is disabled in the configuration, not changing the Bogus logging setting\n";
+
if (begin == end)
return "No DNSSEC Bogus logging setting specified\n";
template<typename T>
string doAddNTA(T begin, T end)
{
+ if(checkDNSSECDisabled())
+ return "DNSSEC is disabled in the configuration, not adding a Negative Trust Anchor\n";
+
if(begin == end)
return "No NTA specified, doing nothing\n";
template<typename T>
string doClearNTA(T begin, T end)
{
+ if(checkDNSSECDisabled())
+ return "DNSSEC is disabled in the configuration, not removing a Negative Trust Anchor\n";
+
if(begin == end)
return "No Negative Trust Anchor specified, doing nothing.\n";
static string getNTAs()
{
+ if(checkDNSSECDisabled())
+ return "DNSSEC is disabled in the configuration\n";
+
string ret("Configured Negative Trust Anchors:\n");
auto luaconf = g_luaconfs.getLocal();
for (auto negAnchor : luaconf->negAnchors)
template<typename T>
string doAddTA(T begin, T end)
{
+ if(checkDNSSECDisabled())
+ return "DNSSEC is disabled in the configuration, not adding a Trust Anchor\n";
+
if(begin == end)
return "No TA specified, doing nothing\n";
template<typename T>
string doClearTA(T begin, T end)
{
+ if(checkDNSSECDisabled())
+ return "DNSSEC is disabled in the configuration, not removing a Trust Anchor\n";
+
if(begin == end)
return "No Trust Anchor to clear\n";
static string getTAs()
{
+ if(checkDNSSECDisabled())
+ return "DNSSEC is disabled in the configuration\n";
+
string ret("Configured Trust Anchors:\n");
auto luaconf = g_luaconfs.getLocal();
for (auto anchor : luaconf->dsAnchors) {
int d_queries{0};
};
-void warnIfDNSSECDisabled(const string& msg) {
- if(g_dnssecmode == DNSSECMode::Off)
- L<<Logger::Warning<<msg<<endl;
+bool checkDNSSECDisabled() {
+ return warnIfDNSSECDisabled("");
+}
+
+bool warnIfDNSSECDisabled(const string& msg) {
+ if(g_dnssecmode == DNSSECMode::Off) {
+ if (!msg.empty())
+ L<<Logger::Warning<<msg<<endl;
+ return true;
+ }
+ return false;
}
inline vState increaseDNSSECStateCounter(const vState& state)