1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#ifndef PDNS_LUA_PDNS_RECURSOR_HH
#define PDNS_LUA_PDNS_RECURSOR_HH
#include "dns.hh"
#include "iputils.hh"
struct lua_State;
class PowerDNSLua
{
public:
explicit PowerDNSLua(const std::string& fname);
~PowerDNSLua();
void reload();
bool preresolve(const ComboAddress& remote,const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret);
bool nxdomain(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret);
ComboAddress getLocal()
{
return d_local;
}
private:
lua_State* d_lua;
bool passthrough(const string& func, const ComboAddress& remote,const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res);
bool getFromTable(const std::string& key, std::string& value);
bool getFromTable(const std::string& key, uint32_t& value);
bool d_failed;
ComboAddress d_local;
};
#endif
|