X-Git-Url: http://www.average.org/gitweb/?p=pdns-pipe-nmc.git;a=blobdiff_plain;f=PowerDns.hs;h=1c1e420c6e13c0c61d25e1dc98537933f802bad0;hp=d93214f98d33352cfc2702ea8ba9e4e1889c7bb8;hb=1ee19d546701efde4b4b2f2f70bedae907a5266d;hpb=26b23d266b588ea4b5bc4d53cbf479f9b40d26a0 diff --git a/PowerDns.hs b/PowerDns.hs index d93214f..1c1e420 100644 --- a/PowerDns.hs +++ b/PowerDns.hs @@ -1,4 +1,4 @@ -module PowerDns ( RRType +module PowerDns ( RRType(..) , PdnsRequest(..) , pdnsParse , pdnsOut @@ -61,7 +61,10 @@ pdnsParse ver s = , localIpAddress = getLIp ver xs , ednsSubnetAddress = getRIp ver xs }) - _ -> Left s + _ -> Left $ "Unparseable PDNS Request: " ++ s -pdnsOut :: NmcDom -> String -pdnsOut d = show d +pdnsOut :: Int -> RRType -> Either String NmcDom -> String +pdnsOut ver rrtype edom = + case edom of + Left err -> "LOG Error: " ++ err ++ "\nFAIL\n" + Right dom -> "DATA\n" ++ (show dom) ++ "\nEND\n" --FIXME