Kea 2.5.8
isc::d2::D2Params Class Reference

Acts as a storage vault for D2 global scalar parameters. More...

#include <d2_config.h>

Public Member Functions

 D2Params ()
 Default constructor The default constructor creates an instance that has updates disabled.
 
 D2Params (const isc::asiolink::IOAddress &ip_address, const size_t port, const size_t dns_server_timeout, const dhcp_ddns::NameChangeProtocol &ncr_protocol, const dhcp_ddns::NameChangeFormat &ncr_format)
 Constructor.
 
virtual ~D2Params ()
 Destructor.
 
std::string getConfigSummary () const
 Return summary of the configuration used by D2.
 
size_t getDnsServerTimeout () const
 Return the DNS server timeout value.
 
const isc::asiolink::IOAddressgetIpAddress () const
 Return the IP address D2 listens on.
 
const dhcp_ddns::NameChangeFormatgetNcrFormat () const
 Return the expected format of inbound requests (NCRs).
 
const dhcp_ddns::NameChangeProtocolgetNcrProtocol () const
 Return the socket protocol in use.
 
size_t getPort () const
 Return the TCP/UPD port D2 listens on.
 
bool operator!= (const D2Params &other) const
 Compares two D2Params's for inequality.
 
bool operator== (const D2Params &other) const
 Compares two D2Params's for equality.
 
std::string toText () const
 Generates a string representation of the class contents.
 

Protected Member Functions

virtual void validateContents ()
 Validates member values.
 

Detailed Description

Acts as a storage vault for D2 global scalar parameters.

Definition at line 141 of file d2_config.h.

Constructor & Destructor Documentation

◆ D2Params() [1/2]

isc::d2::D2Params::D2Params ( const isc::asiolink::IOAddress ip_address,
const size_t  port,
const size_t  dns_server_timeout,
const dhcp_ddns::NameChangeProtocol ncr_protocol,
const dhcp_ddns::NameChangeFormat ncr_format 
)

Constructor.

Parameters
ip_addressIP address at which D2 should listen for NCRs
portport on which D2 should listen NCRs
dns_server_timeoutmaximum amount of time in milliseconds to wait for a response to a single DNS update request.
ncr_protocolsocket protocol D2 should use to receive NCRS
ncr_formatpacket format of the inbound NCRs
Exceptions
D2CfgErrorif:
  1. ip_address is 0.0.0.0 or ::
  2. port is 0
  3. dns_server_timeout is < 1
  4. ncr_protocol is invalid, currently only NCR_UDP is supported
  5. ncr_format is invalid, currently only FMT_JSON is supported

Definition at line 30 of file d2_config.cc.

References validateContents().

+ Here is the call graph for this function:

◆ D2Params() [2/2]

isc::d2::D2Params::D2Params ( )

Default constructor The default constructor creates an instance that has updates disabled.

Definition at line 43 of file d2_config.cc.

References validateContents().

+ Here is the call graph for this function:

◆ ~D2Params()

isc::d2::D2Params::~D2Params ( )
virtual

Destructor.

Definition at line 51 of file d2_config.cc.

Member Function Documentation

◆ getConfigSummary()

std::string isc::d2::D2Params::getConfigSummary ( ) const

Return summary of the configuration used by D2.

The returned summary of the configuration is meant to be appended to the log message informing about the successful completion of the D2 configuration.

Returns
Configuration summary in the textual format.

Definition at line 78 of file d2_config.cc.

References getIpAddress(), and getPort().

+ Here is the call graph for this function:

◆ getDnsServerTimeout()

size_t isc::d2::D2Params::getDnsServerTimeout ( ) const
inline

Return the DNS server timeout value.

Definition at line 182 of file d2_config.h.

◆ getIpAddress()

const isc::asiolink::IOAddress & isc::d2::D2Params::getIpAddress ( ) const
inline

Return the IP address D2 listens on.

Definition at line 172 of file d2_config.h.

Referenced by getConfigSummary().

◆ getNcrFormat()

const dhcp_ddns::NameChangeFormat & isc::d2::D2Params::getNcrFormat ( ) const
inline

Return the expected format of inbound requests (NCRs).

Definition at line 192 of file d2_config.h.

◆ getNcrProtocol()

const dhcp_ddns::NameChangeProtocol & isc::d2::D2Params::getNcrProtocol ( ) const
inline

Return the socket protocol in use.

Definition at line 187 of file d2_config.h.

◆ getPort()

size_t isc::d2::D2Params::getPort ( ) const
inline

Return the TCP/UPD port D2 listens on.

Definition at line 177 of file d2_config.h.

Referenced by getConfigSummary().

◆ operator!=()

bool isc::d2::D2Params::operator!= ( const D2Params other) const

Compares two D2Params's for inequality.

Definition at line 95 of file d2_config.cc.

◆ operator==()

bool isc::d2::D2Params::operator== ( const D2Params other) const

Compares two D2Params's for equality.

Definition at line 86 of file d2_config.cc.

◆ toText()

std::string isc::d2::D2Params::toText ( ) const

Generates a string representation of the class contents.

Definition at line 100 of file d2_config.cc.

References isc::dhcp_ddns::ncrFormatToString(), isc::dhcp_ddns::ncrProtocolToString(), and isc::asiolink::IOAddress::toText().

Referenced by isc::d2::operator<<().

+ Here is the call graph for this function:

◆ validateContents()

void isc::d2::D2Params::validateContents ( )
protectedvirtual

Validates member values.

Method is used by the constructor to validate member contents. Currently checks:

  1. ip_address is not 0.0.0.0 or ::
  2. port is not 0
  3. dns_server_timeout is 0
  4. ncr_protocol is UDP
  5. ncr_format is JSON
Exceptions
D2CfgErrorif contents are invalid

Definition at line 54 of file d2_config.cc.

References isc::dhcp_ddns::FMT_JSON, isc_throw, isc::dhcp_ddns::NCR_UDP, isc::dhcp_ddns::ncrFormatToString(), and isc::dhcp_ddns::ncrProtocolToString().

Referenced by D2Params().

+ Here is the call graph for this function:

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