# HG changeset patch # User Matthew Wild # Date 1305570782 -3600 # Node ID 29d7eb6ff62c4f804360ff57038264dca82496ac # Parent 513485a11b85576e456f1d28be5482e92972bd82 net.dns: Support for resolving AAAA records diff -r 513485a11b85 -r 29d7eb6ff62c net/dns.lua --- a/net/dns.lua Sat May 07 21:17:03 2011 +0500 +++ b/net/dns.lua Mon May 16 19:33:02 2011 +0100 @@ -389,6 +389,14 @@ rr.a = string.format('%i.%i.%i.%i', b1, b2, b3, b4); end +function resolver:AAAA(rr) + local addr = {}; + for i = 1, rr.rdlength, 2 do + local b1, b2 = self:byte(2); + table.insert(addr, ("%02x%02x"):format(b1, b2)); + end + rr.aaaa = table.concat(addr, ":"); +end function resolver:CNAME(rr) -- - - - - - - - - - - - - - - - - - - - CNAME rr.cname = self:name();