Kea  2.1.7-git
isc::dhcp::Option4ClientFqdnImpl Class Reference

Implements the logic for the Option6ClientFqdn class. More...

Public Member Functions

 Option4ClientFqdnImpl (const uint8_t flags, const Option4ClientFqdn::Rcode &rcode, const std::string &domain_name, const Option4ClientFqdn::DomainNameType name_type)
 Constructor, from domain name. More...
 
 Option4ClientFqdnImpl (OptionBufferConstIter first, OptionBufferConstIter last)
 Constructor, from wire data. More...
 
 Option4ClientFqdnImpl (const Option4ClientFqdnImpl &source)
 Copy constructor. More...
 
Option4ClientFqdnImploperator= (const Option4ClientFqdnImpl &source)
 Assignment operator. More...
 
void parseASCIIDomainName (OptionBufferConstIter first, OptionBufferConstIter last)
 Parse domain-name encoded in the deprecated ASCII format. More...
 
void parseCanonicalDomainName (OptionBufferConstIter first, OptionBufferConstIter last)
 Parse domain-name encoded in the canonical format. More...
 
void parseWireData (OptionBufferConstIter first, OptionBufferConstIter last)
 Parse the Option provided in the wire format. More...
 
void setDomainName (const std::string &domain_name, const Option4ClientFqdn::DomainNameType name_type)
 Set a new domain name for the option. More...
 

Static Public Member Functions

static void checkFlags (const uint8_t flags, const bool check_mbz)
 Check if flags are valid. More...
 

Public Attributes

boost::shared_ptr< isc::dns::Namedomain_name_
 Holds the pointer to a domain name carried in the option. More...
 
Option4ClientFqdn::DomainNameType domain_name_type_
 Indicates whether domain name is partial or fully qualified. More...
 
uint8_t flags_
 Holds flags carried by the option. More...
 
Option4ClientFqdn::Rcode rcode1_
 Holds RCODE1 and RCODE2 values. More...
 
Option4ClientFqdn::Rcode rcode2_
 

Detailed Description

Implements the logic for the Option6ClientFqdn class.

The purpose of the class is to separate the implementation details of the Option4ClientFqdn class from the interface. This implementation uses libdns classes to process FQDNs. At some point it may be desired to split libdhcp++ from libdns. In such case the implementation of this class may be changed. The declaration of the Option6ClientFqdn class holds the pointer to implementation, so the transition to a different implementation would not affect the header file.

Definition at line 30 of file option4_client_fqdn.cc.

Constructor & Destructor Documentation

◆ Option4ClientFqdnImpl() [1/3]

isc::dhcp::Option4ClientFqdnImpl::Option4ClientFqdnImpl ( const uint8_t  flags,
const Option4ClientFqdn::Rcode rcode,
const std::string &  domain_name,
const Option4ClientFqdn::DomainNameType  name_type 
)

Constructor, from domain name.

Parameters
flagsA value of the flags option field.
rcodeAn object representing the RCODE1 and RCODE2 values.
domain_nameA domain name carried by the option given in the textual format.
name_typeA value which indicates whether domain-name is partial or fully qualified.

Definition at line 121 of file option4_client_fqdn.cc.

References checkFlags(), flags_, and setDomainName().

Referenced by Option4ClientFqdnImpl().

+ Here is the call graph for this function:

◆ Option4ClientFqdnImpl() [2/3]

isc::dhcp::Option4ClientFqdnImpl::Option4ClientFqdnImpl ( OptionBufferConstIter  first,
OptionBufferConstIter  last 
)

Constructor, from wire data.

Parameters
firstAn iterator pointing to the beginning of the option data in the wire format.
lastAn iterator pointing to the end of the option data in the wire format.

Definition at line 144 of file option4_client_fqdn.cc.

References checkFlags(), flags_, Option4ClientFqdnImpl(), and parseWireData().

+ Here is the call graph for this function:

◆ Option4ClientFqdnImpl() [3/3]

isc::dhcp::Option4ClientFqdnImpl::Option4ClientFqdnImpl ( const Option4ClientFqdnImpl source)

Copy constructor.

Parameters
sourceAn object being copied.

Definition at line 156 of file option4_client_fqdn.cc.

References domain_name_.

Member Function Documentation

◆ checkFlags()

void isc::dhcp::Option4ClientFqdnImpl::checkFlags ( const uint8_t  flags,
const bool  check_mbz 
)
static

Check if flags are valid.

In particular, this function checks if the N and S bits are not set to 1 in the same time.

Parameters
flagsA value carried by the flags field of the option.
check_mbzA boolean value which indicates if this function should check if the MBZ bits are set (if true). This parameter should be set to false when validating flags in the received message. This is because server should ignore MBZ bits in received messages.
Exceptions
InvalidOption6FqdnFlagsif flags are invalid.

Definition at line 230 of file option4_client_fqdn.cc.

References isc::dhcp::Option4ClientFqdn::FLAG_MASK, isc::dhcp::Option4ClientFqdn::FLAG_N, isc::dhcp::Option4ClientFqdn::FLAG_S, and isc_throw.

Referenced by Option4ClientFqdnImpl(), isc::dhcp::Option4ClientFqdn::setFlag(), and isc::dhcp::Option4ClientFqdn::unpack().

◆ operator=()

Option4ClientFqdnImpl & isc::dhcp::Option4ClientFqdnImpl::operator= ( const Option4ClientFqdnImpl source)

Assignment operator.

Parameters
sourceAn object which is being assigned.

Definition at line 171 of file option4_client_fqdn.cc.

References domain_name_, domain_name_type_, flags_, rcode1_, rcode2_, and setDomainName().

+ Here is the call graph for this function:

◆ parseASCIIDomainName()

void isc::dhcp::Option4ClientFqdnImpl::parseASCIIDomainName ( OptionBufferConstIter  first,
OptionBufferConstIter  last 
)

Parse domain-name encoded in the deprecated ASCII format.

Parameters
firstAn iterator pointing to the beginning of the option data where domain-name is stored.
lastAn iterator pointing to the end of the option data where domain-name is stored.

Definition at line 318 of file option4_client_fqdn.cc.

References domain_name_, domain_name_type_, isc::dhcp::Option4ClientFqdn::FULL, and isc::dhcp::Option4ClientFqdn::PARTIAL.

Referenced by parseWireData().

◆ parseCanonicalDomainName()

void isc::dhcp::Option4ClientFqdnImpl::parseCanonicalDomainName ( OptionBufferConstIter  first,
OptionBufferConstIter  last 
)

Parse domain-name encoded in the canonical format.

Definition at line 283 of file option4_client_fqdn.cc.

References domain_name_, domain_name_type_, isc::dhcp::Option4ClientFqdn::FULL, and isc::dhcp::Option4ClientFqdn::PARTIAL.

Referenced by parseWireData().

◆ parseWireData()

void isc::dhcp::Option4ClientFqdnImpl::parseWireData ( OptionBufferConstIter  first,
OptionBufferConstIter  last 
)

Parse the Option provided in the wire format.

Parameters
firstAn iterator pointing to the beginning of the option data in the wire format.
lastAn iterator pointing to the end of the option data in the wire format.

Definition at line 250 of file option4_client_fqdn.cc.

References isc::dhcp::DHO_FQDN, isc::dhcp::Option4ClientFqdn::FIXED_FIELDS_LEN, isc::dhcp::Option4ClientFqdn::FLAG_E, flags_, isc_throw, parseASCIIDomainName(), parseCanonicalDomainName(), rcode1_, rcode2_, and isc::Exception::what().

Referenced by Option4ClientFqdnImpl(), and isc::dhcp::Option4ClientFqdn::unpack().

+ Here is the call graph for this function:

◆ setDomainName()

void isc::dhcp::Option4ClientFqdnImpl::setDomainName ( const std::string &  domain_name,
const Option4ClientFqdn::DomainNameType  name_type 
)

Set a new domain name for the option.

Parameters
domain_nameA new domain name to be assigned.
name_typeA value which indicates whether the domain-name is partial or fully qualified.

Definition at line 190 of file option4_client_fqdn.cc.

References domain_name_, domain_name_type_, isc::dhcp::Option4ClientFqdn::FULL, isc_throw, and isc::util::str::trim().

Referenced by operator=(), Option4ClientFqdnImpl(), and isc::dhcp::Option4ClientFqdn::setDomainName().

+ Here is the call graph for this function:

Member Data Documentation

◆ domain_name_

boost::shared_ptr<isc::dns::Name> isc::dhcp::Option4ClientFqdnImpl::domain_name_

◆ domain_name_type_

◆ flags_

◆ rcode1_

Option4ClientFqdn::Rcode isc::dhcp::Option4ClientFqdnImpl::rcode1_

◆ rcode2_


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