| Copyright | (c) Viktor Dukhovni 2026 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | ietf-dane@dukhovni.org |
| Stability | unstable |
| Safe Haskell | None |
| Language | GHC2024 |
Net.DNSBase.EDNS.Option.ECS
Description
The Client Subnet EDNS option lets a recursive resolver forward a prefix of the original client's address to an authoritative server, so that authority-side answers (CDNs and similar) can be tailored to the client's network location. The specification, including privacy considerations, is RFC 7871.
Documentation
The Client Subnet EDNS option
(RFC 7871 section 6)
— three fields: a source prefix length, a scope prefix length,
and a (possibly truncated) IP address whose 16-bit FAMILY
field is implicit in the constructor's IP value (1 for
IPv4, 2 for IPv6).
+0 (MSB) +1 (LSB) +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | OPTION-CODE | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | OPTION-LENGTH | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | FAMILY | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | SOURCE PREFIX-LENGTH | SCOPE PREFIX-LENGTH | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | ADDRESS... / +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
The address is masked and truncated to the source prefix length
on encode and zero-padded on decode. A FAMILY value other
than 1 or 2 fails the decoder (a future revision may decode
such values as an opaque option instead).
Instances
| KnownEdnsOption O_ecs Source # | |||||
Defined in Net.DNSBase.EDNS.Option.ECS Associated Types
Methods optionExtensionVal :: forall b -> b ~ O_ecs => OptionExtensionVal O_ecs Source # optNum :: forall b -> b ~ O_ecs => OptNum Source # optPres :: forall b -> b ~ O_ecs => Builder -> Builder Source # optEncode :: forall s r. (Typeable r, Eq r, Show r) => O_ecs -> SPut s r Source # optDecode :: forall b -> b ~ O_ecs => OptionExtensionVal b -> Int -> SGet EdnsOption Source # | |||||
| Presentable O_ecs Source # | |||||
Defined in Net.DNSBase.EDNS.Option.ECS Methods present :: O_ecs -> Builder -> Builder Source # presentLazy :: O_ecs -> ByteString -> ByteString Source # | |||||
| Show O_ecs Source # | |||||
| Eq O_ecs Source # | |||||
| type OptionExtensionVal O_ecs Source # | |||||
Defined in Net.DNSBase.EDNS.Option.ECS | |||||