std::make_shared<PoolAction>(pool) });
});
});
+
+ g_lua.writeFunction("addNoRecurseRule", [](boost::variant<string,vector<pair<int, string>> > var) {
+ auto rule=makeRule(var);
+ g_rulactions.modify([rule](decltype(g_rulactions)::value_type& rulactions) {
+ rulactions.push_back({
+ rule,
+ std::make_shared<NoRecurseAction>() });
+ });
+ });
+
+
g_lua.writeFunction("addQPSPoolRule", [](boost::variant<string,vector<pair<int, string>> > var, int limit, string pool) {
auto rule = makeRule(var);
g_rulactions.modify([rule, pool,limit](decltype(g_rulactions)::value_type& rulactions) {
return "tc=1 answer";
}
};
+
+class NoRecurseAction : public DNSAction
+{
+public:
+ DNSAction::Action operator()(const ComboAddress& remote, const DNSName& qname, uint16_t qtype, dnsheader* dh, int len, string* ruleresult) const override
+ {
+ dh->rd = false;
+ return Action::HeaderModify;
+ }
+ string toString() const override
+ {
+ return "rd=0 query";
+ }
+};