From: Peter van Dijk Date: Fri, 22 Jun 2012 10:51:35 +0000 (+0000) Subject: add getRemote to lua DNSPacket binding X-Git-Tag: auth-3.2-rc1~219 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d58f13eadf5f9ea12ceee1ae7c3c2006af357545;p=thirdparty%2Fpdns.git add getRemote to lua DNSPacket binding git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2643 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/lua-auth.cc b/pdns/lua-auth.cc index 3cd903246c..a823c7f5c2 100644 --- a/pdns/lua-auth.cc +++ b/pdns/lua-auth.cc @@ -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} };