Kea  1.9.9-git
isc::d2::D2Params Class Reference

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

#include <d2_config.h>

Public Member Functions

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

Protected Member Functions

virtual void validateContents ()
 Validates member values. More...
 

Detailed Description

Acts as a storage vault for D2 global scalar parameters.

Definition at line 142 of file d2_config.h.

Constructor & Destructor Documentation

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:

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:

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

Destructor.

Definition at line 51 of file d2_config.cc.

Member Function Documentation

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 83 of file d2_config.cc.

References getIpAddress(), getPort(), and isc::dhcp_ddns::ncrProtocolToString().

+ Here is the call graph for this function:

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

Return the DNS server timeout value.

Definition at line 183 of file d2_config.h.

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

Return the IP address D2 listens on.

Definition at line 173 of file d2_config.h.

Referenced by getConfigSummary().

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

Return the expected format of inbound requests (NCRs).

Definition at line 193 of file d2_config.h.

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

Return the socket protocol in use.

Definition at line 188 of file d2_config.h.

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

Return the TCP/UPD port D2 listens on.

Definition at line 178 of file d2_config.h.

Referenced by getConfigSummary().

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

Compares two D2Params's for inequality.

Definition at line 100 of file d2_config.cc.

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

Compares two D2Params's for equality.

Definition at line 91 of file d2_config.cc.

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

Generates a string representation of the class contents.

Definition at line 105 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:

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(), isc::dhcp_ddns::ncrProtocolToString(), and isc::asiolink::IOAddress::toText().

Referenced by D2Params().

+ Here is the call graph for this function:


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