]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
add getRemote to lua DNSPacket binding
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Fri, 22 Jun 2012 10:51:35 +0000 (10:51 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Fri, 22 Jun 2012 10:51:35 +0000 (10:51 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2643 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/lua-auth.cc

index 3cd903246c6351900687481dee37a56ce7390ace..a823c7f5c212f3fe59dd2ba98bbab29d6b9e4892 100644 (file)
@@ -159,10 +159,17 @@ static int ldp_addRecords(lua_State *L) {
   return 0;
 }
 
+static int ldp_getRemote(lua_State *L) {
+  DNSPacket *p=ldp_checkDNSPacket(L);
+  lua_pushstring(L, p->getRemote().c_str());
+  return 1;
+}
+
 static const struct luaL_reg ldp_methods [] = {
       {"setRcode", ldp_setRcode},
       {"getQuestion", ldp_getQuestion},
       {"addRecords", ldp_addRecords},
+      {"getRemote", ldp_getRemote},
       {NULL, NULL}
     };