]> www.average.org Git - pdns-pipe-nmc.git/commitdiff
add synthetic TLSA (no handling yet)
authorEugene Crosser <crosser@average.org>
Wed, 30 Apr 2014 06:45:00 +0000 (10:45 +0400)
committerEugene Crosser <crosser@average.org>
Wed, 30 Apr 2014 06:45:00 +0000 (10:45 +0400)
NmcDom.hs
PowerDns.hs
d/extra3

index 79402e7da1b8f185421842552195c06a8b895812..1ccf836b9049b8bfe15aebbefda18d67bea4f233 100644 (file)
--- 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)
index ece3ac79a5dadb4d96469bfcbb77ea2d776afdcc..ef8211dfc373e6769eab671ee2b8d654bb331b47 100644 (file)
@@ -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
index bfb32b99bd90f95428128ebdc49e5063bc95866a..2bc1a3b344c5ffc578580dc70836eddcd12e4edd 100644 (file)
--- 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]]}}}