Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides Domain Name System data structures and (de)serialization routines.
Synopsis
- 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 = forall α.DnsData {}
- data DnsRecord = DnsRecord {
- dnsRecOwner :: !HostName
- dnsRecTtl :: !Word32
- dnsRecData :: !DnsData
- data DnsQType
- = forall α. 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.
Instances
Read HostName Source # | |
Show HostName Source # | |
Printable HostName Source # | |
Defined in Network.DNS | |
Textual HostName Source # | |
Defined in Network.DNS textual :: (Monad μ, CharParsing μ) => μ HostName # | |
Eq HostName Source # | |
Ord HostName Source # | |
Defined in Network.DNS | |
Hashable HostName Source # | |
Defined in Network.DNS | |
Printable (InetAddr HostName) Source # | |
Textual (InetAddr HostName) Source # | |
Defined in Network.DNS |
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.
Instances
Read a => Read (HostAddr a) Source # | |
Show a => Show (HostAddr a) Source # | |
Printable a => Printable (HostAddr a) Source # | |
Defined in Network.DNS | |
Printable (InetAddr a) => Printable (InetAddr (HostAddr a)) Source # | |
Textual a => Textual (HostAddr a) Source # | |
Defined in Network.DNS textual :: (Monad μ, CharParsing μ) => μ (HostAddr a) # | |
Textual (InetAddr a) => Textual (InetAddr (HostAddr a)) Source # | |
Defined in Network.DNS | |
Eq a => Eq (HostAddr a) Source # | |
Ord a => Ord (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.
forall α. StdDnsType (DnsType α) | Record type |
AllDnsType | All record types |
Instances
Show DnsQType Source # | |
Deserializable DnsQType Source # | |
Defined in Network.DNS get :: Deserializer μ => μ DnsQType # | |
Serializable DnsQType Source # | |
Defined in Network.DNS put :: Serializer s => DnsQType -> s # | |
SizedSerializable DnsQType Source # | |
Eq DnsQType Source # | |
Ord DnsQType Source # | |
Defined in Network.DNS |
dnsQTypeCode :: DnsQType -> Word16 Source #
Numeric representation of a DNS query type.
data DnsQuestion Source #
DNS question.
Instances
Show DnsQuestion Source # | |
Defined in Network.DNS showsPrec :: Int -> DnsQuestion -> ShowS # show :: DnsQuestion -> String # showList :: [DnsQuestion] -> ShowS # | |
Eq DnsQuestion Source # | |
Defined in Network.DNS (==) :: DnsQuestion -> DnsQuestion -> Bool # (/=) :: DnsQuestion -> DnsQuestion -> Bool # | |
Ord DnsQuestion Source # | |
Defined in Network.DNS compare :: DnsQuestion -> DnsQuestion -> Ordering # (<) :: DnsQuestion -> DnsQuestion -> Bool # (<=) :: DnsQuestion -> DnsQuestion -> Bool # (>) :: DnsQuestion -> DnsQuestion -> Bool # (>=) :: DnsQuestion -> DnsQuestion -> Bool # max :: DnsQuestion -> DnsQuestion -> DnsQuestion # min :: DnsQuestion -> DnsQuestion -> DnsQuestion # |
Request message.
DnsReq | Standard query |
| |
DnsInvReq | Inverse query |
Instances
Show DnsReq Source # | |
Deserializable DnsReq Source # | |
Defined in Network.DNS get :: Deserializer μ => μ DnsReq # | |
Serializable DnsReq Source # | |
Defined in Network.DNS put :: Serializer s => DnsReq -> s # |
Errors returned in responses.
FormatDnsError | |
FailureDnsError | |
NoNameDnsError | |
NotImplDnsError | |
RefusedDnsError | |
NameExistsDnsError | |
RsExistsDnsError | |
NoRsDnsError | |
NotAuthDnsError | |
NotInZoneDnsError |
Instances
Enum DnsError Source # | |
Read DnsError Source # | |
Show DnsError Source # | |
Eq DnsError Source # | |
Ord DnsError Source # | |
Defined in Network.DNS |
Response message.
DnsResp | Normal response. |
| |
DnsErrResp | Error response. |
|
Instances
Show DnsResp Source # | |
Deserializable DnsResp Source # | |
Defined in Network.DNS get :: Deserializer μ => μ DnsResp # | |
Serializable DnsResp Source # | |
Defined in Network.DNS put :: Serializer s => DnsResp -> s # |