X-Git-Url: http://www.average.org/gitweb/?p=pdns-pipe-nmc.git;a=blobdiff_plain;f=PowerDns.hs;h=d93214f98d33352cfc2702ea8ba9e4e1889c7bb8;hp=7ed76e8a24bc046dcb42a96382d932f20c4210cb;hb=26b23d266b588ea4b5bc4d53cbf479f9b40d26a0;hpb=e8fbbca8429c42f84bab9e1ab14bb1ff52c5e4cd diff --git a/PowerDns.hs b/PowerDns.hs index 7ed76e8..d93214f 100644 --- a/PowerDns.hs +++ b/PowerDns.hs @@ -1,4 +1,10 @@ -module PowerDns where +module PowerDns ( RRType + , PdnsRequest(..) + , pdnsParse + , pdnsOut + ) where + +import NmcJson data RRType = RRTypeSRV | RRTypeA | RRTypeAAAA | RRTypeCNAME | RRTypeDNAME | RRTypeSOA | RRTypeRP | RRTypeLOC @@ -57,16 +63,5 @@ pdnsParse ver s = }) _ -> Left s -{- -pdnsOut :: String -> Either String PdnsRequest -> IO () -pdnsOut _ (Left e) = putStrLn ("ERROR\tUnparseable request: " ++ e) -pdnsOut uri (Right rq) = case rq of - PdnsRequestQ qn qt id lip rip eip -> do - dom <- queryNmc uri qn qt id - case dom of - Left e -> putStrLn ("ERROR\tNmc query error: " ++ e) - Right result -> print result - PdnsRequestAXFR xfrreq -> - putStrLn ("ERROR\t No support for AXFR " ++ xfrreq) - PdnsRequestPing -> putStrLn "OK" --} +pdnsOut :: NmcDom -> String +pdnsOut d = show d