return false;
}
+int RecursorLua4::gettag(const ComboAddress& remote, const ComboAddress& local, const DNSName& qname, uint16_t qtype)
+{
+ return 0;
+}
+
#else
#undef L
d_preoutquery = d_lw->readVariable<boost::optional<luacall_t>>("preoutquery").get_value_or(0);
d_ipfilter = d_lw->readVariable<boost::optional<ipfilter_t>>("ipfilter").get_value_or(0);
-
+ d_gettag = d_lw->readVariable<boost::optional<gettag_t>>("gettag").get_value_or(0);
}
bool RecursorLua4::preresolve(const ComboAddress& remote,const ComboAddress& local, const DNSName& query, const QType& qtype, vector<DNSRecord>& res, int& ret, bool* variable)
return false; // don't block
}
+int RecursorLua4::gettag(const ComboAddress& remote, const ComboAddress& local, const DNSName& qname, uint16_t qtype)
+{
+ if(d_gettag)
+ return d_gettag(remote, local, qname, qtype);
+ return 0;
+}
+
bool RecursorLua4::genhook(luacall_t& func, const ComboAddress& remote,const ComboAddress& local, const DNSName& query, const QType& qtype, vector<DNSRecord>& res, int& ret, bool* variable)
{
if(!func)
bool preoutquery(const ComboAddress& ns, const ComboAddress& requestor, const DNSName& query, const QType& qtype, vector<DNSRecord>& res, int& ret);
bool ipfilter(const ComboAddress& remote, const ComboAddress& local, const struct dnsheader&);
+ int gettag(const ComboAddress& remote, const ComboAddress& local, const DNSName& query, uint16_t qtype);
+
+ typedef std::function<int(ComboAddress,ComboAddress, DNSName, uint16_t)> gettag_t;
+ gettag_t d_gettag; // public so you can query if we have this hooked
+
private:
struct DNSQuestion
{