1 module PowerDns ( RRType(..)
9 data RRType = RRTypeSRV | RRTypeA | RRTypeAAAA | RRTypeCNAME
10 | RRTypeDNAME | RRTypeSOA | RRTypeRP | RRTypeLOC
12 | RRTypeANY | RRTypeError String
15 data PdnsRequest = PdnsRequestQ
19 , remoteIpAddress :: String
20 , localIpAddress :: Maybe String
21 , ednsSubnetAddress :: Maybe String
23 | PdnsRequestAXFR String
33 "CNAME" -> RRTypeCNAME
34 "DNAME" -> RRTypeDNAME
43 | ver >= 2 = case xs of
48 | ver >= 3 = case xs of
54 "PING":[] -> Right PdnsRequestPing
55 "AXFR":x:[] -> Right (PdnsRequestAXFR x)
56 "Q":qn:"IN":qt:id:rip:xs -> Right (PdnsRequestQ
60 , remoteIpAddress = rip
61 , localIpAddress = getLIp ver xs
62 , ednsSubnetAddress = getRIp ver xs
64 _ -> Left $ "Unparseable PDNS Request: " ++ s
66 pdnsOut :: RRType -> NmcDom -> String