dnsbase
Copyright(c) Viktor Dukhovni 2026
LicenseBSD-3-Clause
Maintainerietf-dane@dukhovni.org
Stabilityunstable
Safe HaskellNone
LanguageGHC2024

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.

Synopsis

Documentation

data O_ecs Source #

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).

Constructors

O_ECS Word8 Word8 IP 

Instances

Instances details
KnownEdnsOption O_ecs Source # 
Instance details

Defined in Net.DNSBase.EDNS.Option.ECS

Associated Types

type OptionExtensionVal O_ecs 
Instance details

Defined in Net.DNSBase.EDNS.Option.ECS

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 # 
Instance details

Defined in Net.DNSBase.EDNS.Option.ECS

Show O_ecs Source # 
Instance details

Defined in Net.DNSBase.EDNS.Option.ECS

Methods

showsPrec :: Int -> O_ecs -> ShowS #

show :: O_ecs -> String #

showList :: [O_ecs] -> ShowS #

Eq O_ecs Source # 
Instance details

Defined in Net.DNSBase.EDNS.Option.ECS

Methods

(==) :: O_ecs -> O_ecs -> Bool #

(/=) :: O_ecs -> O_ecs -> Bool #

type OptionExtensionVal O_ecs Source # 
Instance details

Defined in Net.DNSBase.EDNS.Option.ECS