From: Eugene Crosser Date: Wed, 30 Apr 2014 06:45:00 +0000 (+0400) Subject: add synthetic TLSA (no handling yet) X-Git-Tag: 0.9.0.0~7 X-Git-Url: http://average.org/gitweb/?a=commitdiff_plain;h=890c9222bd6d44ff1d499fc3124c53e36d5fe61d;p=pdns-pipe-nmc.git add synthetic TLSA (no handling yet) --- diff --git a/NmcDom.hs b/NmcDom.hs index 79402e7..1ccf836 100644 --- a/NmcDom.hs +++ b/NmcDom.hs @@ -155,12 +155,13 @@ data NmcDom = NmcDom { domService :: Maybe [NmcRRService] , domDs :: Maybe [NmcRRDs] , domMx :: Maybe [String] -- Synthetic , domSrv :: Maybe [String] -- Synthetic + , domTlsa :: Maybe [String] -- Synthetic } deriving (Show, Eq) instance Default NmcDom where def = NmcDom Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing - Nothing Nothing Nothing Nothing Nothing Nothing + Nothing Nothing Nothing Nothing Nothing Nothing Nothing instance FromJSON NmcDom where -- Wherever we expect a domain object, there may be a string @@ -197,6 +198,7 @@ instance FromJSON NmcDom where <*> o .:? "ds" <*> return Nothing -- domMx not parsed <*> return Nothing -- domSrv not parsed + <*> return Nothing -- domTlsa not parsed parseJSON _ = empty instance Mergeable NmcDom where @@ -220,6 +222,7 @@ instance Mergeable NmcDom where , domDs = mergelm domDs , domMx = mergelm domMx , domSrv = mergelm domSrv + , domTlsa = mergelm domTlsa } where mergelm x = merge (x sub) (x dom) diff --git a/PowerDns.hs b/PowerDns.hs index ece3ac7..ef8211d 100644 --- a/PowerDns.hs +++ b/PowerDns.hs @@ -15,7 +15,7 @@ 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 @@ -30,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) @@ -45,6 +46,7 @@ rrType qt = case qt of "NS" -> RRTypeNS "DS" -> RRTypeDS "MX" -> RRTypeMX + "TLSA" -> RRTypeTLSA "ANY" -> RRTypeANY _ -> RRTypeError qt @@ -165,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 diff --git a/d/extra3 b/d/extra3 index bfb32b9..2bc1a3b 100644 --- a/d/extra3 +++ b/d/extra3 @@ -1 +1 @@ -{"ip":"9.8.7.6"} +{"ip":"9.8.7.6","tls":{"tcp":{"443":[[1,"660008F9",0]],"25":[[1,"7621B787",1]]}}}