]> granicus.if.org Git - pdns/commitdiff
rename prequery to preoutquery, remove a duplicate *duplicate* prequery from example...
authorbert hubert <bert.hubert@netherlabs.nl>
Mon, 5 Jan 2015 13:21:39 +0000 (14:21 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Mon, 5 Jan 2015 13:21:39 +0000 (14:21 +0100)
pdns/lua-recursor.cc
pdns/lua-recursor.hh
pdns/powerdns-example-script.lua
pdns/syncres.cc

index be8a5b66c41a3784fdb6a992c6b528fd6437d0c3..65b7fc10d31278e572ea20ec8052bc09c21210ad 100644 (file)
@@ -32,7 +32,7 @@ bool RecursorLua::preresolve(const ComboAddress& remote, const ComboAddress& loc
   return false;
 }
 
-bool RecursorLua::prequery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res)
+bool RecursorLua::preoutquery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res)
 {
   return false;
 }
@@ -160,9 +160,9 @@ bool RecursorLua::postresolve(const ComboAddress& remote, const ComboAddress& lo
   return passthrough("postresolve", remote, local, query, qtype, ret, res, variable);
 }
 
-bool RecursorLua::prequery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res)
+bool RecursorLua::preoutquery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res)
 {
-  return passthrough("prequery", remote, local, query, qtype, ret, res, 0);
+  return passthrough("preoutquery", remote, local, query, qtype, ret, res, 0);
 }
 
 
@@ -180,7 +180,7 @@ bool RecursorLua::passthrough(const string& func, const ComboAddress& remote, co
   
   d_local = local; 
   /* the first argument */
-  if(strcmp(func.c_str(),"prequery"))
+  if(strcmp(func.c_str(),"preoutquery"))
     lua_pushstring(d_lua,  remote.toString().c_str() );
   else {
     ComboAddress* ca=(ComboAddress*)lua_newuserdata(d_lua, sizeof(ComboAddress)); 
index 9dee98816cd3835cae05c6feb0056a409a16f053..039fa704e064a78ad22258d8a8d116eb074d248d 100644 (file)
@@ -13,7 +13,7 @@ public:
   bool nxdomain(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret, bool* variable);
   bool nodata(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret, bool* variable);
   bool postresolve(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret, bool* variable);
-  bool prequery(const ComboAddress& requestor, const ComboAddress& ns, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret);
+  bool preoutquery(const ComboAddress& requestor, const ComboAddress& ns, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret);
 
 private:
   bool passthrough(const string& func, const ComboAddress& remote,const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res, bool* variable);
index d168c5fdcd022946c6e9032915f3d076e12cbf91..f0dec949a6855a585d15e42267d0fd08792c8f72 100644 (file)
@@ -159,21 +159,10 @@ function hidettl ( remoteip, domain, qtype, records, origrcode )
        return origrcode, records
 end
 
-function prequery(remoteip, domain, qtype)
-       print("pdns wants to ask "..remoteip.." about "..domain.." "..qtype)
-       if(remoteip=="192.121.121.14")
-       then
-               return -3,{}
-       else
-               return -1,{}
-       end
-end
-
-
 nmg=iputils.newnmgroup()
 nmg:add("192.121.121.0/24")
 
-function prequery(remoteip, domain, qtype)
+function preoutquery(remoteip, domain, qtype)
        print("pdns wants to ask "..remoteip:tostring().." about "..domain.." "..qtype)
        if(nmg:match(remoteip))
        then
index c351534b86c704aabf129fa80c8a2226440de53c..f2af138e5fb14e01bcafc66312c0f2eb620c950d 100644 (file)
@@ -933,7 +933,7 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
               s_tcpoutqueries++; d_tcpoutqueries++;
             }
             
-           if(d_pdl && d_pdl->prequery(*remoteIP, *remoteIP, qname, qtype, lwr.d_result, resolveret)) {
+           if(d_pdl && d_pdl->preoutquery(*remoteIP, *remoteIP, qname, qtype, lwr.d_result, resolveret)) {
              LOG(prefix<<qname<<": query handled by Lua"<<endl);
            }
            else