-module PowerDns ( RRType
+module PowerDns ( RRType(..)
, PdnsRequest(..)
, pdnsParse
+ , pdnsReport
, pdnsOut
) where
})
_ -> Left $ "Unparseable PDNS Request: " ++ s
-pdnsOut :: RRType -> NmcDom -> String
-pdnsOut _ d = show d
+pdnsReport :: String -> String
+pdnsReport err =
+ "LOG\tError: " ++ err ++ "\nFAIL\n"
+
+pdnsOut :: Int -> String -> RRType -> Either String NmcDom -> String
+pdnsOut ver id rrtype edom =
+ case edom of
+ Left err -> pdnsReport err
+ Right dom -> pdnsAmend ver id rrtype dom "END\n"
+
+pdnsAmend :: Int -> String -> RRType -> NmcDom -> String -> String
+pdnsAmend ver id rrtype dom accum =
+ "DATA\t" ++ (show dom) ++ "\n" ++ accum --FIXME