luaCtx.registerFunction<size_t(DNSName::*)()>("wirelength", [](const DNSName& name) { return name.wirelength(); });
luaCtx.registerFunction<string(DNSName::*)()>("tostring", [](const DNSName&dn ) { return dn.toString(); });
luaCtx.registerFunction<string(DNSName::*)()>("toString", [](const DNSName&dn ) { return dn.toString(); });
+ luaCtx.registerFunction<string(DNSName::*)()>("toDNSString", [](const DNSName&dn ) { return dn.toDNSString(); });
luaCtx.writeFunction("newDNSName", [](const std::string& name) { return DNSName(name); });
luaCtx.writeFunction("newDNSNameFromRaw", [](const std::string& name) { return DNSName(name.c_str(), name.size(), 0, false); });
luaCtx.writeFunction("newSuffixMatchNode", []() { return SuffixMatchNode(); });
:param DNSName name: The name to check against
+ .. method:: DNSName:toDNSString() -> string
+
+ Returns a wire format form of the DNSName, suitable for usage in :func:`SpoofRawAction`.
+
.. method:: DNSName:toString() -> string
DNSName:tostring() -> string
-- select reverse queries for '127.0.0.1' and answer with 'localhost'
addAction(AndRule({QNameRule('1.0.0.127.in-addr.arpa.'), QTypeRule(DNSQType.PTR)}), SpoofRawAction("\009localhost\000"))
+ :func:`DNSName:toDNSString` is convenient for converting names to wire format for passing to ``SpoofRawAction``.
+
:param string rawAnswer: The raw record data
:param table options: A table with key: value pairs with options.