, localIpAddress :: Maybe String
, ednsSubnetAddress :: Maybe String
}
- | PdnsRequestAXFR Int
+ | PdnsRequestAXFR Int (Maybe String)
| PdnsRequestPing
deriving (Show)
in
case words s of
"PING":[] -> Right PdnsRequestPing
- "AXFR":x:[] -> Right (PdnsRequestAXFR (getInt x))
+ "AXFR":x:xs ->
+ if ver < 4 then
+ case xs of
+ [] -> Right $ (PdnsRequestAXFR (getInt x)) Nothing
+ _ -> Left $ "Extra arguments in AXFR (v 1-3): " ++ s
+ else
+ case xs of
+ [z] -> Right $ (PdnsRequestAXFR (getInt x)) (Just z)
+ _ -> Left $ "Wrong arguments in AXFR (v 4+): " ++ s
"Q":qn:"IN":qt:id:rip:xs -> case rrType qt of
RRTypeError e ->
Left $ "Unrecognized RR type: " ++ e
++ "\t" ++ ttl ++ "\t" ++ (show id) ++ "\t" ++ x ++ "\n" ++ a)
"" $ dataRR rrtype gen name dom
where
- v3ext = case ver of
- 3 -> "0\t1\t"
- _ -> ""
+ v3ext = if ver >= 3 then "0\t1\t" else ""
ttl = show 3600
justl accessor _ _ dom = case accessor dom of