}
}
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
class ControlSocketError : public isc::Exception {
public:
ControlSocketError(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) { };
-};
+ isc::Exception(file, line, what) { }
+}; // ControlSocketError
/// @brief Base class for control socket communication.
///
/// communicate with other Kea daemons.
class ControlSocketBase {
public:
-
/// @brief Constructor.
///
/// @param ctrl_sock The control socket configuration.
}
/// @brief Destructor (does nothing).
- virtual ~ControlSocketBase() {
- }
+ virtual ~ControlSocketBase() = default;
/// @brief Getter which returns the socket type.
///
/// @brief The control socket configuration.
CfgControlSocketPtr socket_cfg_;
-};
+}; // ControlSocketBase
/// @brief Type definition for the pointer to the @c ControlSocketBase.
typedef boost::shared_ptr<ControlSocketBase> ControlSocketBasePtr;
ControlSocketBasePtr
controlSocketFactory(CfgControlSocketPtr ctrl_sock);
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // CONTROL_SOCKET_H
}
}
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
/// This class implements config-get, config-test and config-set.
class HttpControlSocket : public ControlSocketBase {
public:
-
/// @brief Constructor.
///
/// @param ctrl_sock The control socket configuration.
/// @param command The command to send.
/// @return The answer.
data::ConstElementPtr sendCommand(data::ConstElementPtr command);
-};
+}; // HttpControlSocket
/// @brief Type definition for the pointer to the @c HttpControlSocket.
typedef boost::shared_ptr<HttpControlSocket> HttpControlSocketPtr;
template <> ControlSocketBasePtr
createControlSocket<CfgControlSocket::Type::HTTP>(CfgControlSocketPtr ctrl_sock);
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // HTTP_CONTROL_SOCKET_H
}
#line 14 "netconf_parser.yy"
-} } // isc::netconf
+} } // isc::netconf
#line 305 "location.hh"
#endif // !YY_NETCONF_LOCATION_HH_INCLUDED
.arg(service_pair_.first)
.arg(tree);
}
-};
+}; // NetconfAgentCallback
-} // end of anonymous namespace
+} //anonymous namespace
namespace isc {
namespace netconf {
->shouldShutdown();
}
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
/// @brief Subscription map.
std::map<const std::string, sysrepo::Subscription> subscriptions_;
-};
+}; // NetconfAgent
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // NETCONF_H
return list;
}
-} // namespace isc::netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
/// @brief Configured hooks libraries.
isc::hooks::HooksConfig hooks_config_;
-};
+}; // NetconfConfig
/// @brief Ctrl Netconf Configuration Manager.
///
/// configuration.
class NetconfCfgMgr : public process::DCfgMgrBase {
public:
-
/// @brief Constructor.
NetconfCfgMgr();
///
/// @return Returns a ConfigPtr to the new context instance.
virtual process::ConfigPtr createNewContext();
-};
+}; // NetconfCfgMgr
/// @brief Defines a shared pointer to NetconfCfgMgr.
typedef boost::shared_ptr<NetconfCfgMgr> NetconfCfgMgrPtr;
-} // namespace isc::netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // NETCONF_CFG_MGR_H
UNIX, //< Unix socket.
HTTP, //< HTTP socket.
STDOUT //< standard output.
- };
+ }; // Type
/// @brief Constructor.
///
/// @brief The HTTP server URL.
const isc::http::Url url_;
-};
+}; // CfgControlSocket
/// @brief Defines a pointer for CfgControlSocket instances.
typedef boost::shared_ptr<CfgControlSocket> CfgControlSocketPtr;
/// @brief The control socket.
CfgControlSocketPtr control_socket_;
-};
+}; // CfgServer
/// @brief Defines a pointer for CfgServer instances.
typedef boost::shared_ptr<CfgServer> CfgServerPtr;
///
/// @return pointer to the new CfgControlSocket instance.
CfgControlSocketPtr parse(data::ConstElementPtr ctrl_sock_config);
-};
+}; // ControlSocketConfigParser
/// @brief Parser for CfgServer.
///
/// @param server_config is the value from the "managed-servers" map to parse.
/// @return pointer to the new CfgServer instance.
CfgServerPtr parse(data::ConstElementPtr server_config);
-};
+}; // ServerConfigParser
} // namespace netconf
} // namespace isc
// Refer to config_report so it will be embedded in the binary.
const char* const* netconf_config_report = isc::detail::config_report;
-} // namespace isc::netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
/// @brief Constructor is declared private to maintain the integrity of
/// the singleton instance.
NetconfController();
-};
+}; // NetconfController
// @Defines a shared pointer to NetconfController
typedef boost::shared_ptr<NetconfController> NetconfControllerPtr;
-} // namespace isc::netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // NETCONF_CONTROLLER_H
isc::log::Logger netconf_logger(NETCONF_LOGGER_NAME);
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
/// @brief Base logger for the netconf agent
extern isc::log::Logger netconf_logger;
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // NETCONF_LOG_H
extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_REJECTED = "NETCONF_VALIDATE_CONFIG_REJECTED";
extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_STARTED = "NETCONF_VALIDATE_CONFIG_STARTED";
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
namespace {
const isc::log::MessageInitializer initializer(values);
-} // Anonymous namespace
+} // Anonymous namespace
extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_REJECTED;
extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_STARTED;
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // NETCONF_MESSAGES_H
#line 14 "netconf_parser.yy"
-} } // isc::netconf
+} } // isc::netconf
#line 2303 "netconf_parser.cc"
#line 748 "netconf_parser.yy"
#line 14 "netconf_parser.yy"
-} } // isc::netconf
+} } // isc::netconf
#line 2383 "netconf_parser.h"
return (boost::dynamic_pointer_cast<NetconfCfgMgr>(getCfgMgr()));
}
-} // namespace isc::netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
/// @brief Netconf agent.
NetconfAgent agent_;
-};
+}; // NetconfProcess
/// @brief Defines a shared pointer to NetconfProcess.
typedef boost::shared_ptr<NetconfProcess> NetconfProcessPtr;
-}; // namespace isc::netconf
-}; // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // NETCONF_PROCESS_H
///
/// @return Element structure representing parsed text.
isc::data::ElementPtr parseCommon();
-};
+}; // ParserContext
-} // end of isc::netconf namespace
-} // end of isc namespace
+} // namespace netconf
+} // namespace isc
#endif
class ParserContext;
-}; // end of isc::dhcp namespace
-}; // end of isc namespace
+} // namespace dhcp
+} // namespace isc
#endif
static const isc::data::SimpleDefaults D2_DEFAULTS;
static const isc::data::SimpleDefaults CA_DEFAULTS;
static const isc::data::ParamsList INHERIT_TO_SERVERS;
-};
+}; // NetconfSimpleParser
-};
-};
+} // namespace netconf
+} // namespace isc
#endif
return (createAnswer());
}
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
/// This class implements config-test (always OK) and config-set.
class StdoutControlSocket : public ControlSocketBase {
public:
-
/// @brief Constructor.
///
/// Use std::cout.
/// @brief The output stream (std::cout outside tests).
std::ostream& output_;
-};
+}; // StdoutControlSocket
/// @brief Type definition for the pointer to the @c StdoutControlSocket.
typedef boost::shared_ptr<StdoutControlSocket> StdoutControlSocketPtr;
template <> ControlSocketBasePtr
createControlSocket<CfgControlSocket::Type::STDOUT>(CfgControlSocketPtr ctrl_sock);
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // STDOUT_CONTROL_SOCKET_H
TestStdoutControlSocket(CfgControlSocketPtr ctrl_sock, ostream& output)
: StdoutControlSocket(ctrl_sock, output) {
}
-
- /// @brief Destructor.
- virtual ~TestStdoutControlSocket() {
- }
-};
+}; // TestStdoutControlSocket
/// @brief Type definition for the pointer to the @c TestStdoutControlSocket.
typedef boost::shared_ptr<TestStdoutControlSocket> TestStdoutControlSocketPtr;
/// @brief IOService object.
IOService io_service_;
-};
+}; // UnixControlSocketTest
/// @brief Server method running in a thread reflecting the command.
///
response->finalize();
return (response);
}
-};
+}; // TestHttpResponseCreator
/// @brief Implementation of the test HttpResponseCreatorFactory.
class TestHttpResponseCreatorFactory : public HttpResponseCreatorFactory {
HttpResponseCreatorPtr response_creator(new TestHttpResponseCreator());
return (response_creator);
}
-};
+}; // TestHttpResponseCreatorFactory
/// @brief Test fixture class for http control sockets.
class HttpControlSocketTest : public ThreadedTest {
/// @brief Pointer to listener.
HttpListenerPtr listener_;
-};
+}; // HttpControlSocketTest
/// @brief Create the reflecting listener.
void
class NakedNetconfCfgMgr : public NetconfCfgMgr {
public:
using NetconfCfgMgr::parse;
-};
+}; // NakedNetconfCfgMgr
} // namespace
boost::scoped_ptr<NakedNetconfCfgMgr> srv_; ///< Netconf server under test
int rcode_; ///< Return code from element parsing
ConstElementPtr comment_; ///< Reason for parse fail
-};
+}; // NetconfGetCfgTest
// Test a simple configuration.
TEST_F(NetconfGetCfgTest, simple) {
class NakedNetconfCfgMgr : public NetconfCfgMgr {
public:
using NetconfCfgMgr::parse;
-};
+}; // NakedNetconfCfgMgr
// Tests construction of NetconfCfgMgr class.
TEST(NetconfCfgMgr, construction) {
" }\n"
" }\n"
"}"
-};
+}; // NETCONF_CONFIGS
// Tests the handling of bad socket type. Can't use the fixture class
// because the Netconf parser does not allow bad socket types.
/// Configuration Manager (used in tests)
NakedNetconfCfgMgr cfg_mgr_;
-};
+}; // NetconfParserTest
// This test verifies if an empty config is handled properly. In practice such
// a config makes little sense, but perhaps it's ok for a default deployment.
/// has extensive set of unit tests that are independent from Netconf.
class NetconfControllerTest : public DControllerTest {
public:
-
/// @brief Constructor.
NetconfControllerTest()
: DControllerTest(NetconfController::instance) {
}
return (p);
}
-};
+}; // NetconfControllerTest
// Basic Controller instantiation testing.
// Verifies that the controller singleton gets created and that the
NetconfConfigPtr ctx = getNetconfCfgMgr()->getNetconfConfig();
}
- /// @brief Destructor
- virtual ~NetconfProcessTest() {
- }
-
/// @brief Callback that will invoke shutdown method.
void genShutdownCallback() {
shutdown(isc::data::ConstElementPtr());
}
-};
+}; // NetconfProcessTest
// Test construction of the NetconfProcess object.
TEST(NetconfProcess, construction) {
/// @brief Test version of the NetconfAgent class.
class NakedNetconfAgent : public NetconfAgent {
public:
- /// @brief Constructor.
- NakedNetconfAgent() {
- }
-
- /// @brief Destructor.
- virtual ~NakedNetconfAgent() {
- }
-
/// Export protected methods and fields.
using NetconfAgent::keaConfig;
using NetconfAgent::initSysrepo;
using NetconfAgent::running_sess_;
using NetconfAgent::modules_;
using NetconfAgent::subscriptions_;
-};
+}; // NakedNetconfAgent
/// @brief Type definition for the pointer to NakedNetconfAgent objects.
typedef boost::shared_ptr<NakedNetconfAgent> NakedNetconfAgentPtr;
/// @brief Response list.
vector<string> responses_;
-};
+}; // NetconfAgentTest
/// @brief Special test fixture for logging tests.
class NetconfAgentLogTest : public dhcp::test::LogContentTest {
/// @brief Test netconf agent.
NakedNetconfAgentPtr agent_;
-};
+}; // NetconfAgentLogTest
/// @brief Fake server (returns OK answer).
void
log += "A piece of configuration may have been omitted.";
addString(log);
}
-};
+}; // TrailingCommasTest
// Test that trailing commas are allowed.
TEST_F(TrailingCommasTest, tests) {
// Basic library with context_create and three "standard" callouts.
static const char* BASIC_CALLOUT_LIBRARY = "@abs_builddir@/.libs/libbasic.so";
-} // anonymous namespace
+} // anonymous namespace
#endif // TEST_LIBRARIES_H
}
}
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
/// This class implements config-get, config-test and config-set.
class UnixControlSocket : public ControlSocketBase {
public:
-
/// @brief Constructor.
///
/// @param ctrl_sock The control socket configuration.
/// @param command The command to send.
/// @return The answer.
data::ConstElementPtr sendCommand(data::ConstElementPtr command);
-};
+}; // UnixControlSocket
/// @brief Type definition for the pointer to the @c UnixControlSocket.
typedef boost::shared_ptr<UnixControlSocket> UnixControlSocketPtr;
template <> ControlSocketBasePtr
createControlSocket<CfgControlSocket::Type::UNIX>(CfgControlSocketPtr ctrl_sock);
-} // namespace netconf
-} // namespace isc
+} // namespace netconf
+} // namespace isc
#endif // UNIX_CONTROL_SOCKET_H
namespace isc {
namespace yang {
-Adaptor::Adaptor() {
-}
-
-Adaptor::~Adaptor() {
-}
-
ConstElementPtr
Adaptor::getContext(ConstElementPtr parent)
{
}
}
-} // end of anonymous namespace
+} //anonymous namespace
/// Apply recursively starting at the beginning of the path.
void
applyDown(path, actions, config, 0);
}
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
MissingKey(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what)
{}
-};
+}; // MissingKey
/// @brief JSON adaptor between canonical Kea and YANG models.
///
/// The basic adaptor provides a set of tools.
class Adaptor {
public:
-
- /// @brief Constructor.
- Adaptor();
-
/// @brief Destructor.
- virtual ~Adaptor();
+ virtual ~Adaptor() = default;
/// @brief Get user context.
///
isc::data::ConstElementPtr actions,
isc::data::ElementPtr config);
-};
+}; // Adaptor
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
#endif // ISC_ADAPTOR_H
namespace isc {
namespace yang {
-AdaptorConfig::AdaptorConfig() {
-}
-
-AdaptorConfig::~AdaptorConfig() {
-}
-
bool
AdaptorConfig::subnetsCollectID(ConstElementPtr subnets, SubnetIDSet& set) {
bool have_ids = true;
preProcess(mutable_dhcp, "subnet6", DHCP6_SPACE);
}
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
class AdaptorConfig : public AdaptorHost, public AdaptorOption,
public AdaptorSubnet {
public:
-
- /// @brief Constructor.
- AdaptorConfig();
-
- /// @brief Destructor.
- virtual ~AdaptorConfig();
-
/// @brief Pre process a DHCPv4 configuration.
///
/// Assign subnet IDs, check and set defaults in options, etc.
static void preProcess(isc::data::ElementPtr dhcp,
const std::string& subsel,
const std::string& space);
-};
+}; // AdaptorConfig
-} // end of namespace isc::yang
-} // end of namespace isc
+} //namespace yang
+} // namespace isc
#endif // ISC_ADAPTOR_CONFIG_H
AdaptorHost::STD_CHARACTERS =
"0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-.@_";
-AdaptorHost::AdaptorHost() {
-}
-
-AdaptorHost::~AdaptorHost() {
-}
-
void
AdaptorHost::quoteIdentifier(ElementPtr host) {
ConstElementPtr flex_id = host->get("flex-id");
host->set("flex-id", Element::create(tmp.str()));
}
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
/// characters (digit, letters, -, ., @, _).
static const std::string STD_CHARACTERS;
- /// @brief Constructor.
- AdaptorHost();
-
/// @brief Destructor.
- virtual ~AdaptorHost();
+ virtual ~AdaptorHost() = default;
/// @brief Quote when needed a host identifier.
///
///
/// @param host The host.
static void quoteIdentifier(isc::data::ElementPtr host);
-};
+}; // AdaptorHost
-} // end of namespace isc::yang
-} // end of namespace isc
+} //namespace yang
+} // namespace isc
#endif // ISC_ADAPTOR_HOST_H
namespace isc {
namespace yang {
-AdaptorOption::AdaptorOption() {
-}
-
-AdaptorOption::~AdaptorOption() {
-}
-
void
AdaptorOption::setSpace(ElementPtr option, const string& space) {
if (!option->contains("space")) {
}
}
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
#ifndef ISC_ADAPTOR_OPTION_H
#define ISC_ADAPTOR_OPTION_H 1
+#include <dhcp/option_data_types.h>
#include <yang/adaptor.h>
-#include <map>
+
#include <list>
+#include <map>
namespace isc {
-
-namespace dhcp {
-/// @brief Forward declaration of option definition parameters.
-struct OptionDefParams;
-};
-
namespace yang {
/// @brief Map for DHCP option definitions handling code and
/// and raises an error when it can't.
class AdaptorOption {
public:
-
- /// @brief Constructor.
- AdaptorOption();
-
/// @brief Destructor.
- virtual ~AdaptorOption();
+ virtual ~AdaptorOption() = default;
/// @brief Set space.
///
static void initCodesInternal(OptionCodes& codes, const std::string& space,
const isc::dhcp::OptionDefParams* params,
size_t params_size);
-};
+}; // AdaptorOption
-} // end of namespace isc::yang
-} // end of namespace isc
+} //namespace yang
+} // namespace isc
#endif // ISC_ADAPTOR_OPTION_H
namespace isc {
namespace yang {
-AdaptorPool::AdaptorPool() {
-}
-
-AdaptorPool::~AdaptorPool() {
-}
-
void
AdaptorPool::canonizePool(ElementPtr pool) {
const string& orig = pool->get("pool")->stringValue();
Adaptor::toParent("rebind-timer", subnet, pools);
}
-} // end of namespace isc::yang
-} // end of namespace isc
+} //namespace yang
+} // namespace isc
/// removes timers from pools as they are not expected by Kea at this scope.
class AdaptorPool {
public:
-
- /// @brief Constructor.
- AdaptorPool();
-
/// @brief Destructor.
- virtual ~AdaptorPool();
+ virtual ~AdaptorPool() = default;
/// @brief Canonize pool.
///
/// @param pools The children pools.
static void toSubnetIetf6(isc::data::ElementPtr subnet,
isc::data::ConstElementPtr pools);
-};
+}; // AdaptorPool
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
#endif // ISC_ADAPTOR_POOL_H
namespace isc {
namespace yang {
-AdaptorSubnet::AdaptorSubnet() {
-}
-
-AdaptorSubnet::~AdaptorSubnet() {
-}
-
bool
AdaptorSubnet::collectID(ConstElementPtr subnet, SubnetIDSet& set) {
ConstElementPtr id = subnet->get("id");
}
}
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
/// code should work without it.
class AdaptorSubnet {
public:
-
- /// @brief Constructor.
- AdaptorSubnet();
-
/// @brief Destructor.
- virtual ~AdaptorSubnet();
+ virtual ~AdaptorSubnet() = default;
/// @brief Collect a subnet ID.
///
///
/// @param subnet The subnet.
static void updateRelay(isc::data::ElementPtr subnet);
-};
+}; // AdaptorSubnet
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
#endif // ISC_ADAPTOR_SUBNET_H
NetconfError(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what)
{}
-};
+}; // NetconfError
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
#endif // ISC_SYSREPO_ERROR_H
result = json;
}
-};
+}; // AdaptorConfigTest
TEST_F(AdaptorConfigTest, loadExamples4) {
vector<string> configs = {
/// @todo: Check option data using kea6/with-ddns.json
/// @todo: Check option defs using kea6/dhcpv4-over-dhcpv6.json
-}; // end of anonymous namespace
+} // anonymous namespace
class TestAdaptorOption : public AdaptorOption {
public:
using AdaptorOption::initCodesInternal;
-};
+}; // TestAdaptorOption
// Verifies that initCodesInternal works as expected.
TEST(AdaptorOptionTest, initCodesInternal) {
EXPECT_EQ(ISC_V6_4O6_INTERFACE, codes["vendor-2495@4o6-interface"]);
}
-} // end of anonymous namespace
+} //anonymous namespace
"\"rebind-timer\": 20 } ]");
}
-}; // end of anonymous namespace
+} // anonymous namespace
// It does not make sense to have both ip-address and ip-addresses...
-}; // end of anonymous namespace
+} // anonymous namespace
EXPECT_TRUE(expected->equals(*json));
}
-}; // end of anonymous namespace
+} // anonymous namespace
Session session_;
std::unique_ptr<TranslatorBasic> translator_;
-};
+}; // ConfigTest
struct ConfigTestKeaV4 : ConfigTest {
ConfigTestKeaV4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // ConfigTestKeav4
struct ConfigTestKeaV6 : ConfigTest {
ConfigTestKeaV6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // ConfigTestKeaV6
struct ConfigTestIetfV6 : ConfigTest {
ConfigTestIetfV6() {
model_ = IETF_DHCPV6_SERVER;
}
-};
+}; // ConfigTestIetfV6
// Check empty config with ietf-dhcpv6-server model.
TEST_F(ConfigTestIetfV6, emptyIetf6) {
<< std::endl;
}
}
-};
+}; // SysrepoSetup
/// @brief Test Fixture template for translator tests.
///
/// @brief Shared pointer to the transaction object.
boost::shared_ptr<translator_t> t_obj_;
std::string model_;
-};
+}; // GenericTranslatorTest
-} // namespace test
-} // namespace yang
-} // namespace isc
+} // namespace test
+} // namespace yang
+} // namespace isc
#endif // SYSREPO_SETUP_H
class TranslatorClassesTestv4 :
public GenericTranslatorTest<client_classes, TranslatorClasses> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorClassesTestv4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // TranslatorClassesTestv4
+
class TranslatorClassesTestv6 :
public GenericTranslatorTest<client_classes, TranslatorClasses> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorClassesTestv6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorClassesTestv6
// This test verifies that an empty client class list can be properly
// translated from YANG to JSON.
class TranslatorControlSocketTestv4 :
public GenericTranslatorTest<control_socket, TranslatorControlSocket> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorControlSocketTestv4() {
model_ = KEA_DHCP4_SERVER;
}
virtual ~TranslatorControlSocketTestv4() = default;
-};
+}; // TranslatorControlSocketTestv4
+
class TranslatorControlSocketTestv6 :
public GenericTranslatorTest<control_socket, TranslatorControlSocket> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorControlSocketTestv6() {
model_ = KEA_DHCP6_SERVER;
}
virtual ~TranslatorControlSocketTestv6() = default;
-};
+}; // TranslatorControlSocketTestv6
+
class TranslatorControlSocketTestCtrlAgent :
public GenericTranslatorTest<control_socket, TranslatorControlSocket> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorControlSocketTestCtrlAgent() {
model_ = KEA_CTRL_AGENT;
}
virtual ~TranslatorControlSocketTestCtrlAgent() = default;
-};
+}; // TranslatorControlSocketTestCtrlAgent
// This test verifies that an empty control socket can be properly
// translated from YANG to JSON.
}
virtual ~TranslatorDatabaseTestv4() = default;
-};
+}; // TranslatorDatabaseTestv4
class TranslatorDatabaseTestv6 :
public GenericTranslatorTest<database_access, TranslatorDatabase> {
}
virtual ~TranslatorDatabaseTestv6() = default;
-};
+}; // TranslatorDatabaseTestv6
// This test verifies that an empty database can be properly
// translated from YANG to JSON.
class TranslatorDatabasesTestv4 :
public GenericTranslatorTest<database_accesses, TranslatorDatabases> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorDatabasesTestv4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // TranslatorDatabasesTestv4
class TranslatorDatabasesTestv6 :
public GenericTranslatorTest<database_accesses, TranslatorDatabases> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorDatabasesTestv6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorDatabasesTestv6
// This test verifies that an empty database list can be properly
// translated from YANG to JSON.
class TranslatorHostsTestv4 :
public GenericTranslatorTest<host_reservations, TranslatorHosts> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorHostsTestv4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // TranslatorHostsTestv4
class TranslatorHostsTestv6 :
public GenericTranslatorTest<host_reservations, TranslatorHosts> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorHostsTestv6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorHostsTestv6
// This test verifies that an empty host reservation list can be properly
// translated from YANG to JSON.
"\"ip-addresses\": [ \"2001:db8::2\" ] } ]");
}
-}; // end of anonymous namespace
+} // anonymous namespace
class TranslatorLoggersTestv4 :
public GenericTranslatorTest<logger_list, TranslatorLoggers> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorLoggersTestv4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // TranslatorLoggersTestv4
+
class TranslatorLoggersTestv6 :
public GenericTranslatorTest<logger_list, TranslatorLoggers> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorLoggersTestv6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorLoggersTestv6
// This test verifies that an empty logger list can be properly
// translated from YANG to JSON.
class TranslatorOptionDataListTestv4 :
public GenericTranslatorTest<option_data_list, TranslatorOptionDataList> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorOptionDataListTestv4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // TranslatorOptionDataListTestv4
class TranslatorOptionDataListTestv6 :
public GenericTranslatorTest<option_data_list, TranslatorOptionDataList> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorOptionDataListTestv6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorOptionDataListTestv6
// This test verifies that an empty option data list can be properly
// translated from YANG to JSON.
class TranslatorOptionDefListTestKeaV4 :
public GenericTranslatorTest<option_definition_list, TranslatorOptionDefList> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorOptionDefListTestKeaV4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // TranslatorOptionDefListTestKeaV4
class TranslatorOptionDefListTestKeaV6 :
public GenericTranslatorTest<option_definition_list, TranslatorOptionDefList> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorOptionDefListTestKeaV6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorOptionDefListTestKeaV6
class TranslatorOptionDefListTestIetfV6 :
public GenericTranslatorTest<option_definition_list, TranslatorOptionDefList> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorOptionDefListTestIetfV6() {
model_ = IETF_DHCPV6_SERVER;
}
-};
+}; // TranslatorOptionDefListTestIetfV6
// This test verifies that an empty option definition list can be properly
// translated from YANG to JSON.
EXPECT_TRUE(def->equals(*got->get(0)));
}
-}; // end of anonymous namespace
+} // anonymous namespace
class TranslatorPdPoolsTestKeaV6 :
public GenericTranslatorTest<pd_pool_list, TranslatorPdPools> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorPdPoolsTestKeaV6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorPdPoolsTestKeaV6
class TranslatorPdPoolsTestIetfV6 :
public GenericTranslatorTest<pd_pool_list, TranslatorPdPools> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorPdPoolsTestIetfV6() {
model_ = IETF_DHCPV6_SERVER;
}
-};
+}; // TranslatorPdPoolsTestIetfV6
// This test verifies that an empty pd pool list can be properly
// translated from YANG to JSON using the IETF model.
class TranslatorPoolsTestKeaV4 :
public GenericTranslatorTest<pool_list, TranslatorPools> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorPoolsTestKeaV4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // TranslatorPoolsTestKeaV4
class TranslatorPoolsTestKeaV6 :
public GenericTranslatorTest<pool_list, TranslatorPools> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorPoolsTestKeaV6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorPoolsTestKeaV6
class TranslatorPoolsTestIetfV6 :
public GenericTranslatorTest<pool_list, TranslatorPools> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorPoolsTestIetfV6() {
model_ = IETF_DHCPV6_SERVER;
}
-};
+}; // TranslatorPoolsTestIetfV6
// This test verifies that an empty pool list can be properly
// translated from YANG to JSON using IETF model.
class TranslatorSharedNetworksTestKeaV4 :
public GenericTranslatorTest<shared_networks, TranslatorSharedNetworks> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorSharedNetworksTestKeaV4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // TranslatorSharedNetworksTestKeaV4
class TranslatorSharedNetworksTestKeaV6 :
public GenericTranslatorTest<shared_networks, TranslatorSharedNetworks> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorSharedNetworksTestKeaV6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorSharedNetworksTestKeaV6
// This test verifies that an empty shared network list can be properly
// translated from YANG to JSON.
class TranslatorSubnetsTestKeaV4 :
public GenericTranslatorTest<subnet_list, TranslatorSubnets> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorSubnetsTestKeaV4() {
model_ = KEA_DHCP4_SERVER;
}
-};
+}; // TranslatorSubnetsTestKeaV4
+
class TranslatorSubnetsTestKeaV6 :
public GenericTranslatorTest<subnet_list, TranslatorSubnets> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorSubnetsTestKeaV6() {
model_ = KEA_DHCP6_SERVER;
}
-};
+}; // TranslatorSubnetsTestKeaV6
+
class TranslatorSubnetsTestIetfV6 :
public GenericTranslatorTest<subnet_list, TranslatorSubnets> {
public:
-
- /// Constructor.
+ /// @brief Constructor
TranslatorSubnetsTestIetfV6() {
model_ = IETF_DHCPV6_SERVER;
}
-};
+}; // TranslatorSubnetsTestIetfV6
// This test verifies that an empty subnet list can be properly
// translated from YANG to JSON using IETF model.
session.deleteItem("/keatest-module:presence-container");
session.applyChanges();
}
-};
+}; // TranslatorBasicTest
namespace {
EXPECT_FALSE(element);
}
-} // anonymous namespace
+} // anonymous namespace
{ subnetOptionsModelKeaDhcp4, subnetOptionsTreeKeaDhcp4 },
{ subnetOptionsModelKeaDhcp6, subnetOptionsTreeKeaDhcp6 },
{ designExampleModel, designExampleTree }
-};
+}; // TEST_CONFIGS
} // namespace test
} // namespace yang
/// It is used in tests to conduct operations on whole configurations.
class YangRepr {
public:
-
/// @brief Constructor.
///
/// @param model The model name.
private:
/// @brief The model name.
std::string model_;
-};
+}; // YangRepr
/// @brief Alias for Items.
typedef YangRepr::YangReprItem YRItem;
: session_(session), model_(model) {
}
-TranslatorBasic::~TranslatorBasic() {
-}
-
void
TranslatorBasic::checkAndGetLeaf(ElementPtr& storage,
DataNode const& data_node,
TranslatorBasic(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorBasic();
+ virtual ~TranslatorBasic() = default;
/// @brief Retrieves a child YANG data node identified by name from the
/// given parent YANG container node and stores it in the specified storage.
/// @brief The model.
std::string model_;
-};
+}; // TranslatorBasic
} // namespace yang
} // namespace isc
TranslatorOptionDefList(session, model) {
}
-TranslatorClass::~TranslatorClass() {
-}
-
ElementPtr
TranslatorClass::getClass(DataNode const& data_node) {
try {
TranslatorClass(session, model) {
}
-TranslatorClasses::~TranslatorClasses() {
-}
-
ElementPtr
TranslatorClasses::getClasses(DataNode const& data_node) {
try {
class TranslatorClass : virtual public TranslatorOptionDataList,
virtual public TranslatorOptionDefList {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorClass(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorClass();
+ virtual ~TranslatorClass() = default;
/// @brief Translate a client class from YANG to JSON.
///
/// @param elem The JSON element.
void setClassKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorClass
/// @brief A translator class for converting a client class list between
/// YANG and JSON.
/// not define client class contents.
class TranslatorClasses : virtual public TranslatorClass {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorClasses(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorClasses();
+ virtual ~TranslatorClasses() = default;
/// @brief Translate client classes from YANG to JSON.
///
/// @throw BadValue on client class without name.
void setClassesKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorClasses
} // namespace yang
} // namespace isc
TranslatorLoggers(session, model) {
}
-TranslatorConfig::~TranslatorConfig() {
-}
-
ElementPtr
TranslatorConfig::getConfig() {
try {
virtual public TranslatorSharedNetworks,
virtual public TranslatorLoggers {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorConfig(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorConfig();
+ virtual ~TranslatorConfig() = default;
/// @brief Translate the whole DHCP server configuration from YANG to JSON.
///
///
/// @param elem The JSON element.
void setServerKeaDhcp6(isc::data::ConstElementPtr elem);
-};
+}; // TranslatorConfig
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
#endif // ISC_TRANSLATOR_CONFIG_H
: TranslatorBasic(session, model) {
}
-TranslatorControlSocket::~TranslatorControlSocket() {
-}
-
ElementPtr
TranslatorControlSocket::getControlSocket(DataNode const& data_node) {
try {
/// - kea-ctrl-agent
class TranslatorControlSocket : virtual public TranslatorBasic {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorControlSocket();
+ virtual ~TranslatorControlSocket() = default;
/// @brief Translate a control socket from YANG to JSON.
///
/// @throw BadValue on control socket without socket type or name.
void setControlSocketKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorControlSocket
} // namespace yang
} // namespace isc
: TranslatorBasic(session, model) {
}
-TranslatorDatabase::~TranslatorDatabase() {
-}
-
ElementPtr
TranslatorDatabase::getDatabase(DataNode const& data_node) {
try {
TranslatorDatabase(session, model) {
}
-TranslatorDatabases::~TranslatorDatabases() {
-}
-
ElementPtr
TranslatorDatabases::getDatabases(DataNode const& data_node,
string const& xpath) {
/// - kea-dhcp6-server
class TranslatorDatabase : virtual public TranslatorBasic {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorDatabase(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorDatabase();
+ virtual ~TranslatorDatabase() = default;
/// @brief Translate a database access from YANG to JSON.
///
void setDatabaseKea(const std::string& xpath,
isc::data::ConstElementPtr elem,
bool skip);
-};
+}; // TranslatorDatabase
/// @brief A translator class for converting a database access list between
/// YANG and JSON.
/// Supports kea-dhcp[46]-server, does not exist in ietf-dhcpv6-server.
class TranslatorDatabases : virtual public TranslatorDatabase {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorDatabases(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorDatabases();
+ virtual ~TranslatorDatabases() = default;
/// @brief Translate database accesses from YANG to JSON.
///
/// @throw BadValue on database without type,
void setDatabasesKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorDatabases
} // namespace yang
} // namespace isc
TranslatorOptionDataList(session, model) {
}
-TranslatorHost::~TranslatorHost() {
-}
-
ElementPtr
TranslatorHost::getHost(DataNode const& data_node) {
try {
TranslatorHost(session, model) {
}
-TranslatorHosts::~TranslatorHosts() {
-}
-
ElementPtr
TranslatorHosts::getHosts(DataNode const& data_node) {
return getList<TranslatorHost>(data_node, "host", *this,
/// ietf-dhcpv6-server is not supported yet.
class TranslatorHost : virtual public TranslatorOptionDataList {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorHost(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorHost();
+ virtual ~TranslatorHost() = default;
/// @brief Translate a host reservation from YANG to JSON.
///
/// @param xpath The xpath of the host reservation.
/// @param elem The JSON element.
void setHostKea(const std::string& xpath, isc::data::ConstElementPtr elem);
-};
+}; // TranslatorHost
/// @brief A translator class for converting host reservations list between
/// YANG and JSON.
/// The ietf-dhcpv6-server model is not yet supported.
class TranslatorHosts : virtual public TranslatorHost {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorHosts(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorHosts();
+ virtual ~TranslatorHosts() = default;
/// @brief Translate host reservations from YANG to JSON.
///
/// @throw BadValue on host reservation without known identifier type.
void setHostsKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorHosts
} // namespace yang
} // namespace isc
: TranslatorBasic(session, model) {
}
-TranslatorLogger::~TranslatorLogger() {
-}
-
ElementPtr
TranslatorLogger::getLogger(DataNode const& data_node) {
try {
TranslatorLogger(session, model) {
}
-TranslatorLoggers::~TranslatorLoggers() {
-}
-
ConstElementPtr
TranslatorLoggers::getLoggers(DataNode const& data_node) {
try {
/// - kea-ctrl-agent
class TranslatorLogger : virtual public TranslatorBasic {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorLogger(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorLogger();
+ virtual ~TranslatorLogger() = default;
/// @brief Translate a logger from YANG to JSON.
///
/// @param elem The JSON element.
void setLoggerKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorLogger
/// @brief A translator class for converting a logger list between
/// YANG and JSON.
/// Currently supports all kea servers and agents. Specific to Kea.
class TranslatorLoggers : virtual public TranslatorLogger {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorLoggers(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorLoggers();
+ virtual ~TranslatorLoggers() = default;
/// @brief Translate loggers from YANG to JSON.
///
/// @throw BadValue on a logger without name.
void setLoggersKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorLoggers
} // namespace yang
} // namespace isc
: TranslatorBasic(session, model) {
}
-TranslatorOptionData::~TranslatorOptionData() {
-}
-
ElementPtr
TranslatorOptionData::getOptionData(DataNode const& data_node) {
try {
TranslatorOptionData(session, model) {
}
-TranslatorOptionDataList::~TranslatorOptionDataList() {
-}
-
ConstElementPtr
TranslatorOptionDataList::getOptionDataList(DataNode const& data_node) {
try {
/// Currently supports on kea-dhcp[46]-server, not yet ietf-dhcpv6-server.
class TranslatorOptionData : virtual public TranslatorBasic {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorOptionData(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorOptionData();
+ virtual ~TranslatorOptionData() = default;
/// @brief Translate an option data from YANG to JSON.
///
/// @param elem The JSON element.
void setOptionDataKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorOptionData
/// @brief A translator class for converting an option data list between
/// YANG and JSON.
/// Currently supports on kea-dhcp[46]-server, not yet ietf-dhcpv6-server.
class TranslatorOptionDataList : virtual public TranslatorOptionData {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorOptionDataList();
+ virtual ~TranslatorOptionDataList() = default;
/// @brief Translate option data list from YANG to JSON.
///
/// @throw BadValue on option data without code or space.
void setOptionDataListKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorOptionDataList
} // namespace yang
} // namespace isc
: TranslatorBasic(session, model) {
}
-TranslatorOptionDef::~TranslatorOptionDef() {
-}
-
ElementPtr
TranslatorOptionDef::getOptionDef(DataNode const& data_node) {
try {
TranslatorOptionDef(session, model) {
}
-TranslatorOptionDefList::~TranslatorOptionDefList() {
-}
-
ConstElementPtr
TranslatorOptionDefList::getOptionDefList(DataNode const& data_node) {
try {
/// @todo: Support for ietf-dhcpv6-server model.
class TranslatorOptionDef : virtual public TranslatorBasic {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorOptionDef(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorOptionDef();
+ virtual ~TranslatorOptionDef() = default;
/// @brief Translate an option definition from YANG to JSON.
///
/// @throw BadValue on option definition without name or type.
void setOptionDefKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorOptionDef
// @brief A translator class for converting an option definition list
// between YANG and JSON.
/// @todo: Support for ietf-dhcpv6-server model.
class TranslatorOptionDefList : virtual public TranslatorOptionDef {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorOptionDefList();
+ virtual ~TranslatorOptionDefList() = default;
/// @brief Translate option definition list from YANG to JSON.
///
/// @throw BadValue on option definition without code or space.
void setOptionDefListKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorOptionDefList
} // namespace yang
} // namespace isc
TranslatorOptionDataList(session, model) {
}
-TranslatorPdPool::~TranslatorPdPool() {
-}
-
ElementPtr
TranslatorPdPool::getPdPool(DataNode const& data_node) {
try {
TranslatorPdPool(session, model) {
}
-TranslatorPdPools::~TranslatorPdPools() {
-}
-
ElementPtr
TranslatorPdPools::getPdPools(DataNode const& data_node) {
try {
/// - ietf-dhcpv6-server (partial support)
class TranslatorPdPool : virtual public TranslatorOptionDataList {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorPdPool(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorPdPool();
+ virtual ~TranslatorPdPool() = default;
/// @brief Translate a pd-pool from YANG to JSON.
///
/// @param elem The JSON element.
void setPdPoolKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorPdPool
/// @brief A translator class for converting a pd-pool list between
/// YANG and JSON.
/// - ietf-dhcpv6-server (partial support)
class TranslatorPdPools : virtual public TranslatorPdPool {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorPdPools(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorPdPools();
+ virtual ~TranslatorPdPools() = default;
/// @brief Translate pd-pools from YANG to JSON.
///
/// @throw BadValue on pd-pool without prefix or prefix length.
void setPdPoolsPrefix(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorPdPools
} // namespace yang
} // namespace isc
TranslatorOptionDataList(session, model) {
}
-TranslatorPool::~TranslatorPool() {
-}
-
ElementPtr
TranslatorPool::getPool(DataNode const& data_node) {
try {
TranslatorPool(session, model) {
}
-TranslatorPools::~TranslatorPools() {
-}
-
ElementPtr
TranslatorPools::getPools(DataNode const& data_node) {
try {
/// @endcode
class TranslatorPool : virtual public TranslatorOptionDataList {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorPool(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorPool();
+ virtual ~TranslatorPool() = default;
/// @brief Translate a pool from YANG to JSON.
///
/// @param elem The JSON element.
/// @throw BadValue on a pool without a well formed prefix.
void setPoolKea(const std::string& xpath, isc::data::ConstElementPtr elem);
-};
+}; // TranslatorPool
/// @brief A translator class for converting pools between YANG and JSON.
///
/// Currently supports on kea-dhcp[46]-server and partially ietf-dhcpv6-server.
class TranslatorPools : virtual public TranslatorPool {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorPools(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorPools();
+ virtual ~TranslatorPools() = default;
/// @brief Translate pools from YANG to JSON.
///
/// @throw BadValue on a pool without a prefix.
void setPoolsByAddresses(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorPools
} // namespace yang
} // namespace isc
TranslatorSubnets(session, model) {
}
-TranslatorSharedNetwork::~TranslatorSharedNetwork() {
-}
-
ElementPtr
TranslatorSharedNetwork::getSharedNetwork(DataNode const& data_node) {
try {
TranslatorSharedNetwork(session, model) {
}
-TranslatorSharedNetworks::~TranslatorSharedNetworks() {
-}
-
ElementPtr
TranslatorSharedNetworks::getSharedNetworks(DataNode const& data_node) {
return getList<TranslatorSharedNetwork>(data_node, "shared-network", *this,
/// - kea-dhcp6-server
class TranslatorSharedNetwork : virtual public TranslatorSubnets {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorSharedNetwork();
+ virtual ~TranslatorSharedNetwork() = default;
/// @brief Translate a shared network from YANG to JSON.
///
void setSharedNetworkKea(const std::string& xpath,
isc::data::ConstElementPtr elem,
const std::string& subsel);
-};
+}; // TranslatorSharedNetwork
/// @brief A translator class for converting a shared network list between
/// YANG and JSON.
/// - kea-dhcp6-server
class TranslatorSharedNetworks : virtual public TranslatorSharedNetwork {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorSharedNetworks();
+ virtual ~TranslatorSharedNetworks() = default;
/// @brief Translate shared networks from YANG to JSON.
///
/// @throw BadValue on a shared network without name.
void setSharedNetworksKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorSharedNetworks
} // namespace yang
} // namespace isc
TranslatorHosts(session, model) {
}
-TranslatorSubnet::~TranslatorSubnet() {
-}
-
ElementPtr
TranslatorSubnet::getSubnet(DataNode const& data_node) {
try {
TranslatorSubnet(session, model) {
}
-TranslatorSubnets::~TranslatorSubnets() {
-}
-
ElementPtr
TranslatorSubnets::getSubnets(DataNode const& data_node) {
try {
class TranslatorSubnet : virtual public TranslatorPools,
virtual public TranslatorPdPools, virtual public TranslatorHosts {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorSubnet(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorSubnet();
+ virtual ~TranslatorSubnet() = default;
/// @brief Get and translate a subnet from YANG to JSON.
///
/// @param elem The JSON element.
void setSubnetKea(const std::string& xpath,
isc::data::ConstElementPtr elem);
-};
+}; // TranslatorSubnets
/// @brief A translator class for converting a subnet list between
/// YANG and JSON.
/// Currently supports on kea-dhcp[46]-server and partially ietf-dhcpv6-server.
class TranslatorSubnets : virtual public TranslatorSubnet {
public:
-
/// @brief Constructor.
///
/// @param session Sysrepo session.
TranslatorSubnets(sysrepo::Session session, const std::string& model);
/// @brief Destructor.
- virtual ~TranslatorSubnets();
+ virtual ~TranslatorSubnets() = default;
/// @brief Get and translate subnets from YANG to JSON.
///
void setSubnetsKea(const std::string& xpath,
isc::data::ConstElementPtr elem,
const std::string& subsel);
-};
+}; // TranslatorSubnets
} // namespace yang
} // namespace isc
/// by ISC in the near future.
static const std::string KEA_CTRL_AGENT = "kea-ctrl-agent";
-} // end of namespace isc::yang
-} // end of namespace isc
+} // namespace yang
+} // namespace isc
#endif // ISC_YANG_MODELS_H
{ "kea-dhcp6-server", "2022-07-27" },
{ "kea-ctrl-agent", "2019-08-12" },
{ "kea-dhcp-ddns", "2022-07-27" }
-};
+}; // YANG_REVISIONS
} // namespace yang
} // namespace isc
// insert the r file here
};
-}; // end of namespace isc::yang
-}; // end of namespace isc
+} // namespace yang
+} // namespace isc
#endif // ISC_YANG_REVISIONS_H