Kea 2.7.6
isc::dhcp::DnrInstance Class Reference

Represents DNR Instance which is used both in DHCPv4 and DHCPv6 Encrypted DNS Option. More...

#include <option4_dnr.h>

+ Inheritance diagram for isc::dhcp::DnrInstance:

Public Types

typedef std::vector< isc::asiolink::IOAddressAddressContainer
 A Type defined for container holding IP addresses.
 
typedef boost::bimap< std::string, uint16_t > SvcParamsMap
 A Type defined for boost Bimap holding SvcParamKeys.
 

Public Member Functions

 DnrInstance (Option::Universe universe)
 Constructor of the empty DNR Instance.
 
virtual ~DnrInstance ()=default
 Default destructor.
 
void addIpAddress (const asiolink::IOAddress &ip_address)
 Adds IP address to ip_addresses_ container.
 
AddressContainer getAddresses () const
 Returns vector with addresses.
 
uint16_t getAddrLength () const
 Getter of the addr_length_.
 
uint8_t getAddrLengthSize () const
 Returns size in octets of Addr Length field.
 
std::string getAdnAsText () const
 Returns the Authentication domain name in the text format.
 
uint16_t getAdnLength () const
 Getter of the adn_length_.
 
uint8_t getAdnLengthSize () const
 Returns size in octets of ADN Length field.
 
std::string getDnrInstanceAsText () const
 Returns string representation of the DNR instance.
 
uint16_t getDnrInstanceDataLength () const
 Getter of the dnr_instance_data_length_.
 
uint8_t getDnrInstanceDataLengthSize () const
 Returns size in octets of DNR Instance Data Length field.
 
std::string getLogPrefix () const
 Returns Log prefix depending on V4/V6 Option universe.
 
uint8_t getMinimalLength () const
 Returns minimal length of the DNR instance data (without headers) in octets.
 
uint16_t getServicePriority () const
 Getter of the service_priority_.
 
const OptionBuffergetSvcParams () const
 Returns a reference to the buffer holding SvcParam data.
 
uint16_t getSvcParamsLength () const
 Getter of the svc_params_length_.
 
bool isAdnOnlyMode () const
 Returns whether ADN only mode is enabled or disabled.
 
virtual void packAddresses (isc::util::OutputBuffer &buf) const
 Writes the IP address(es) in the wire format into a buffer.
 
void packAdn (isc::util::OutputBuffer &buf) const
 Writes the ADN FQDN in the wire format into a buffer.
 
void packSvcParams (isc::util::OutputBuffer &buf) const
 Writes the Service Parameters in the wire format into a buffer.
 
void parseDnrInstanceConfigData (const std::string &config_txt)
 Parses a convenient notation of the option data, which may be used in config.
 
void setAdnOnlyMode (bool adn_only_mode)
 Setter of the adn_only_mode_ field.
 
void setDnrInstanceDataLength ()
 Setter of the dnr_instance_data_length_ field.
 
virtual void unpackAddresses (OptionBufferConstIter &begin, OptionBufferConstIter end)
 Unpacks IP address(es) from wire data and stores it/them in ip_addresses_.
 
void unpackAdn (OptionBufferConstIter &begin, OptionBufferConstIter end)
 Unpacks the ADN from given wire data buffer and stores it in adn_ field.
 
void unpackDnrInstanceDataLength (OptionBufferConstIter &begin, OptionBufferConstIter end)
 Unpacks DNR Instance Data Length from wire data buffer and stores it in dnr_instance_data_length_.
 
void unpackServicePriority (OptionBufferConstIter &begin)
 Unpacks Service Priority from wire data buffer and stores it in service_priority_.
 
void unpackSvcParams (OptionBufferConstIter &begin, OptionBufferConstIter end)
 Unpacks Service Parameters from wire data buffer and stores it in svc_params_buf_.
 

Static Public Attributes

static const std::unordered_set< std::string > ALPN_IDS
 Possible ALPN protocol IDs.
 
static const std::unordered_set< std::string > FORBIDDEN_SVC_PARAMS = {"ipv4hint", "ipv6hint"}
 Set of forbidden SvcParams.
 
static const uint8_t SERVICE_PRIORITY_SIZE = 2
 Size in octets of Service Priority field.
 
static const std::set< uint8_t > SUPPORTED_SVC_PARAMS = {1, 3, 7}
 Ordered set of supported SvcParamKeys.
 
static const SvcParamsMap SVC_PARAMS
 Service parameters, used in DNR options in DHCPv4 and DHCPv6, but also in RA and DNS.
 

Protected Member Functions

uint16_t dnrInstanceLen () const
 Calculates and returns length of DNR Instance data in octets.
 

Protected Attributes

uint16_t addr_length_
 Length of included IP addresses in octets.
 
boost::shared_ptr< isc::dns::Nameadn_
 Authentication domain name field of variable length.
 
uint16_t adn_length_
 Length of the authentication-domain-name data in octets.
 
bool adn_only_mode_
 Flag stating whether ADN only mode is used or not.
 
bool alpn_http_
 Indicates whether the "alpn" SvcParam contains support for HTTP.
 
uint16_t dnr_instance_data_length_
 Length of all following data inside this DNR instance in octets.
 
AddressContainer ip_addresses_
 Vector container holding one or more IP addresses.
 
uint16_t service_priority_
 The priority of this instance compared to other DNR instances.
 
OptionBuffer svc_params_buf_
 Service Parameters (SvcParams) (variable length) as on-wire data buffer.
 
uint16_t svc_params_length_
 Length of Service Parameters field in octets.
 
std::map< uint16_t, OpaqueDataTuplesvc_params_map_
 Service Parameters stored in a map.
 
Option::Universe universe_
 Either V4 or V6 Option universe.
 

Detailed Description

Represents DNR Instance which is used both in DHCPv4 and DHCPv6 Encrypted DNS Option.

DNR Instance includes the configuration data of an encrypted DNS resolver. It is used to build OPTION_V4_DNR (code 162). There may be multiple DNR Instances in one OPTION_V4_DNR Option. OPTION_V6_DNR (code 144) is using very similar structure, only that there must be only one DNR Instance per one OPTION_V6_DNR Option. That's why Option6Dnr class can derive from this DnrInstance class, whereas Option4Dnr class should have a container of DnrInstance's.

DNR Instance Data Format has been defined in the RFC9463.

Definition at line 55 of file option4_dnr.h.

Member Typedef Documentation

◆ AddressContainer

A Type defined for container holding IP addresses.

Definition at line 58 of file option4_dnr.h.

◆ SvcParamsMap

boost::bimap<std::string, uint16_t> isc::dhcp::DnrInstance::SvcParamsMap

A Type defined for boost Bimap holding SvcParamKeys.

Definition at line 61 of file option4_dnr.h.

Constructor & Destructor Documentation

◆ DnrInstance()

isc::dhcp::DnrInstance::DnrInstance ( Option::Universe universe)
explicit

Constructor of the empty DNR Instance.

Parameters
universeeither V4 or V6 Option universe

Definition at line 212 of file option4_dnr.cc.

◆ ~DnrInstance()

virtual isc::dhcp::DnrInstance::~DnrInstance ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ addIpAddress()

void isc::dhcp::DnrInstance::addIpAddress ( const asiolink::IOAddress & ip_address)

Adds IP address to ip_addresses_ container.

Parameters
ip_addressIP address to be added

Definition at line 387 of file option4_dnr.cc.

References ip_addresses_.

Referenced by unpackAddresses(), and isc::dhcp::Option6Dnr::unpackAddresses().

◆ dnrInstanceLen()

uint16_t isc::dhcp::DnrInstance::dnrInstanceLen ( ) const
protected

Calculates and returns length of DNR Instance data in octets.

Returns
length of DNR Instance data in octets.

Definition at line 377 of file option4_dnr.cc.

References addr_length_, adn_length_, adn_only_mode_, getAddrLengthSize(), getAdnLengthSize(), SERVICE_PRIORITY_SIZE, and svc_params_length_.

Referenced by isc::dhcp::Option6Dnr::len(), and setDnrInstanceDataLength().

+ Here is the call graph for this function:

◆ getAddresses()

AddressContainer isc::dhcp::DnrInstance::getAddresses ( ) const
inline

Returns vector with addresses.

We return a copy of our list. Although this includes overhead, it also makes this list safe to use after this option object is no longer available. As options are expected to hold only a few (1-3) addresses, the overhead is not that big.

Returns
Address container with addresses.

Definition at line 162 of file option4_dnr.h.

References ip_addresses_.

◆ getAddrLength()

uint16_t isc::dhcp::DnrInstance::getAddrLength ( ) const
inline

Getter of the addr_length_.

Returns
Length of enclosed IP addresses in octets.

Definition at line 143 of file option4_dnr.h.

References addr_length_.

◆ getAddrLengthSize()

uint8_t isc::dhcp::DnrInstance::getAddrLengthSize ( ) const
inline

Returns size in octets of Addr Length field.

Definition at line 181 of file option4_dnr.h.

Referenced by dnrInstanceLen(), unpackAddresses(), and isc::dhcp::Option6Dnr::unpackAddresses().

◆ getAdnAsText()

std::string isc::dhcp::DnrInstance::getAdnAsText ( ) const

Returns the Authentication domain name in the text format.

FQDN data stored in adn_ is converted into text format and returned.

Returns
Authentication domain name in the text format.

Definition at line 255 of file option4_dnr.cc.

References adn_.

Referenced by getDnrInstanceAsText().

◆ getAdnLength()

uint16_t isc::dhcp::DnrInstance::getAdnLength ( ) const
inline

Getter of the adn_length_.

Returns
Length of the authentication-domain-name data in octets.

Definition at line 124 of file option4_dnr.h.

References adn_length_.

◆ getAdnLengthSize()

uint8_t isc::dhcp::DnrInstance::getAdnLengthSize ( ) const
inline

Returns size in octets of ADN Length field.

Definition at line 191 of file option4_dnr.h.

Referenced by dnrInstanceLen(), and unpackAdn().

◆ getDnrInstanceAsText()

std::string isc::dhcp::DnrInstance::getDnrInstanceAsText ( ) const

Returns string representation of the DNR instance.

Returns
String with text representation.

Definition at line 345 of file option4_dnr.cc.

References addr_length_, adn_length_, adn_only_mode_, getAdnAsText(), ip_addresses_, service_priority_, SVC_PARAMS, svc_params_length_, and svc_params_map_.

Referenced by isc::dhcp::Option6Dnr::toText().

+ Here is the call graph for this function:

◆ getDnrInstanceDataLength()

uint16_t isc::dhcp::DnrInstance::getDnrInstanceDataLength ( ) const
inline

Getter of the dnr_instance_data_length_.

Returns
Length of all following data inside this DNR instance in octets.

Definition at line 110 of file option4_dnr.h.

References dnr_instance_data_length_.

Referenced by isc::dhcp::Option4Dnr::unpack().

◆ getDnrInstanceDataLengthSize()

uint8_t isc::dhcp::DnrInstance::getDnrInstanceDataLengthSize ( ) const
inline

Returns size in octets of DNR Instance Data Length field.

Definition at line 186 of file option4_dnr.h.

Referenced by unpackDnrInstanceDataLength().

◆ getLogPrefix()

std::string isc::dhcp::DnrInstance::getLogPrefix ( ) const
inline

Returns Log prefix depending on V4/V6 Option universe.

Returns
Log prefix as a string which can be used for prints when throwing an exception.

Definition at line 198 of file option4_dnr.h.

Referenced by isc::dhcp::Option6Dnr::packAddresses(), packAdn(), parseDnrInstanceConfigData(), isc::dhcp::Option4Dnr::unpack(), isc::dhcp::Option6Dnr::unpack(), unpackAddresses(), isc::dhcp::Option6Dnr::unpackAddresses(), unpackAdn(), unpackDnrInstanceDataLength(), and unpackSvcParams().

◆ getMinimalLength()

uint8_t isc::dhcp::DnrInstance::getMinimalLength ( ) const
inline

Returns minimal length of the DNR instance data (without headers) in octets.

Returns
Minimal length of the DNR instance data (without headers) in octets.

Definition at line 176 of file option4_dnr.h.

Referenced by isc::dhcp::Option4Dnr::unpack(), and isc::dhcp::Option6Dnr::unpack().

◆ getServicePriority()

uint16_t isc::dhcp::DnrInstance::getServicePriority ( ) const
inline

Getter of the service_priority_.

Returns
The priority of this DNR instance compared to other instances.

Definition at line 117 of file option4_dnr.h.

References service_priority_.

◆ getSvcParams()

const OptionBuffer & isc::dhcp::DnrInstance::getSvcParams ( ) const
inline

Returns a reference to the buffer holding SvcParam data.

Returns
a reference to the Service Parameters buffer

Definition at line 169 of file option4_dnr.h.

References svc_params_buf_.

◆ getSvcParamsLength()

uint16_t isc::dhcp::DnrInstance::getSvcParamsLength ( ) const
inline

Getter of the svc_params_length_.

Returns
Length of Service Parameters field in octets.

Definition at line 150 of file option4_dnr.h.

References svc_params_length_.

◆ isAdnOnlyMode()

bool isc::dhcp::DnrInstance::isAdnOnlyMode ( ) const
inline

Returns whether ADN only mode is enabled or disabled.

Definition at line 203 of file option4_dnr.h.

References adn_only_mode_.

◆ packAddresses()

void isc::dhcp::DnrInstance::packAddresses ( isc::util::OutputBuffer & buf) const
virtual

Writes the IP address(es) in the wire format into a buffer.

The IP address(es) (ip_addresses_) data is appended at the end of the buffer.

Parameters
[out]bufbuffer where IP address(es) will be written.

Reimplemented in isc::dhcp::Option6Dnr.

Definition at line 239 of file option4_dnr.cc.

References ip_addresses_, and isc::util::OutputBuffer::writeUint32().

+ Here is the call graph for this function:

◆ packAdn()

void isc::dhcp::DnrInstance::packAdn ( isc::util::OutputBuffer & buf) const

Writes the ADN FQDN in the wire format into a buffer.

The Authentication Domain Name - fully qualified domain name of the encrypted DNS resolver data is appended at the end of the buffer.

Parameters
[out]bufbuffer where ADN FQDN will be written.
Exceptions
InvalidOptionDnrDomainNameThrown when mandatory field ADN is empty.

Definition at line 221 of file option4_dnr.cc.

References adn_, isc::dns::LabelSequence::getData(), isc::dns::LabelSequence::getDataLength(), getLogPrefix(), isc_throw, and isc::util::OutputBuffer::writeData().

Referenced by isc::dhcp::Option6Dnr::pack().

+ Here is the call graph for this function:

◆ packSvcParams()

void isc::dhcp::DnrInstance::packSvcParams ( isc::util::OutputBuffer & buf) const

Writes the Service Parameters in the wire format into a buffer.

The Service Parameters (svc_params_) data is appended at the end of the buffer.

Parameters
[out]bufbuffer where SvcParams will be written.

Definition at line 248 of file option4_dnr.cc.

References svc_params_buf_, svc_params_length_, and isc::util::OutputBuffer::writeData().

Referenced by isc::dhcp::Option6Dnr::pack().

+ Here is the call graph for this function:

◆ parseDnrInstanceConfigData()

void isc::dhcp::DnrInstance::parseDnrInstanceConfigData ( const std::string & config_txt)

Parses a convenient notation of the option data, which may be used in config.

As an alternative to the binary format, we provide convenience option definition as a string in format: (for DNRv6) "100, dot1.example.org., 2001:db8::1 2001:db8::2, alpn=dot\\,doq\\,h2\\,h3 port=8530 dohpath=/q{?dns}" "200, resolver.example." - ADN only mode (for DNRv4) "100, dot1.example.org., 10.0.3.4 10.1.5.6, alpn=dot\\,doq\\,h2\\,h3 port=8530 dohpath=/q{?dns}" "200, resolver.example." - ADN only mode

Note that comma and pipe chars ("," 0x2C and "|" 0x7C) are used as separators in this syntax. That's why whenever they are used in config in fields' values, they must be escaped with double backslash as in example.

Note that this function parses single DnrInstance. For DNRv4 it is possible to have more than one DnrInstance per one Option. In that case this function must be called for each DnrInstance config.

Parameters
config_txtconvenient notation of the option data received as string
Exceptions
BadValueThrown in case parser found wrong format of received string.
InvalidOptionDnrDomainNameThrown in case parser had problems with extracting ADN FQDN.

Definition at line 551 of file option4_dnr.cc.

References adn_, adn_length_, getLogPrefix(), isc_throw, service_priority_, setAdnOnlyMode(), isc::util::str::tokens(), and isc::util::str::trim().

Referenced by isc::dhcp::Option6Dnr::unpack().

+ Here is the call graph for this function:

◆ setAdnOnlyMode()

void isc::dhcp::DnrInstance::setAdnOnlyMode ( bool adn_only_mode)
inline

Setter of the adn_only_mode_ field.

Parameters
adn_only_modeenabled/disabled setting

Definition at line 210 of file option4_dnr.h.

References adn_only_mode_.

Referenced by parseDnrInstanceConfigData(), and isc::dhcp::Option4Dnr::unpack().

◆ setDnrInstanceDataLength()

void isc::dhcp::DnrInstance::setDnrInstanceDataLength ( )
inline

Setter of the dnr_instance_data_length_ field.

Size is calculated basing on set Service Priority, ADN, IP address(es) and SvcParams. This should be called after all fields are set. This is only used for DHCPv4 Encrypted DNS Option.

Definition at line 219 of file option4_dnr.h.

References dnr_instance_data_length_, and dnrInstanceLen().

+ Here is the call graph for this function:

◆ unpackAddresses()

void isc::dhcp::DnrInstance::unpackAddresses ( OptionBufferConstIter & begin,
OptionBufferConstIter end )
virtual

Unpacks IP address(es) from wire data and stores it/them in ip_addresses_.

It may throw in case of malformed data detected during parsing.

Parameters
beginbeginning of the buffer from which the field will be read
endend of the buffer from which the field will be read
Exceptions
BadValueThrown in case of any issue with unpacking opaque data of the IP addresses.
OutOfRangeThrown in case of malformed data detected during parsing e.g. Addr Len not divisible by 4, Addr Len is 0.

Reimplemented in isc::dhcp::Option6Dnr.

Definition at line 410 of file option4_dnr.cc.

References addIpAddress(), addr_length_, getAddrLengthSize(), isc::dhcp::OpaqueDataTuple::getLength(), getLogPrefix(), isc_throw, isc::dhcp::OpaqueDataTuple::LENGTH_1_BYTE, isc::util::readUint32(), isc::dhcp::OpaqueDataTuple::unpack(), and isc::Exception::what().

Referenced by isc::dhcp::Option4Dnr::unpack().

+ Here is the call graph for this function:

◆ unpackAdn()

void isc::dhcp::DnrInstance::unpackAdn ( OptionBufferConstIter & begin,
OptionBufferConstIter end )

Unpacks the ADN from given wire data buffer and stores it in adn_ field.

It may throw in case of malformed data detected during parsing.

Parameters
beginbeginning of the buffer from which the ADN will be read
endend of the buffer from which the ADN will be read
Exceptions
BadValueThrown in case of any issue with unpacking opaque data of the ADN.
InvalidOptionDnrDomainNameThrown in case of any issue with parsing ADN from given wire data.

Definition at line 260 of file option4_dnr.cc.

References adn_, adn_length_, getAdnLengthSize(), isc::dhcp::OpaqueDataTuple::getData(), isc::dhcp::OpaqueDataTuple::getLength(), getLogPrefix(), isc::dhcp::OptionDataTypeUtil::getTupleLenFieldType(), isc_throw, universe_, isc::dhcp::OpaqueDataTuple::unpack(), and isc::Exception::what().

Referenced by isc::dhcp::Option4Dnr::unpack(), and isc::dhcp::Option6Dnr::unpack().

+ Here is the call graph for this function:

◆ unpackDnrInstanceDataLength()

void isc::dhcp::DnrInstance::unpackDnrInstanceDataLength ( OptionBufferConstIter & begin,
OptionBufferConstIter end )

Unpacks DNR Instance Data Length from wire data buffer and stores it in dnr_instance_data_length_.

It may throw in case of malformed data detected during parsing.

Parameters
beginbeginning of the buffer from which the field will be read
endend of the buffer from which the field will be read
Exceptions
OutOfRangeThrown in case of truncated data detected.

Definition at line 392 of file option4_dnr.cc.

References dnr_instance_data_length_, getDnrInstanceDataLengthSize(), getLogPrefix(), isc_throw, and isc::util::readUint16().

Referenced by isc::dhcp::Option4Dnr::unpack().

+ Here is the call graph for this function:

◆ unpackServicePriority()

void isc::dhcp::DnrInstance::unpackServicePriority ( OptionBufferConstIter & begin)

Unpacks Service Priority from wire data buffer and stores it in service_priority_.

Parameters
beginbeginning of the buffer from which the field will be read

Definition at line 404 of file option4_dnr.cc.

References isc::util::readUint16(), service_priority_, and SERVICE_PRIORITY_SIZE.

Referenced by isc::dhcp::Option4Dnr::unpack(), and isc::dhcp::Option6Dnr::unpack().

+ Here is the call graph for this function:

◆ unpackSvcParams()

void isc::dhcp::DnrInstance::unpackSvcParams ( OptionBufferConstIter & begin,
OptionBufferConstIter end )

Unpacks Service Parameters from wire data buffer and stores it in svc_params_buf_.

Parameters
beginbeginning of the buffer from which the field will be read
endend of the buffer from which the field will be read
Exceptions
OutOfRangeThrown when truncated data is detected.
InvalidOptionDnrSvcParamsThrown when invalid SvcParams syntax is detected.

Definition at line 448 of file option4_dnr.cc.

References FORBIDDEN_SVC_PARAMS, getLogPrefix(), isc::dhcp::OpaqueDataTuple::getTotalLength(), isc_throw, isc::dhcp::OpaqueDataTuple::LENGTH_2_BYTES, isc::util::readUint16(), SUPPORTED_SVC_PARAMS, SVC_PARAMS, svc_params_buf_, svc_params_length_, svc_params_map_, isc::dhcp::OpaqueDataTuple::unpack(), and isc::Exception::what().

Referenced by isc::dhcp::Option4Dnr::unpack(), and isc::dhcp::Option6Dnr::unpack().

+ Here is the call graph for this function:

Member Data Documentation

◆ addr_length_

uint16_t isc::dhcp::DnrInstance::addr_length_
protected

Length of included IP addresses in octets.

Definition at line 352 of file option4_dnr.h.

Referenced by dnrInstanceLen(), getAddrLength(), getDnrInstanceAsText(), isc::dhcp::Option6Dnr::pack(), unpackAddresses(), and isc::dhcp::Option6Dnr::unpackAddresses().

◆ adn_

boost::shared_ptr<isc::dns::Name> isc::dhcp::DnrInstance::adn_
protected

Authentication domain name field of variable length.

Authentication domain name field of variable length holding a fully qualified domain name of the encrypted DNS resolver. This field is formatted as specified in Section 10 of RFC8415.

Definition at line 338 of file option4_dnr.h.

Referenced by getAdnAsText(), packAdn(), parseDnrInstanceConfigData(), and unpackAdn().

◆ adn_length_

uint16_t isc::dhcp::DnrInstance::adn_length_
protected

Length of the authentication-domain-name data in octets.

Definition at line 349 of file option4_dnr.h.

Referenced by dnrInstanceLen(), getAdnLength(), getDnrInstanceAsText(), isc::dhcp::Option6Dnr::pack(), parseDnrInstanceConfigData(), and unpackAdn().

◆ adn_only_mode_

bool isc::dhcp::DnrInstance::adn_only_mode_
protected

Flag stating whether ADN only mode is used or not.

"Addr Length", "IP(v4/v6) Address(es)", and "Service Parameters (SvcParams)" fields are not present if the ADN-only mode is used.

Definition at line 369 of file option4_dnr.h.

Referenced by dnrInstanceLen(), getDnrInstanceAsText(), isAdnOnlyMode(), isc::dhcp::Option6Dnr::pack(), setAdnOnlyMode(), and isc::dhcp::Option6Dnr::unpack().

◆ alpn_http_

bool isc::dhcp::DnrInstance::alpn_http_
protected

Indicates whether the "alpn" SvcParam contains support for HTTP.

Defaults to false.

Definition at line 394 of file option4_dnr.h.

◆ ALPN_IDS

const std::unordered_set< std::string > isc::dhcp::DnrInstance::ALPN_IDS
static

Possible ALPN protocol IDs.

The IANA registry is maintained at https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids

Definition at line 97 of file option4_dnr.h.

◆ dnr_instance_data_length_

uint16_t isc::dhcp::DnrInstance::dnr_instance_data_length_
protected

Length of all following data inside this DNR instance in octets.

This field is only used for DHCPv4 Encrypted DNS Option.

Definition at line 343 of file option4_dnr.h.

Referenced by getDnrInstanceDataLength(), setDnrInstanceDataLength(), and unpackDnrInstanceDataLength().

◆ FORBIDDEN_SVC_PARAMS

const std::unordered_set< std::string > isc::dhcp::DnrInstance::FORBIDDEN_SVC_PARAMS = {"ipv4hint", "ipv6hint"}
static

Set of forbidden SvcParams.

The service parameters MUST NOT include "ipv4hint" or "ipv6hint" SvcParams as they are superseded by the included IP addresses.

Definition at line 71 of file option4_dnr.h.

Referenced by unpackSvcParams().

◆ ip_addresses_

AddressContainer isc::dhcp::DnrInstance::ip_addresses_
protected

Vector container holding one or more IP addresses.

One or more IP addresses to reach the encrypted DNS resolver. In case of DHCPv4, both private and public IPv4 addresses can be included in this field. In case of DHCPv6, an address can be link-local, ULA, or GUA.

Definition at line 360 of file option4_dnr.h.

Referenced by addIpAddress(), getAddresses(), getDnrInstanceAsText(), packAddresses(), and isc::dhcp::Option6Dnr::packAddresses().

◆ service_priority_

uint16_t isc::dhcp::DnrInstance::service_priority_
protected

The priority of this instance compared to other DNR instances.

Definition at line 346 of file option4_dnr.h.

Referenced by getDnrInstanceAsText(), getServicePriority(), isc::dhcp::Option6Dnr::pack(), parseDnrInstanceConfigData(), and unpackServicePriority().

◆ SERVICE_PRIORITY_SIZE

const uint8_t isc::dhcp::DnrInstance::SERVICE_PRIORITY_SIZE = 2
static

Size in octets of Service Priority field.

Definition at line 64 of file option4_dnr.h.

Referenced by dnrInstanceLen(), and unpackServicePriority().

◆ SUPPORTED_SVC_PARAMS

const std::set< uint8_t > isc::dhcp::DnrInstance::SUPPORTED_SVC_PARAMS = {1, 3, 7}
static

Ordered set of supported SvcParamKeys.

As per RFC9463 Section 3.1.5: The following service parameters MUST be supported by a DNR implementation: SvcParamKey=1 alpn: Used to indicate the set of supported protocols (Section 7.1 of [RFC9460]). SvcParamKey=3 port: Used to indicate the target port number for the encrypted DNS connection (Section 7.2 of [RFC9460]).

In addition, the following service parameter is RECOMMENDED to be supported by a DNR implementation: SvcParamKey=7 dohpath: Used to supply a relative DoH URI Template (Section 5.1 of [RFC9461]).

Definition at line 91 of file option4_dnr.h.

Referenced by unpackSvcParams().

◆ SVC_PARAMS

const DnrInstance::SvcParamsMap isc::dhcp::DnrInstance::SVC_PARAMS
static
Initial value:
=
boost::assign::list_of<DnrInstance::SvcParamsMap::relation>
("mandatory", 0)
("alpn", 1)
("no-default-alpn", 2)
("port", 3)
("ipv4hint", 4)
("ech", 5)
("ipv6hint", 6)
("dohpath", 7)
("ohttp", 8)

Service parameters, used in DNR options in DHCPv4 and DHCPv6, but also in RA and DNS.

The IANA registry is maintained at https://www.iana.org/assignments/dns-svcb/dns-svcb.xhtml

Definition at line 76 of file option4_dnr.h.

Referenced by getDnrInstanceAsText(), and unpackSvcParams().

◆ svc_params_buf_

OptionBuffer isc::dhcp::DnrInstance::svc_params_buf_
protected

Service Parameters (SvcParams) (variable length) as on-wire data buffer.

Specifies a set of service parameters that are encoded following the rules in Section 2.2 of RFC9460.

Definition at line 375 of file option4_dnr.h.

Referenced by getSvcParams(), packSvcParams(), and unpackSvcParams().

◆ svc_params_length_

uint16_t isc::dhcp::DnrInstance::svc_params_length_
protected

Length of Service Parameters field in octets.

Definition at line 363 of file option4_dnr.h.

Referenced by dnrInstanceLen(), getDnrInstanceAsText(), getSvcParamsLength(), packSvcParams(), and unpackSvcParams().

◆ svc_params_map_

std::map<uint16_t, OpaqueDataTuple> isc::dhcp::DnrInstance::svc_params_map_
protected

Service Parameters stored in a map.

A set of service parameters that are encoded following the same rules for encoding SvcParams using the wire format specified in Section 2.2 of RFC9460. SvcParams are stored here in a map where the key is the SvcParamKey as an uint_16. (Defined values are in Section 14.3.2 of RFC9460 - listed in SVC_PARAMS). The value is an OpaqueDataTuple containing:

  • the length of the SvcParamValue as an uint_16 integer in network byte order
  • data buffer with the SvcParamValue in a format determined by the SvcParamKey.

Definition at line 386 of file option4_dnr.h.

Referenced by getDnrInstanceAsText(), and unpackSvcParams().

◆ universe_

Option::Universe isc::dhcp::DnrInstance::universe_
protected

Either V4 or V6 Option universe.

Definition at line 331 of file option4_dnr.h.

Referenced by unpackAdn().


The documentation for this class was generated from the following files: