function with the parameter `dr`, which returns an action to be taken on this response packet.
Good for rare packets but where you want to do a lot of processing.
* Server selection policy related:
+ * `setWHashedPertubation(value)`: set the hash perturbation value to be used in the `whashed` policy instead of a random one, allowing to have consistent `whashed` results on different instances
* `setServerPolicy(policy)`: set server selection policy to that policy
* `setServerPolicyLua(name, function)`: set server selection policy to one named 'name' and provided by 'function'
* `showServerPolicy()`: show name of currently operational server selection policy
return std::shared_ptr<DNSRule>(new RDRule());
});
+ g_lua.writeFunction("setWHashedPertubation", [](uint32_t pertub) {
+ setLuaSideEffect();
+ g_hashperturb = pertub;
+ });
+
}
return valrandom(random(), servers, dq);
}
-static uint32_t g_hashperturb;
+uint32_t g_hashperturb;
shared_ptr<DownstreamState> whashed(const NumberedServerVector& servers, const DNSQuestion* dq)
{
return valrandom(dq->qname->hash(g_hashperturb), servers, dq);
extern bool g_apiReadWrite;
extern std::string g_apiConfigDirectory;
extern bool g_servFailOnNoPolicy;
+extern uint32_t g_hashperturb;
struct ConsoleKeyword {
std::string name;