Kea 2.5.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.
 

Public Member Functions

 DnrInstance (Option::Universe universe)
 Constructor of the empty DNR Instance.
 
 DnrInstance (Option::Universe universe, uint16_t service_priority, const std::string &adn)
 Constructor of the DNR Instance in ADN only mode.
 
 DnrInstance (Option::Universe universe, uint16_t service_priority, const std::string &adn, const AddressContainer &ip_addresses, const std::string &svc_params)
 Constructor of the DNR Instance with all fields from params.
 
virtual ~DnrInstance ()=default
 Default destructor.
 
void addIpAddress (const asiolink::IOAddress &ip_address)
 Adds IP address to ip_addresses_ container.
 
void checkFields ()
 Checks IP address(es) field if data is correct and throws in case of issue found.
 
void checkSvcParams (bool from_wire_data=true)
 Checks SvcParams field if encoded correctly and throws in case of issue found.
 
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 std::string & getSvcParams () const
 Getter of the svc_params_ field.
 
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 setAdn (const std::string &adn)
 Sets Authentication domain name from given string.
 
void setAdnOnlyMode (bool adn_only_mode)
 Setter of the adn_only_mode_ 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_.
 

Static Public Attributes

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.
 

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.
 
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.
 
std::string svc_params_
 Service Parameters (SvcParams) (variable length).
 
uint16_t svc_params_length_
 Length of Service Parameters field in octets.
 
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 draft-ietf-add-dnr (to be replaced with published RFC).

Definition at line 50 of file option4_dnr.h.

Member Typedef Documentation

◆ AddressContainer

A Type defined for container holding IP addresses.

Definition at line 53 of file option4_dnr.h.

Constructor & Destructor Documentation

◆ DnrInstance() [1/3]

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

Constructor of the empty DNR Instance.

Parameters
universeeither V4 or V6 Option universe

Definition at line 122 of file option4_dnr.cc.

◆ DnrInstance() [2/3]

isc::dhcp::DnrInstance::DnrInstance ( Option::Universe  universe,
uint16_t  service_priority,
const std::string &  adn,
const AddressContainer ip_addresses,
const std::string &  svc_params 
)

Constructor of the DNR Instance with all fields from params.

Constructor of the DNR Instance where all fields i.e. Service priority, ADN, IP address(es) and Service params are provided as ctor parameters.

Parameters
universeeither V4 or V6 Option universe
service_priorityService priority
adnADN FQDN
ip_addressesContainer of IP addresses
svc_paramsService Parameters
Exceptions
InvalidOptionDnrDomainNameThrown in case of any issue with parsing ADN
InvalidOptionDnrSvcParamsThrown when checkSvcParams(from_wire_data) throws
OutOfRangeThrown in case of no IP addresses found or when IP addresses length is too big

Definition at line 130 of file option4_dnr.cc.

References checkFields(), and setAdn().

+ Here is the call graph for this function:

◆ DnrInstance() [3/3]

isc::dhcp::DnrInstance::DnrInstance ( Option::Universe  universe,
uint16_t  service_priority,
const std::string &  adn 
)

Constructor of the DNR Instance in ADN only mode.

Constructor of the DNR Instance in ADN only mode i.e. only Service priority and ADN FQDN are provided as ctor parameters.

Parameters
universeeither V4 or V6 Option universe
service_priorityService priority
adnADN FQDN
Exceptions
InvalidOptionDnrDomainNameThrown in case of any issue with parsing ADN

Definition at line 146 of file option4_dnr.cc.

References setAdn().

+ Here is the call graph for this function:

◆ ~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 406 of file option4_dnr.cc.

References ip_addresses_.

Referenced by unpackAddresses().

◆ checkFields()

void isc::dhcp::DnrInstance::checkFields ( )

Checks IP address(es) field if data is correct and throws in case of issue found.

Fields lengths are also calculated and saved to member variables.

Exceptions
OutOfRangeThrown in case of no IP addresses found or when IP addresses length is too big
InvalidOptionDnrSvcParamsThrown when checkSvcParams(from_wire_data) throws

Definition at line 341 of file option4_dnr.cc.

References addr_length_, adn_only_mode_, checkSvcParams(), dnr_instance_data_length_, dnrInstanceLen(), getLogPrefix(), ip_addresses_, isc_throw, svc_params_, universe_, and isc::dhcp::Option::V4.

Referenced by DnrInstance().

+ Here is the call graph for this function:

◆ checkSvcParams()

void isc::dhcp::DnrInstance::checkSvcParams ( bool  from_wire_data = true)

Checks SvcParams field if encoded correctly and throws in case of issue found.

The field should be encoded following the rules in Section 2.1 of [I-D.ietf-dnsop-svcb-https]. SvcParams are a whitespace-separated list, with each SvcParam consisting of a SvcParamKey=SvcParamValue pair or a standalone SvcParamKey.

Note
It is user's responsibility to provide correct configuration of SvcParams as described in Section 2.1 of [I-D.ietf-dnsop-svcb-https]. Currently, SvcParamValue is not verified. Proper syntax of SvcParamValue is described in Appendix A of [I-D.ietf-dnsop-svcb-https].
Parameters
from_wire_dataused to determine whether SvcParams data comes from unpacked wire data or from ctor param
Exceptions
InvalidOptionDnrSvcParamsThrown in case of any issue found when checking ServiceParams field syntax

Definition at line 264 of file option4_dnr.cc.

References FORBIDDEN_SVC_PARAMS, getLogPrefix(), isc_throw, svc_params_, svc_params_length_, isc::util::str::tokens(), and isc::util::str::trim().

Referenced by checkFields(), and unpackSvcParams().

+ Here is the call graph for this function:

◆ 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 396 of file option4_dnr.cc.

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

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

+ 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 163 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 144 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 182 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 193 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 125 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 192 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 377 of file option4_dnr.cc.

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

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 111 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 187 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 199 of file option4_dnr.h.

Referenced by checkFields(), checkSvcParams(), isc::dhcp::Option6Dnr::packAddresses(), packAdn(), setAdn(), isc::dhcp::Option4Dnr::unpack(), isc::dhcp::Option6Dnr::unpack(), unpackAddresses(), isc::dhcp::Option6Dnr::unpackAddresses(), unpackAdn(), and unpackDnrInstanceDataLength().

◆ 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 177 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 118 of file option4_dnr.h.

References service_priority_.

◆ getSvcParams()

const std::string & isc::dhcp::DnrInstance::getSvcParams ( ) const
inline

Getter of the svc_params_ field.

Returns
Returns Service Parameters as a string.

Definition at line 170 of file option4_dnr.h.

References svc_params_.

◆ 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 151 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 204 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 177 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 159 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 186 of file option4_dnr.cc.

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

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

+ Here is the call graph for this function:

◆ setAdn()

void isc::dhcp::DnrInstance::setAdn ( const std::string &  adn)

Sets Authentication domain name from given string.

Sets FQDN of the encrypted DNS resolver from given string. It may throw an exception if parsing of the FQDN fails or if provided FQDN length is bigger than uint16_t Max. It also calculates and sets value of Addr length field.

Parameters
adnstring representation of ADN FQDN
Exceptions
InvalidOptionDnrDomainNameThrown in case of any issue with parsing ADN from given string.

Definition at line 198 of file option4_dnr.cc.

References adn_, adn_length_, dnr_instance_data_length_, dnrInstanceLen(), isc::dns::LabelSequence::getData(), getLogPrefix(), isc_throw, isc::util::str::trim(), universe_, isc::dhcp::Option::V4, and isc::Exception::what().

Referenced by DnrInstance().

+ 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 224 of file option4_dnr.h.

References adn_only_mode_.

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

◆ 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 429 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 230 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 411 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 423 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_.

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

Definition at line 467 of file option4_dnr.cc.

References checkSvcParams(), svc_params_, and svc_params_length_.

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

◆ 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 344 of file option4_dnr.h.

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

◆ adn_length_

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

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

Definition at line 355 of file option4_dnr.h.

Referenced by dnrInstanceLen(), getAdnLength(), getDnrInstanceAsText(), isc::dhcp::Option6Dnr::pack(), setAdn(), 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 375 of file option4_dnr.h.

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

◆ 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 349 of file option4_dnr.h.

Referenced by checkFields(), getDnrInstanceDataLength(), setAdn(), 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 63 of file option4_dnr.h.

Referenced by checkSvcParams().

◆ 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 366 of file option4_dnr.h.

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

◆ service_priority_

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

The priority of this instance compared to other DNR instances.

Definition at line 352 of file option4_dnr.h.

Referenced by getDnrInstanceAsText(), getServicePriority(), isc::dhcp::Option6Dnr::pack(), 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 56 of file option4_dnr.h.

Referenced by dnrInstanceLen(), and unpackServicePriority().

◆ svc_params_

std::string isc::dhcp::DnrInstance::svc_params_
protected

Service Parameters (SvcParams) (variable length).

Specifies a set of service parameters that are encoded following the rules in Section 2.1 of [I-D.ietf-dnsop-svcb-https].

Definition at line 381 of file option4_dnr.h.

Referenced by checkFields(), checkSvcParams(), getDnrInstanceAsText(), 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 369 of file option4_dnr.h.

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

◆ universe_

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

Either V4 or V6 Option universe.

Definition at line 337 of file option4_dnr.h.

Referenced by checkFields(), setAdn(), and unpackAdn().


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