Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides Domain Name System data structures and (de)serialization routines.
- data HostName
- aHostName :: Proxy HostName
- hostName :: HostName -> ByteString
- hostNameLabels :: HostName -> [ByteString]
- arpaHostName :: IP -> HostName
- data HostAddr a
- type Host4Addr = HostAddr IP4
- type Host6Addr = HostAddr IP6
- aHostAddr :: Proxy HostAddr
- aHostAddrOf :: Proxy a -> Proxy (HostAddr a)
- aHost4Addr :: Proxy Host4Addr
- aHost6Addr :: Proxy Host6Addr
- aHostAddrIP :: Proxy (HostAddr IP)
- type DnsId = Word16
- data DnsType α where
- dnsTypeCode :: DnsType α -> Word16
- data DnsData = DnsData {}
- data DnsRecord = DnsRecord {
- dnsRecOwner :: !HostName
- dnsRecTtl :: !Word32
- dnsRecData :: !DnsData
- data DnsQType
- = StdDnsType (DnsType α)
- | AllDnsType
- dnsQTypeCode :: DnsQType -> Word16
- data DnsQuestion = DnsQuestion {}
- data DnsReq
- = DnsReq {
- dnsReqId :: !DnsId
- dnsReqTruncd :: !Bool
- dnsReqRec :: !Bool
- dnsReqQuestion :: !DnsQuestion
- | DnsInvReq { }
- = DnsReq {
- data DnsError
- data DnsResp
- = DnsResp {
- dnsRespId :: !DnsId
- dnsRespTruncd :: !Bool
- dnsRespAuthd :: !Bool
- dnsRespRec :: !Bool
- dnsRespQuestion :: !DnsQuestion
- dnsRespAnswers :: [DnsRecord]
- dnsRespAuths :: [DnsRecord]
- dnsRespExtras :: [DnsRecord]
- | DnsErrResp {
- dnsRespId :: !DnsId
- dnsRespError :: !DnsError
- = DnsResp {
Documentation
Host name.
hostName :: HostName -> ByteString Source #
Host name as a ByteString
.
hostNameLabels :: HostName -> [ByteString] Source #
List the HostName
labels:
hostNameLabels
(fromJust
(fromString
"www.google.com")) = ["www", "google", "com"]
arpaHostName :: IP -> HostName Source #
Host name for reverse DNS lookups.
toString
(arpaHostName
(IPv4
(ip4FromOctets
1 2 3 4))) = "4.3.2.1.in-addr.arpa"toString
(arpaHostName
(IPv6
(ip6FromWords
1 2 3 4 5 6 7 8))) = "8.0.0.0.7.0.0.0.6.0.0.0.5.0.0.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.ip6.arpa"
Host address. Either a host name or an IP address.
Eq a => Eq (HostAddr a) Source # | |
Ord a => Ord (HostAddr a) Source # | |
Read a => Read (HostAddr a) Source # | |
Show a => Show (HostAddr a) Source # | |
Printable (InetAddr a) => Printable (InetAddr (HostAddr a)) Source # | |
Printable a => Printable (HostAddr a) Source # | |
Textual (InetAddr a) => Textual (InetAddr (HostAddr a)) Source # | |
Textual a => Textual (HostAddr a) Source # | |
Resource Record type.
AddrDnsType :: DnsType IP4 | |
Addr6DnsType :: DnsType IP6 | |
NsDnsType :: DnsType HostName | |
CNameDnsType :: DnsType HostName | |
PtrDnsType :: DnsType HostName | |
MxDnsType :: DnsType (Word16, HostName) |
dnsTypeCode :: DnsType α -> Word16 Source #
Numeric representation of a Resource Record type.
Resource Record data.
Resource Record.
DnsRecord | |
|
DNS query type.
StdDnsType (DnsType α) | Record type |
AllDnsType | All record types |
dnsQTypeCode :: DnsQType -> Word16 Source #
Numeric representation of a DNS query type.
Request message.
DnsReq | Standard query |
| |
DnsInvReq | Inverse query |
Errors returned in responses.
Response message.
DnsResp | Normal response. |
| |
DnsErrResp | Error response. |
|