]> www.average.org Git - pdns-pipe-nmc.git/blobdiff - pdns-pipe-nmc.hs
domain normalization
[pdns-pipe-nmc.git] / pdns-pipe-nmc.hs
index 50d4bd860f8aa78e485825cf4e5eecb6d8befe77..603ea987356ca793de89e94b27cad172a02eb918 100644 (file)
@@ -55,8 +55,6 @@ qRsp rsp =
 
 -- NMC interface
 
-descend subdom dom = dom --FIXME
-
 queryNmc :: Manager -> Config -> String -> String
          -> IO (Either String NmcDom)
 queryNmc mgr cfg fqdn qid = do
@@ -66,7 +64,7 @@ queryNmc mgr cfg fqdn qid = do
              httpLbs (qReq cfg (L.pack ("d/" ++ dn)) (L.pack qid)) mgr
       return $ case qRsp rsp of
         Left  err -> Left err
-        Right dom -> Right $ descend xs dom
+        Right dom -> Right $ descendNmc xs dom
     _           ->
       return $ Left "Only \".bit\" domain is supported"
 
@@ -100,7 +98,7 @@ main = do
       Right preq -> do
         case preq of
           PdnsRequestQ qname qtype id _ _ _ ->
-            queryNmc mgr cfg qname id >>= putStr . (pdnsOut ver id qtype)
+            queryNmc mgr cfg qname id >>= putStr . (pdnsOut ver id qname qtype)
           PdnsRequestAXFR xfrreq ->
             putStr $ pdnsReport ("No support for AXFR " ++ xfrreq)
           PdnsRequestPing -> putStrLn "END"
@@ -110,4 +108,4 @@ main = do
 ask str = do
   cfg <- readConfig confFile
   mgr <- newManager def
-  queryNmc mgr cfg str "askid" >>= putStr . (pdnsOut 1 "askid" RRTypeANY)
+  queryNmc mgr cfg str "askid" >>= putStr . (pdnsOut 1 "askid" str RRTypeANY)