X-Git-Url: http://www.average.org/gitweb/?p=pdns-pipe-nmc.git;a=blobdiff_plain;f=PowerDns.hs;h=9e1da83513130309234647b8246914a09d7d02ce;hp=ef8211dfc373e6769eab671ee2b8d654bb331b47;hb=851c71d42654a1620ea98d2dfe751d2e7fbc961f;hpb=890c9222bd6d44ff1d499fc3124c53e36d5fe61d diff --git a/PowerDns.hs b/PowerDns.hs index ef8211d..9e1da83 100644 --- a/PowerDns.hs +++ b/PowerDns.hs @@ -108,7 +108,7 @@ pdnsOutQ ver id gen name rrt edom = rrl = case rrt of RRTypeANY -> [ RRTypeSRV, RRTypeA, RRTypeAAAA, RRTypeCNAME , RRTypeDNAME, RRTypeRP, RRTypeLOC, RRTypeNS - , RRTypeDS, RRTypeMX -- SOA not included + , RRTypeDS, RRTypeMX, RRTypeTLSA -- SOA not included ] x -> [x] in @@ -124,10 +124,10 @@ pdnsOutXfr ver id gen name edom = let allrrs = [ RRTypeSRV, RRTypeA, RRTypeAAAA, RRTypeCNAME , RRTypeDNAME, RRTypeRP, RRTypeLOC, RRTypeNS - , RRTypeDS, RRTypeMX, RRTypeSOA + , RRTypeDS, RRTypeMX, RRTypeTLSA, RRTypeSOA ] walkDom f acc name dom = - f name dom $ case domMap dom of + f name dom $ case domSubmap dom of Nothing -> acc Just dm -> foldrWithKey (\n d a -> walkDom f a (n ++ "." ++ name) d) acc dm @@ -165,9 +165,27 @@ dotmail addr = "" -> aname ++ "." _ -> aname ++ "." ++ (tail adom) ++ "." -dataRR RRTypeSRV = justl domSrv +dataRR RRTypeSRV = \ _ _ dom -> + case domSrv dom of + Nothing -> [] + Just srvs -> map srvStr srvs + where + srvStr x = (show (srvPrio x)) ++ "\t" + ++ (show (srvWeight x)) ++ " " + ++ (show (srvPort x)) ++ " " + ++ (srvHost x) + dataRR RRTypeMX = justl domMx -dataRR RRTypeTLSA = justl domTlsa +dataRR RRTypeTLSA = \ _ _ dom -> + case domTlsa dom of + Nothing -> [] + Just tlsas -> map tlsaStr tlsas + where + tlsaStr x = "(3 0 " + ++ (show (tlsMatchType x)) ++ " " + ++ (tlsMatchValue x) ++ ")" + -- tlsIncSubdoms is not displayed, it is used for `propagate`. + dataRR RRTypeA = justl domIp dataRR RRTypeAAAA = justl domIp6 dataRR RRTypeCNAME = justv domAlias