#include <pthread.h>
#include "iputils.hh"
#include "dnsname.hh"
+#include "sholder.hh"
#include <atomic>
+extern GlobalStateHolder<SuffixMatchNode> g_dontThrottleNames;
+extern GlobalStateHolder<NetmaskGroup> g_dontThrottleNetmasks;
+
/** this class is used both to send and answer channel commands to the PowerDNS Recursor */
class RecursorControlChannel
{
return new string("pong\n");
}
+string getDontThrottleNames() {
+ auto dtn = g_dontThrottleNames.getLocal();
+ return dtn->toString() + "\n";
+}
+
+string getDontThrottleNetmasks() {
+ auto dtn = g_dontThrottleNetmasks.getLocal();
+ return dtn->toString() + "\n";
+}
+
string RecursorControlParser::getAnswer(const string& question, RecursorControlParser::func_t** command)
{
*command=nop;
"dump-throttlemap <filename> dump the contents of the throttle to the named file\n"
"get [key1] [key2] .. get specific statistics\n"
"get-all get all statistics\n"
+"get-dont-throttle-names get the list of names that are not allowed to be throttled\n"
+"get-dont-throttle-netmasks get the list of netmasks that are not allowed to be throttled\n"
"get-ntas get all configured Negative Trust Anchors\n"
"get-tas get all configured Trust Anchors\n"
"get-parameter [key1] [key2] .. get configuration parameters\n"
if (cmd=="set-dnssec-log-bogus")
return doSetDnssecLogBogus(begin, end);
+ if (cmd == "get-dont-throttle-names") {
+ return getDontThrottleNames();
+ }
+
+ if (cmd == "get-dont-throttle-netmasks") {
+ return getDontThrottleNetmasks();
+ }
+
return "Unknown command '"+cmd+"', try 'help'\n";
}