X-Git-Url: http://www.average.org/gitweb/?p=pdns-pipe-nmc.git;a=blobdiff_plain;f=pdns-pipe-nmc.hs;h=ee5bd3771a900dd880f2add5c7dcacff6a100ae9;hp=a933c9ca70ade2f57d3c3a46b91b80923bf41d90;hb=bae658dcd2084b5f5be71987c6eba23f4106818a;hpb=26b23d266b588ea4b5bc4d53cbf479f9b40d26a0 diff --git a/pdns-pipe-nmc.hs b/pdns-pipe-nmc.hs index a933c9c..ee5bd37 100644 --- a/pdns-pipe-nmc.hs +++ b/pdns-pipe-nmc.hs @@ -49,9 +49,9 @@ qRsp rsp = -- NMC interface -queryNmc :: Manager -> Config -> String -> RRType -> String +queryNmc :: Manager -> Config -> String -> String -> IO (Either String NmcDom) -queryNmc mgr cfg fqdn qtype qid = do +queryNmc mgr cfg fqdn qid = do case reverse (splitOn "." fqdn) of "bit":dn:xs -> do rsp <- runResourceT $ @@ -89,11 +89,11 @@ main = do Left e -> putStrLn $ "ERROR\t" ++ e Right preq -> do case preq of - PdnsRequestQ qn qt id lip rip eip -> do - ncres <- queryNmc mgr cfg (qName preq) (qType preq) (iD preq) + PdnsRequestQ qname qtype id _ _ _ -> do + ncres <- queryNmc mgr cfg qname id case ncres of Left e -> putStrLn $ "ERROR\t" ++ e - Right dom -> putStrLn $ pdnsOut dom + Right dom -> putStrLn $ pdnsOut qtype dom PdnsRequestAXFR xfrreq -> - putStrLn ("ERROR\t No support for AXFR " ++ xfrreq) + putStrLn ("ERROR\tNo support for AXFR " ++ xfrreq) PdnsRequestPing -> putStrLn "OK"