X-Git-Url: http://www.average.org/gitweb/?p=pdns-pipe-nmc.git;a=blobdiff_plain;f=PowerDns.hs;h=ef8211dfc373e6769eab671ee2b8d654bb331b47;hp=457cdcae5b3be03b3160b0dc1f87e38b6b015bc6;hb=518fb5e9066cb2f77cd3291289d85c00cbee0ffb;hpb=17e4165f2d7cd287e2d49ef2ceac494f9236fd61 diff --git a/PowerDns.hs b/PowerDns.hs index 457cdca..ef8211d 100644 --- a/PowerDns.hs +++ b/PowerDns.hs @@ -9,12 +9,13 @@ module PowerDns ( RRType(..) import Data.Text.Lazy (splitOn, pack) import Data.Map.Lazy (foldrWithKey) +import Data.Default.Class (def) import NmcDom data RRType = RRTypeSRV | RRTypeA | RRTypeAAAA | RRTypeCNAME | RRTypeDNAME | RRTypeSOA | RRTypeRP | RRTypeLOC - | RRTypeNS | RRTypeDS | RRTypeMX + | RRTypeNS | RRTypeDS | RRTypeMX | RRTypeTLSA | RRTypeANY | RRTypeError String instance Show RRType where @@ -29,6 +30,7 @@ instance Show RRType where show RRTypeNS = "NS" show RRTypeDS = "DS" show RRTypeMX = "MX" + show RRTypeTLSA = "TLSA" show RRTypeANY = "ANY" show (RRTypeError s) = "Unknown RR type: " ++ (show s) @@ -44,6 +46,7 @@ rrType qt = case qt of "NS" -> RRTypeNS "DS" -> RRTypeDS "MX" -> RRTypeMX + "TLSA" -> RRTypeTLSA "ANY" -> RRTypeANY _ -> RRTypeError qt @@ -164,6 +167,7 @@ dotmail addr = dataRR RRTypeSRV = justl domSrv dataRR RRTypeMX = justl domMx +dataRR RRTypeTLSA = justl domTlsa dataRR RRTypeA = justl domIp dataRR RRTypeAAAA = justl domIp6 dataRR RRTypeCNAME = justv domAlias @@ -177,7 +181,7 @@ dataRR RRTypeSOA = \ gen name dom -> Nothing -> "hostmaster." ++ name ++ "." Just addr -> dotmail addr in - if dom == emptyNmcDom then [] + if dom == def then [] else -- Follows a relatively ugly hack to figure if we are at the top -- level domain ("something.bit"). Only in such case we provide