]> granicus.if.org Git - pdns/commitdiff
implement ComboAddress:equal for lua
authorbert hubert <bert.hubert@netherlabs.nl>
Sun, 27 Dec 2015 21:19:24 +0000 (21:19 +0000)
committerbert hubert <bert.hubert@netherlabs.nl>
Sun, 27 Dec 2015 21:19:24 +0000 (21:19 +0000)
pdns/lua-recursor4.cc

index 4f4a6620c22fcf8afeeefd007707c446727c6fc5..9895c4090be4060889017c7cf5b7fb3eb5cc8c87 100644 (file)
@@ -166,6 +166,11 @@ RecursorLua4::RecursorLua4(const std::string& fname)
 
   d_lw->registerFunction<string(ComboAddress::*)()>("toString", [](const ComboAddress& ca) { return ca.toString(); });
   d_lw->writeFunction("newCA", [](const std::string& a) { return ComboAddress(a); });
+
+  d_lw->registerFunction<bool(ComboAddress::*)(const ComboAddress&)>("equal", [](const ComboAddress& lhs, const ComboAddress& rhs) {
+      return ComboAddress::addressOnlyEqual()(lhs, rhs);
+    });
+  
   d_lw->writeFunction("newNMG", []() { return NetmaskGroup(); });
   d_lw->registerFunction<void(NetmaskGroup::*)(const std::string&mask)>("addMask", [](NetmaskGroup&nmg, const std::string& mask)
                         {