Commit 80ef9a69 authored by Tomek Mrugalski's avatar Tomek Mrugalski

[3400] Merge remote-tracking branch 'origin/trac3449' into trac3400

Conflicts:
	ChangeLog
parents 21369c11 a1d6621e
......@@ -5,6 +5,18 @@
JSON, which reads configuration from a JSON file.
(Trac #3400, git TBD)
782. [func] tmark
Added sender-ip, sender-port, and max-queue-size parameters to
the dhcp-ddns configuration section of both b10-dhcp4 and b10-dhcp6.
(Trac #3328, git 8d8d0b5eedaab20bf1008dfb3a6913eb006a6e73)
781. [func] marcin
libkea-dhcpsrv: the Memfile lease storage backend returns leases
of a specified type. Previously, it ignored the lease type parameter
and returned all leases for a particular client. Thanks to David
Carlier for helping to implement this ticket.
(Trac #3148, git d2f0edf473716cd747a21d6917e89ba55c148d8e)
780. [func] marcin
libkea-cc: JSON parser stores information about the position
of the data element values in the JSON string. The position
......
......@@ -292,7 +292,7 @@ case "$host" in
;;
esac
m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3.3 python3.2 python3.1 python3])
m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3.4 python3.3 python3.2 python3.1 python3])
AC_ARG_WITH([pythonpath],
AC_HELP_STRING([--with-pythonpath=PATH],
[specify an absolute path to python executable when automatic version check (incorrectly) fails]),
......@@ -916,7 +916,7 @@ if test "$MYSQL_CONFIG" != "" ; then
fi
# Solaris puts FIONREAD in filio.h
AC_CHECK_HEADER(sys/filio.h)
AC_CHECK_HEADERS(sys/filio.h,,,)
# ... and at the shell level, so Makefile.am can take action depending on this.
AM_CONDITIONAL(HAVE_MYSQL, test "$MYSQL_CONFIG" != "")
......@@ -1495,6 +1495,7 @@ AC_CONFIG_FILES([compatcheck/Makefile
src/lib/dhcp_ddns/tests/Makefile
src/lib/dhcp/Makefile
src/lib/dhcpsrv/Makefile
src/lib/dhcpsrv/testutils/Makefile
src/lib/dhcpsrv/tests/Makefile
src/lib/dhcpsrv/tests/test_libraries.h
src/lib/dhcp/tests/Makefile
......
......@@ -324,22 +324,6 @@ INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
# determine which symbols to keep in memory and which to flush to disk.
# When the cache is full, less often used symbols will be written to disk.
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
# causing a significant performance penalty.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will roughly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols.
SYMBOL_CACHE_SIZE = 0
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
# their name and scope. Since this can be an expensive process and often the
......@@ -678,7 +662,6 @@ INPUT = ../src/bin/d2 \
../src/lib/hooks \
../src/lib/log \
../src/lib/log/compiler \
../src/lib/resolve \
../src/lib/testutils \
../src/lib/util \
../src/lib/util/io \
......@@ -1660,18 +1643,18 @@ DOT_NUM_THREADS = 0
# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
# directory containing the font.
DOT_FONTNAME = FreeSans
#DOT_FONTNAME = FreeSans
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
DOT_FONTSIZE = 10
#DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the Helvetica font.
# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
# set the path where dot can find it.
DOT_FONTPATH =
#DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
......
/**
* @page dhcpv4 DHCPv4 Server Component
*
* BIND10 offers DHCPv4 server implementation. It is implemented as
* b10-dhcp4 component. Its primary code is located in
* isc::dhcp::Dhcpv4Srv class. It uses \ref libdhcp extensively,
* especially isc::dhcp::Pkt4, isc::dhcp::Option and
* isc::dhcp::IfaceMgr classes. Currently this code offers skeleton
* functionality, i.e. it is able to receive and process incoming
* requests and trasmit responses. However, it does not have database
* management, so it returns only one, hardcoded lease to whoever asks
* for it.
*
* DHCPv4 server component does not support direct traffic (relayed
* only), as support for transmission to hosts without IPv4 address
* assigned is not implemented in IfaceMgr yet.
*
* DHCPv4 server component does not use BIND10 logging yet.
*
* @section dhcpv4Session BIND10 message queue integration
*
* DHCPv4 server component is now integrated with the BIND10 message queue.
* The integration is performed by establishSession() and disconnectSession()
* functions in isc::dhcp::ControlledDhcpv4Srv class. main() method defined
* in the src/bin/dhcp4/main.cc file instantiates isc::dhcp::ControlledDhcpv4Srv
* class that establishes connection with msgq and install necessary handlers
* for receiving commands and configuration updates. It is derived from
* a base isc::dhcp::Dhcpv4Srv class that implements DHCPv4 server functionality,
* without any controlling mechanisms.
*
* ControlledDhcpv4Srv instantiates several components to make management
* session possible. In particular, isc::cc::Session cc_session
* object uses ASIO for establishing connection. It registers its socket
* in isc::asiolink::IOService io_service object. Typically, other components
* (e.g. auth or resolver) that use ASIO for their communication, register their
* other sockets in the
* same io_service and then just call io_service.run() method that does
* not return, until one of the callback decides that it is time to shut down
* the whole component cal calls io_service.stop(). DHCPv4 works in a
* different way. It does receive messages using select()
* (see isc::dhcp::IfaceMgr::receive4()), which is incompatible with ASIO.
* To solve this problem, socket descriptor is extracted from cc_session
* object and is passed to IfaceMgr by using isc::dhcp::IfaceMgr::set_session_socket().
* IfaceMgr then uses this socket in its select() call. If there is some
* data to be read, it calls registered callback that is supposed to
* read and process incoming data.
*
* This somewhat complicated approach is needed for a simple reason. In
* embedded deployments there will be no message queue. Not referring directly
* to anything related to message queue in isc::dhcp::Dhcpv4Srv and
* isc::dhcp::IfaceMgr classes brings in two benefits. First, the can
* be used with and without message queue. Second benefit is related to the
* first one: \ref libdhcp is supposed to be simple and robust and not require
* many dependencies. One notable example of a use case that benefits from
* this approach is a perfdhcp tool. Finally, the idea is that it should be
* possible to instantiate Dhcpv4Srv object directly, thus getting a server
* that does not support msgq. That is useful for embedded environments.
* It may also be useful in validation.
*
*/
// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
/**
@page configBackend Kea Configuration Backends
@section configBackendIntro Introduction
Kea is a flexible DHCP protocol engine. It offers a selection of lease database
backends, extensibility via the hooks API and the definition of custom options.
Depending on the environment, one lease database backend may be better than
other. Similarly, because the best way of configuring the server can depend on
the environment, Kea provides different ways of obtaining configuration
information, through the Configuration Backend. Since the means by which
configuration information is received cannot be part of the configuration itself, it
has to be chosen at the compilation time (when configuring the sources).
This page explains the background to the Configuration Backend and how
it is implemented. It is aimed at people who want to develop and
maintain their own backends.
@section configBackendMotivation Motivation for Different Backends
BIND10 (the project under which the first stages of Keas were developed)
used to maintain an extensive framework that was responsible for the
configuration of components. After BIND10 was cancelled, two projects
were created: <a href="http://kea.isc.org">Kea</a> (focused on DHCP)
and <a href="http://www.bundy-dns.de">Bundy</a> (aimed at DNS). The
Kea team decided to remove the BIND10 framework, while the Bundy team
decided to keep it. However, even though the Kea team is focused on a
backend that reads a JSON configuration file from disk, it decided to
make it easy for others to use different backends.
While ISC currently (May 2014) plans to maintain only one configuration backend
(a JSON file read from disk), there may be other organizations (e.g.
the Bundy project community) that will maintain other backends. It is quite
possible that additional backends (e.g. using LDAP or XML) will be
developed and maintained by other organizations.
@section configBackendAdding How to Add a New Configuration Backend
@todo Will be covered in ticket #3400.
@section configBackendJSONDesign The JSON Configuration Backend
The following are some considerations that shaped the design of the configuration
backend framework.
-# A new parameter called --with-kea-config will be implemented in the
configure script. It will allow the selection at compilation time of how the
servers will be configured. For the next 2-3 months (until around June 2014),
there will be two values: JSON (read from file) and BIND10 (use the BIND10 framework).
Once the file based configuration is implemented and the Kea team is ready to switch
(i.e. enough confidence, Forge tests updated for new configuration
mechanism), the BIND10 backend will be removed from the Kea repository. Other projects
(e.g. Bundy) who want to maintain it, are advised to just revert the single
commit that will bring the BIND10 framework back to their repositories.<br/><br/>
This switchable backend concept is quite simple. There are just different
implementations of ControlledXSrv class, so it is a matter of compiling/linking
one file or another. Hence it is easy to remove the old backend (and for
Bundy to keep it if they desire so). It is also easy for other
organizations to add and maintain their own backends (e.g. LDAP).<br/><br/>
-# Each backend must use the common code
for configuration and command processing callbacks. They all assume that
JSON formatted parameters are sent and they are expected to return well
formatted JSON responses. The exact format of configuration and commands is
module specific.<br/><br/>
-# After Kea 0.9 is released, a form of secure socket will be implemented through
which commands can be sent. Whatever the design, it
will allow the sending of configurations and commands in JSON format and
the receiving of responses.<br/><br/>
Once that is done, Kea will have the same capability the BIND10
framework to send additional parameters. One obvious use case will be
to send a new configuration file name as the parameter for "reload".<br/><br/>
-# A command handler needs to be added for reading the configuration from a file. Its main
responsibility is to load the configuration and process it. The JSON backend
must call that handler when starting up the server.<br/><br/>
-# Extend the existing JSON parser. The current JSON parser in
@ref isc::data::Element::fromJSON() needs to be extended to allow optional preprocessing.
For now that capability will simply remove whole-line comments staring with the hash
character, but it is expected
to grow over time (in-line comments and file inclusions are the obvious
envisaged additions).<br/><br/>
-# Implement a common base class for the Kea4, Kea6, and D2 servers. Some operations will be
common for all three components: logger initialization, handling and, at some future point,
control socket. This calls for a small base class that @ref isc::dhcp::Dhcpv4Srv "Dhcpv4Srv",
@ref isc::dhcp::Dhcpv6Srv "Dhcpv6Srv" and the @ref isc::d2::D2Controller "D2Controller" classes can use.
It is expected that the base class
(@ref isc::dhcp::Daemon) will be a small one but will grow over time as the code is unified.<br/><br/>
-# A way is needed to initialize stand-alone logging (i.e. each
Kea component will initialize it on its own).<br/><br/>
-# The current format of the BIND10 configuration file, b10-config.db will be
retained as the configuration file format. This is slight change
from the BIND10 days, as then a subset of the configuration was received by
the daemon processes.<br/><br/>
To take a specific example, the following is how b10-config.db
looks today:<br/><br/>
@code
{
"Init": { ... }
"Dhcp4": {
"subnet4" { subnet definitions here },
"option-data" { option data here },
"interfaces": [ "eth0" ],
...
},
"Dhcp6": {
"subnet6" { subnet definitions here },
"option-data" { option data here },
"interfaces": [ "eth0" ],
...
},
"Logging": {
"Loggers": [{"name": *, "severity": "DEBUG" }]
}
}
@endcode
<br/>
The Kea components used to receive only relevant parts of it (e.g. Kea4
received config that contained content of the Dhcp4 element). Now they
will receive all of it. The modification in the code to handle this
is really minor: just iterate over the top level elements and pick the appropriate
tree (or get the element by name). Also, that approach makes the logging
initialization code very easy to share among Kea4, Kea6 and D2.<br/><br/>
-# The .spec files used in BIND 10 by the control program to validate commands
will be retained. They will be kept and maintained even though no use of
them is planned. At some future time syntax validation may be implemented,
although it is out of scope for Kea 0.9 (and probably
for 1.0 as it is pretty big task).<br/><br/>
-# Addition of a shell script to start/stop Kea4,Kea6 and D2. There will be a script that will
start, stop and reconfigure the daemons. Its only
job will be to pass the configuration file to each daemon and remember its PID file, so
that sending signals will be be possible (for configuration reload or shutdown). Optionally,
it could also print out a status based on PID, but that may be tricky to
implement in a portable way. The minimum set of commands will be:
-# Start the processes
- eventually based on configuration, initially start them all
- it could launch a nanny script which restarts them on a crash (past 0.9)
-# Prompt the processes to reload configuration
- for now it will be a matter of sending singal to the right process
- this could also decide if D2 should still be running or not, and react accordingly (post 0.9)
-# Stop the processes in an orderly fashion
-# Perhaps return status of each process
*/
......@@ -87,6 +87,10 @@
* - @subpage cfgmgr
* - @subpage allocengine
* - @subpage dhcpDatabaseBackends
* - @subpage configBackend
* - @subpage configBackendMotivation
* - @subpage configBackendJSONDesign
* - @subpage configBackendAdding
* - @subpage perfdhcpInternals
* - @subpage libdhcp_ddns
*
......@@ -95,6 +99,7 @@
* - @subpage logBasicIdeas
* - @subpage logDeveloperUse
* - @subpage logNotes
* - @subpage LoggingApi
* - @subpage SocketSessionUtility
* - <a href="./doxygen-error.log">Documentation warnings and errors</a>
*
......
This diff is collapsed.
......@@ -41,8 +41,12 @@ if test x$rpath != xno; then
ISC_RPATH_FLAG=-Wl,-R
],[ AC_MSG_RESULT(no)
AC_MSG_CHECKING([whether -R flag is available in linker])
CXXFLAGS="$CXXFLAGS_SAVED -R"
CCFLAGS="$CCFLAGS_SAVED -R"
# Apple clang 5.1 is now considers unknown parameters passed to linker (ld) as errors.
# However, the same unknown parameters passed to compiler (g++ ) are merely threated
# as warnings. To make sure that we pick those up, is to use -Werror.
CXXFLAGS="$CXXFLAGS_SAVED -R/usr/lib"
CCFLAGS="$CCFLAGS_SAVED -R/usr/lib"
AC_TRY_LINK([], [],
[ AC_MSG_RESULT([yes; note that -R is more sensitive about the position in option arguments])
ISC_RPATH_FLAG=-R
......
......@@ -201,30 +201,7 @@ TSIGKeyInfoParser::build(isc::data::ConstElementPtr key_config) {
parser->build(config_pair.second);
parser->commit();
}
}
isc::dhcp::ParserPtr
TSIGKeyInfoParser::createConfigParser(const std::string& config_id) {
DhcpConfigParser* parser = NULL;
// Based on the configuration id of the element, create the appropriate
// parser. Scalars are set to use the parser's local scalar storage.
if ((config_id == "name") ||
(config_id == "algorithm") ||
(config_id == "secret")) {
parser = new isc::dhcp::StringParser(config_id,
local_scalars_.getStringStorage());
} else {
isc_throw(NotImplemented,
"parser error: TSIGKeyInfo parameter not supported: "
<< config_id);
}
// Return the new parser instance.
return (isc::dhcp::ParserPtr(parser));
}
void
TSIGKeyInfoParser::commit() {
std::string name;
std::string algorithm;
std::string secret;
......@@ -266,6 +243,33 @@ TSIGKeyInfoParser::commit() {
(*keys_)[name]=key_info;
}
isc::dhcp::ParserPtr
TSIGKeyInfoParser::createConfigParser(const std::string& config_id) {
DhcpConfigParser* parser = NULL;
// Based on the configuration id of the element, create the appropriate
// parser. Scalars are set to use the parser's local scalar storage.
if ((config_id == "name") ||
(config_id == "algorithm") ||
(config_id == "secret")) {
parser = new isc::dhcp::StringParser(config_id,
local_scalars_.getStringStorage());
} else {
isc_throw(NotImplemented,
"parser error: TSIGKeyInfo parameter not supported: "
<< config_id);
}
// Return the new parser instance.
return (isc::dhcp::ParserPtr(parser));
}
void
TSIGKeyInfoParser::commit() {
/// @todo if at some point TSIG keys need some form of runtime resource
/// initialization, such as creating some sort of hash instance in
/// crytpolib. Once TSIG is fully implemented under Trac #3432 we'll know.
}
// *********************** TSIGKeyInfoListParser *************************
TSIGKeyInfoListParser::TSIGKeyInfoListParser(const std::string& list_name,
......@@ -278,12 +282,12 @@ TSIGKeyInfoListParser::TSIGKeyInfoListParser(const std::string& list_name,
}
}
TSIGKeyInfoListParser::~TSIGKeyInfoListParser(){
TSIGKeyInfoListParser::~TSIGKeyInfoListParser() {
}
void
TSIGKeyInfoListParser::
build(isc::data::ConstElementPtr key_list){
build(isc::data::ConstElementPtr key_list) {
int i = 0;
isc::data::ConstElementPtr key_config;
// For each key element in the key list:
......@@ -299,6 +303,10 @@ build(isc::data::ConstElementPtr key_list){
parser->build(key_config);
parsers_.push_back(parser);
}
// Now that we know we have a valid list, commit that list to the
// area given to us during construction (i.e. to the d2 context).
*keys_ = *local_keys_;
}
void
......@@ -308,10 +316,6 @@ TSIGKeyInfoListParser::commit() {
BOOST_FOREACH(isc::dhcp::ParserPtr parser, parsers_) {
parser->commit();
}
// Now that we know we have a valid list, commit that list to the
// area given to us during construction (i.e. to the d2 context).
*keys_ = *local_keys_;
}
// *********************** DnsServerInfoParser *************************
......@@ -343,32 +347,6 @@ DnsServerInfoParser::build(isc::data::ConstElementPtr server_config) {
parser->commit();
}
}
isc::dhcp::ParserPtr
DnsServerInfoParser::createConfigParser(const std::string& config_id) {
DhcpConfigParser* parser = NULL;
// Based on the configuration id of the element, create the appropriate
// parser. Scalars are set to use the parser's local scalar storage.
if ((config_id == "hostname") ||
(config_id == "ip_address")) {
parser = new isc::dhcp::StringParser(config_id,
local_scalars_.getStringStorage());
} else if (config_id == "port") {
parser = new isc::dhcp::Uint32Parser(config_id,
local_scalars_.getUint32Storage());
} else {
isc_throw(NotImplemented,
"parser error: DnsServerInfo parameter not supported: "
<< config_id);
}
// Return the new parser instance.
return (isc::dhcp::ParserPtr(parser));
}
void
DnsServerInfoParser::commit() {
std::string hostname;
std::string ip_address;
uint32_t port = DnsServerInfo::STANDARD_DNS_PORT;
......@@ -407,6 +385,32 @@ DnsServerInfoParser::commit() {
servers_->push_back(serverInfo);
}
isc::dhcp::ParserPtr
DnsServerInfoParser::createConfigParser(const std::string& config_id) {
DhcpConfigParser* parser = NULL;
// Based on the configuration id of the element, create the appropriate
// parser. Scalars are set to use the parser's local scalar storage.
if ((config_id == "hostname") ||
(config_id == "ip_address")) {
parser = new isc::dhcp::StringParser(config_id,
local_scalars_.getStringStorage());
} else if (config_id == "port") {
parser = new isc::dhcp::Uint32Parser(config_id,
local_scalars_.getUint32Storage());
} else {
isc_throw(NotImplemented,
"parser error: DnsServerInfo parameter not supported: "
<< config_id);
}
// Return the new parser instance.
return (isc::dhcp::ParserPtr(parser));
}
void
DnsServerInfoParser::commit() {
}
// *********************** DnsServerInfoListParser *************************
DnsServerInfoListParser::DnsServerInfoListParser(const std::string& list_name,
......@@ -439,17 +443,16 @@ build(isc::data::ConstElementPtr server_list){
parser->build(server_config);
parsers_.push_back(parser);
}
}
void
DnsServerInfoListParser::commit() {
// Domains must have at least one server.
if (parsers_.size() == 0) {
isc_throw (D2CfgError, "Server List must contain at least one server");
}
}
// Invoke commit on each server parser. This will cause each one to
// create it's server instance and commit it to storage.
void
DnsServerInfoListParser::commit() {
// Invoke commit on each server parser.
BOOST_FOREACH(isc::dhcp::ParserPtr parser, parsers_) {
parser->commit();
}
......@@ -486,34 +489,8 @@ DdnsDomainParser::build(isc::data::ConstElementPtr domain_config) {
parser->build(config_pair.second);
parser->commit();
}
}
isc::dhcp::ParserPtr
DdnsDomainParser::createConfigParser(const std::string& config_id) {
DhcpConfigParser* parser = NULL;
// Based on the configuration id of the element, create the appropriate
// parser. Scalars are set to use the parser's local scalar storage.
if ((config_id == "name") ||
(config_id == "key_name")) {
parser = new isc::dhcp::StringParser(config_id,
local_scalars_.getStringStorage());
} else if (config_id == "dns_servers") {
// Server list parser is given in our local server storage. It will pass
// this down to its server parsers and is where they will write their
// server instances upon commit.
parser = new DnsServerInfoListParser(config_id, local_servers_);
} else {
isc_throw(NotImplemented,
"parser error: DdnsDomain parameter not supported: "
<< config_id);
}
// Return the new domain parser instance.
return (isc::dhcp::ParserPtr(parser));
}
void
DdnsDomainParser::commit() {
// Now construct the domain.
std::string name;
std::string key_name;
......@@ -547,7 +524,35 @@ DdnsDomainParser::commit() {
DdnsDomainPtr domain(new DdnsDomain(name, key_name, local_servers_));
// Add the new domain to the domain storage.
(*domains_)[name]=domain;
(*domains_)[name] = domain;
}
isc::dhcp::ParserPtr
DdnsDomainParser::createConfigParser(const std::string& config_id) {
DhcpConfigParser* parser = NULL;
// Based on the configuration id of the element, create the appropriate
// parser. Scalars are set to use the parser's local scalar storage.
if ((config_id == "name") ||
(config_id == "key_name")) {
parser = new isc::dhcp::StringParser(config_id,
local_scalars_.getStringStorage());
} else if (config_id == "dns_servers") {
// Server list parser is given in our local server storage. It will pass
// this down to its server parsers and is where they will write their
// server instances upon commit.
parser = new DnsServerInfoListParser(config_id, local_servers_);
} else {
isc_throw(NotImplemented,
"parser error: DdnsDomain parameter not supported: "
<< config_id);
}
// Return the new domain parser instance.
return (isc::dhcp::ParserPtr(parser));
}
void
DdnsDomainParser::commit() {
}
// *********************** DdnsDomainListParser *************************
......@@ -620,6 +625,9 @@ DdnsDomainListMgrParser::build(isc::data::ConstElementPtr domain_config) {
parser->build(config_pair.second);
parser->commit();
}
// Add the new domain to the domain storage.
mgr_->setDomains(local_domains_);
}
isc::dhcp::ParserPtr
......@@ -641,8 +649,6 @@ DdnsDomainListMgrParser::createConfigParser(const std::string& config_id) {
void
DdnsDomainListMgrParser::commit() {
// Add the new domain to the domain storage.
mgr_->setDomains(local_domains_);
}
......
......@@ -68,7 +68,7 @@ namespace d2 {
/// any scalars which belong to the manager as well as creating and invoking a
/// DdnsDomainListParser to parse its list of domain entries.
///
/// A DdnsDomainLiatParser creates and invokes DdnsDomainListParser for each
/// A DdnsDomainListParser creates and invokes DdnsDomainListParser for each
/// domain entry in its list.
///
/// A DdnsDomainParser handles the scalars which belong to the domain as well as
......@@ -191,7 +191,7 @@ public:
private:
/// @brief The name of the key.
///
/// This value is the unique identifeir thay domains use to
/// This value is the unique identifier that domains use to
/// to specify which TSIG key they need.
std::string name_;
......@@ -540,8 +540,9 @@ public:
/// @brief Performs the actual parsing of the given "tsig_key" element.
///
/// The results of the parsing are retained internally for use during
/// commit.
/// Parses a configuration for the elements needed to instantiate a
/// TSIGKeyInfo, validates those entries, creates a TSIGKeyInfo instance
/// then attempts to add to a list of keys
///
/// @param key_config is the "tsig_key" configuration to parse
virtual void build(isc::data::ConstElementPtr key_config);
......@@ -559,9 +560,9 @@ public:
/// @return returns a pointer to newly created parser.
virtual isc::dhcp::ParserPtr createConfigParser(const std::string&
config_id);
/// @brief Instantiates a DnsServerInfo from internal data values
/// saves it to the storage area pointed to by servers_.
/// @brief Commits the TSIGKeyInfo configuration
/// Currently this method is a NOP, as the key instance is created and
/// then added to a local list of keys in build().
virtual void commit();
private:
......@@ -611,14 +612,11 @@ public:
/// @param key_list_config is the list of "tsig_key" elements to parse.
virtual void build(isc::data::ConstElementPtr key_list_config);
/// @brief Iterates over the internal list of TSIGKeyInfoParsers,
/// invoking commit on each. This causes each parser to instantiate a
/// TSIGKeyInfo from its internal data values and add that key
/// instance to the local key storage area, local_keys_. If all of the
/// key parsers commit cleanly, then update the context key map (keys_)
/// with the contents of local_keys_. This is done to allow for duplicate
/// key detection while parsing the keys, but not get stumped by it
/// updating the context with a valid list.
/// @brief Commits the list of TSIG keys
///
/// Iterates over the internal list of TSIGKeyInfoParsers, invoking
/// commit on each one. Then commits the local list of keys to
/// storage.
virtual void commit();
private:
......@@ -629,7 +627,7 @@ private:
/// the list of newly created TSIGKeyInfo instances. This is given to us