* `QClassRule(qclass)`: matches queries with the specified qclass (numeric)
* `QTypeRule(qtype)`: matches queries with the specified qtype
* `RegexRule(regex)`: matches the query name against the supplied regex
- * `SuffixMatchNodeRule()`: matches based on a group of domain suffixes for rapid testing of membership
+ * `SuffixMatchNodeRule(smn, [quiet-bool])`: matches based on a group of domain suffixes for rapid testing of membership. Pass `true` as second parameter to prevent listing of all domains matched.
* `TCPRule(tcp)`: matches question received over TCP if `tcp` is true, over UDP otherwise
* Rule management related:
* `getAction(num)`: returns the Action associate with rule 'num'.
});
#endif
- g_lua.writeFunction("SuffixMatchNodeRule", [](const SuffixMatchNode& smn) {
- return std::shared_ptr<DNSRule>(new SuffixMatchNodeRule(smn));
+ g_lua.writeFunction("SuffixMatchNodeRule", [](const SuffixMatchNode& smn, boost::optional<bool> quiet) {
+ return std::shared_ptr<DNSRule>(new SuffixMatchNodeRule(smn, quiet ? *quiet : false));
});
g_lua.writeFunction("NetmaskGroupRule", [](const NetmaskGroup& nmg) {
class SuffixMatchNodeRule : public DNSRule
{
public:
- SuffixMatchNodeRule(const SuffixMatchNode& smn) : d_smn(smn)
+ SuffixMatchNodeRule(const SuffixMatchNode& smn, bool quiet=false) : d_smn(smn), d_quiet(quiet)
{
}
bool matches(const DNSQuestion* dq) const override
}
string toString() const override
{
- return "qname=="+d_smn.toString();
+ if(d_quiet)
+ return "qname==in-set";
+ else
+ return "qname=="+d_smn.toString();
}
private:
SuffixMatchNode d_smn;
+ bool d_quiet;
};
class QTypeRule : public DNSRule