libd2_la_SOURCES += d_process.h
libd2_la_SOURCES += d_controller.cc d_controller.h
libd2_la_SOURCES += d_cfg_mgr.cc d_cfg_mgr.h
-libd2_la_SOURCES += d2_asio.h
libd2_la_SOURCES += d2_log.cc d2_log.h
libd2_la_SOURCES += d2_process.cc d2_process.h
libd2_la_SOURCES += d2_config.cc d2_config.h
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 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
#ifndef BUNDY_D2_CONTROLLER_H
#define BUNDY_D2_CONTROLLER_H
+#include <asiolink/io_service.h>
#include <cc/data.h>
#include <cc/session.h>
#include <config/ccsession.h>
-#include <d2/d2_asio.h>
#include <d2/d2_log.h>
#include <d2/d_controller.h>
#include <d2/d_process.h>
+++ /dev/null
-// Copyright (C) 2013 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.
-
-#ifndef D2_ASIO_H
-#define D2_ASIO_H
-
-#include <asiolink/asiolink.h>
-
-#include <boost/shared_ptr.hpp>
-
-namespace isc {
-namespace d2 {
-
-/// @brief Defines a smart pointer to an IOService instance.
-typedef boost::shared_ptr<isc::asiolink::IOService> IOServicePtr;
-
-}; // namespace isc::d2
-}; // namespace isc
-
-#endif
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 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
#ifndef D2_CFG_MGR_H
#define D2_CFG_MGR_H
+#include <asiolink/io_service.h>
#include <cc/data.h>
#include <exceptions/exceptions.h>
-#include <d2/d2_asio.h>
#include <d2/d_cfg_mgr.h>
#include <d2/d2_config.h>
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
#ifndef D2_CONFIG_H
#define D2_CONFIG_H
+#include <asiolink/io_service.h>
#include <cc/data.h>
-#include <d2/d2_asio.h>
#include <d2/d_cfg_mgr.h>
#include <dhcpsrv/parsers/dhcp_parsers.h>
#include <dns/tsig.h>
// be configurable.
const unsigned int D2Process::QUEUE_RESTART_PERCENT = 80;
-D2Process::D2Process(const char* name, IOServicePtr io_service)
+D2Process::D2Process(const char* name, asiolink::IOServicePtr io_service)
: DProcessBase(name, io_service, DCfgMgrBasePtr(new D2CfgMgr())),
reconf_queue_flag_(false), shutdown_type_(SD_NORMAL) {
// service. Secondly, asiolink::IOService does not provide the poll
// method. This is a handy method which runs all ready handlers without
// blocking.
- IOServicePtr& io = getIoService();
+ asiolink::IOServicePtr& io = getIoService();
asio::io_service& asio_io_service = io->get_io_service();
// Poll runs all that are ready. If none are ready it returns immediately
/// asynchronous event handling.
///
/// @throw DProcessBaseError is io_service is NULL.
- D2Process(const char* name, IOServicePtr io_service);
+ D2Process(const char* name, asiolink::IOServicePtr io_service);
/// @brief Called after instantiation to perform initialization unique to
/// D2.
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
// Makes constant visible to Google test macros.
const size_t D2QueueMgr::MAX_QUEUE_DEFAULT;
-D2QueueMgr::D2QueueMgr(IOServicePtr& io_service, const size_t max_queue_size)
+D2QueueMgr::D2QueueMgr(asiolink::IOServicePtr& io_service, const size_t max_queue_size)
: io_service_(io_service), max_queue_size_(max_queue_size),
mgr_state_(NOT_INITTED), target_stop_state_(NOT_INITTED) {
if (!io_service_) {
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 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
/// @file d2_queue_mgr.h This file defines the class D2QueueMgr.
+#include <asiolink/io_service.h>
#include <exceptions/exceptions.h>
-#include <d2/d2_asio.h>
#include <dhcp_ddns/ncr_msg.h>
#include <dhcp_ddns/ncr_io.h>
/// This value must be greater than zero. It defaults to MAX_QUEUE_DEFAULT.
///
/// @throw D2QueueMgrError if max_queue_size is zero.
- D2QueueMgr(IOServicePtr& io_service,
+ D2QueueMgr(asiolink::IOServicePtr& io_service,
const size_t max_queue_size = MAX_QUEUE_DEFAULT);
/// @brief Destructor
void updateStopState();
/// @brief IOService that our listener should use for IO management.
- IOServicePtr io_service_;
+ asiolink::IOServicePtr io_service_;
/// @brief Dictates the maximum number of entries allowed in the queue.
size_t max_queue_size_;
const size_t D2UpdateMgr::MAX_TRANSACTIONS_DEFAULT;
D2UpdateMgr::D2UpdateMgr(D2QueueMgrPtr& queue_mgr, D2CfgMgrPtr& cfg_mgr,
- IOServicePtr& io_service,
+ asiolink::IOServicePtr& io_service,
const size_t max_transactions)
:queue_mgr_(queue_mgr), cfg_mgr_(cfg_mgr), io_service_(io_service) {
if (!queue_mgr_) {
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 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
/// @file d2_update_mgr.h This file defines the class D2UpdateMgr.
+#include <asiolink/io_service.h>
#include <exceptions/exceptions.h>
-#include <d2/d2_asio.h>
#include <d2/d2_log.h>
#include <d2/d2_queue_mgr.h>
#include <d2/d2_cfg_mgr.h>
/// @throw D2UpdateMgrError if either the queue manager or configuration
/// managers are NULL, or max transactions is less than one.
D2UpdateMgr(D2QueueMgrPtr& queue_mgr, D2CfgMgrPtr& cfg_mgr,
- IOServicePtr& io_service,
+ asiolink::IOServicePtr& io_service,
const size_t max_transactions = MAX_TRANSACTIONS_DEFAULT);
/// @brief Destructor
/// @brief Gets the D2UpdateMgr's IOService.
///
/// @return returns a reference to the IOService
- const IOServicePtr& getIOService() {
+ const asiolink::IOServicePtr& getIOService() {
return (io_service_);
}
/// passed into transactions to manager their IO events.
/// (For future reference, multi-threaded transactions would each use their
/// own IOService instance.)
- IOServicePtr io_service_;
+ asiolink::IOServicePtr io_service_;
/// @brief Maximum number of concurrent transactions.
size_t max_transactions_;
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
#ifndef D_CONTROLLER_H
#define D_CONTROLLER_H
+#include <asiolink/io_service.h>
#include <cc/data.h>
-#include <d2/d2_asio.h>
#include <d2/d2_log.h>
#include <d2/d_process.h>
#include <d2/io_service_signal.h>
/// @brief Getter for fetching the controller's IOService
///
/// @return returns a pointer reference to the IOService.
- IOServicePtr& getIOService() {
+ asiolink::IOServicePtr& getIOService() {
return (io_service_);
}
DProcessBasePtr process_;
/// @brief Shared pointer to an IOService object, used for ASIO operations.
- IOServicePtr io_service_;
+ asiolink::IOServicePtr io_service_;
/// @brief Set of registered signals to handle.
util::SignalSetPtr signal_set_;
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 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
#ifndef D_PROCESS_H
#define D_PROCESS_H
+#include <asiolink/io_service.h>
#include <cc/data.h>
-#include <d2/d2_asio.h>
#include <d2/d_cfg_mgr.h>
#include <boost/shared_ptr.hpp>
/// configuration parsing.
///
/// @throw DProcessBaseError is io_service is NULL.
- DProcessBase(const char* app_name, IOServicePtr io_service,
+ DProcessBase(const char* app_name, asiolink::IOServicePtr io_service,
DCfgMgrBasePtr cfg_mgr)
: app_name_(app_name), io_service_(io_service), shut_down_flag_(false),
cfg_mgr_(cfg_mgr) {
/// @brief Fetches the controller's IOService.
///
/// @return a reference to the controller's IOService.
- IOServicePtr& getIoService() {
+ asiolink::IOServicePtr& getIoService() {
return (io_service_);
}
std::string app_name_;
/// @brief The IOService to be used for asynchronous event handling.
- IOServicePtr io_service_;
+ asiolink::IOServicePtr io_service_;
/// @brief Boolean flag set when shutdown has been requested.
bool shut_down_flag_;
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 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
return;
}
-IOSignalQueue::IOSignalQueue(IOServicePtr& io_service)
+IOSignalQueue::IOSignalQueue(asiolink::IOServicePtr& io_service)
: io_service_(io_service), signals_() {
if (!io_service_) {
isc_throw(IOSignalError, "IOSignalQueue - io_serivce cannot be NULL");
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 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
#ifndef IO_SERVICE_SIGNAL_H
#define IO_SERVICE_SIGNAL_H
-#include <d2/d2_asio.h>
+#include <asiolink/io_service.h>
+#include <asiolink/interval_timer.h>
#include <exceptions/exceptions.h>
#include <map>
///
/// @param io_service the IOService to which to send signals.
/// @throw IOSignalError if io_service is NULL.
- IOSignalQueue (IOServicePtr& io_service);
+ IOSignalQueue (asiolink::IOServicePtr& io_service);
/// @brief Destructor.
~IOSignalQueue();
private:
/// @brief Pointer to the IOService which will receive the signals.
- IOServicePtr io_service_;
+ asiolink::IOServicePtr io_service_;
/// @brief A map of the IOSignals pushed through this queue.
IOSignalMap signals_;
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
const int NameAddTransaction::FQDN_NOT_IN_USE_EVT;
NameAddTransaction::
-NameAddTransaction(IOServicePtr& io_service,
+NameAddTransaction(asiolink::IOServicePtr& io_service,
dhcp_ddns::NameChangeRequestPtr& ncr,
DdnsDomainPtr& forward_domain,
DdnsDomainPtr& reverse_domain,
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 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
///
/// @throw NameAddTransaction error if given request is not a CHG_ADD,
/// NameChangeTransaction error for base class construction errors.
- NameAddTransaction(IOServicePtr& io_service,
+ NameAddTransaction(asiolink::IOServicePtr& io_service,
dhcp_ddns::NameChangeRequestPtr& ncr,
DdnsDomainPtr& forward_domain,
DdnsDomainPtr& reverse_domain,
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
// Currently NameRemoveTransaction does not define any events.
NameRemoveTransaction::
-NameRemoveTransaction(IOServicePtr& io_service,
+NameRemoveTransaction(asiolink::IOServicePtr& io_service,
dhcp_ddns::NameChangeRequestPtr& ncr,
DdnsDomainPtr& forward_domain,
DdnsDomainPtr& reverse_domain,
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 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
///
/// @throw NameRemoveTransaction error if given request is not a CHG_REMOVE,
/// NameChangeTransaction error for base class construction errors.
- NameRemoveTransaction(IOServicePtr& io_service,
+ NameRemoveTransaction(asiolink::IOServicePtr& io_service,
dhcp_ddns::NameChangeRequestPtr& ncr,
DdnsDomainPtr& forward_domain,
DdnsDomainPtr& reverse_domain,
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
const unsigned int NameChangeTransaction::MAX_UPDATE_TRIES_PER_SERVER;
NameChangeTransaction::
-NameChangeTransaction(IOServicePtr& io_service,
+NameChangeTransaction(asiolink::IOServicePtr& io_service,
dhcp_ddns::NameChangeRequestPtr& ncr,
DdnsDomainPtr& forward_domain,
DdnsDomainPtr& reverse_domain,
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
/// @file nc_trans.h This file defines the class NameChangeTransaction.
+#include <asiolink/io_service.h>
#include <exceptions/exceptions.h>
-#include <d2/d2_asio.h>
#include <d2/d2_cfg_mgr.h>
#include <d2/dns_client.h>
#include <d2/state_model.h>
/// @throw NameChangeTransactionError if given an null request,
/// if forward change is enabled but forward domain is null, if
/// reverse change is enabled but reverse domain is null.
- NameChangeTransaction(IOServicePtr& io_service,
+ NameChangeTransaction(asiolink::IOServicePtr& io_service,
dhcp_ddns::NameChangeRequestPtr& ncr,
DdnsDomainPtr& forward_domain,
DdnsDomainPtr& reverse_domain,
/// @brief Fetches the IOService the transaction uses for IO processing.
///
/// @return returns a const pointer to the IOService.
- const IOServicePtr& getIOService() {
+ const asiolink::IOServicePtr& getIOService() {
return (io_service_);
}
private:
/// @brief The IOService which should be used to for IO processing.
- IOServicePtr io_service_;
+ asiolink::IOServicePtr io_service_;
/// @brief The NameChangeRequest that the transaction is to fulfill.
dhcp_ddns::NameChangeRequestPtr ncr_;
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
// PERFORMANCE OF THIS SOFTWARE.
+#include <asiolink/io_service.h>
#include <config/ccsession.h>
#include <d2/d2_process.h>
#include <dhcp_ddns/ncr_io.h>
public:
/// @brief Constructor
- D2ProcessTest() : D2Process("d2test",
- IOServicePtr(new isc::asiolink::IOService())) {
+ D2ProcessTest() :
+ D2Process("d2test",
+ asiolink::IOServicePtr(new isc::asiolink::IOService())) {
}
/// @brief Destructor
TEST(D2Process, construction) {
// Verify that the constructor will fail if given an empty
// io service.
- IOServicePtr lcl_io_service;
+ asiolink::IOServicePtr lcl_io_service;
EXPECT_THROW (D2Process("TestProcess", lcl_io_service), DProcessBaseError);
// Verify that the constructor succeeds with a valid io_service
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 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
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
-#include <d2/d2_asio.h>
+#include <asiolink/io_service.h>
+#include <asiolink/interval_timer.h>
#include <d2/d2_queue_mgr.h>
#include <dhcp_ddns/ncr_udp.h>
#include <util/time_utilities.h>
/// @brief Tests that construction with max queue size of zero is not allowed.
TEST(D2QueueMgrBasicTest, construction1) {
- IOServicePtr io_service;
+ asiolink::IOServicePtr io_service;
// Verify that constructing with null IOServicePtr is not allowed.
EXPECT_THROW((D2QueueMgr(io_service)), D2QueueMgrError);
/// @brief Tests default construction works.
TEST(D2QueueMgrBasicTest, construction2) {
- IOServicePtr io_service(new isc::asiolink::IOService());
+ asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
// Verify that valid constructor works.
D2QueueMgrPtr queue_mgr;
/// @brief Tests construction with custom queue size works properly
TEST(D2QueueMgrBasicTest, construction3) {
- IOServicePtr io_service(new isc::asiolink::IOService());
+ asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
// Verify that custom queue size constructor works.
D2QueueMgrPtr queue_mgr;
/// 4. Peek returns the first entry on the queue without altering queue content
/// 5. Dequeue removes the first entry on the queue
TEST(D2QueueMgrBasicTest, basicQueue) {
- IOServicePtr io_service(new isc::asiolink::IOService());
+ asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
// Construct the manager with max queue size set to number of messages
// we'll use.
class QueueMgrUDPTest : public virtual ::testing::Test,
NameChangeSender::RequestSendHandler {
public:
- IOServicePtr io_service_;
+ asiolink::IOServicePtr io_service_;
NameChangeSenderPtr sender_;
isc::asiolink::IntervalTimer test_timer_;
D2QueueMgrPtr queue_mgr_;
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
-#include <d2/d2_asio.h>
+#include <asiolink/io_service.h>
#include <d2/d2_update_mgr.h>
#include <util/time_utilities.h>
#include <d_test_stubs.h>
///
/// Parameters match those needed by D2UpdateMgr.
D2UpdateMgrWrapper(D2QueueMgrPtr& queue_mgr, D2CfgMgrPtr& cfg_mgr,
- IOServicePtr& io_service,
+ asiolink::IOServicePtr& io_service,
const size_t max_transactions = MAX_TRANSACTIONS_DEFAULT)
: D2UpdateMgr(queue_mgr, cfg_mgr, io_service, max_transactions) {
}
/// 4. Default construction works and max transactions is defaulted properly
/// 5. Construction with custom max transactions works properly
TEST(D2UpdateMgr, construction) {
- IOServicePtr io_service(new isc::asiolink::IOService());
+ asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
D2QueueMgrPtr queue_mgr;
D2CfgMgrPtr cfg_mgr;
D2UpdateMgrPtr update_mgr;
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+#include <asiolink/io_service.h>
#include <d2/d2_log.h>
#include <d2/spec_config.h>
#include <d2/tests/d_test_stubs.h>
// Define custom process command supported by DStubProcess.
const char* DStubProcess::stub_proc_command_("cool_proc_cmd");
-DStubProcess::DStubProcess(const char* name, IOServicePtr io_service)
+DStubProcess::DStubProcess(const char* name, asiolink::IOServicePtr io_service)
: DProcessBase(name, io_service, DCfgMgrBasePtr(new DStubCfgMgr())) {
};
// To use run(), the "managing" layer must issue an io_service::stop
// or the call to run will continue to block, and shutdown will not
// occur.
- IOServicePtr& io_service = getIoService();
+ asiolink::IOServicePtr& io_service = getIoService();
while (!shouldShutdown()) {
try {
io_service->run_one();
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
#ifndef D_TEST_STUBS_H
#define D_TEST_STUBS_H
+#include <asiolink/io_service.h>
+
#include <cc/data.h>
#include <cc/session.h>
#include <config/ccsession.h>
-#include <d2/d2_asio.h>
#include <d2/d_controller.h>
#include <d2/d_cfg_mgr.h>
/// asynchronous event handling.
///
/// @throw DProcessBaseError is io_service is NULL.
- DStubProcess(const char* name, IOServicePtr io_service);
+ DStubProcess(const char* name, asiolink::IOServicePtr io_service);
/// @brief Invoked after process instantiation to perform initialization.
/// This implementation supports simulating an error initializing the
/// @brief Gets the Controller's IOService.
///
/// @return returns a reference to the IOService
- IOServicePtr& getIOService() {
+ asiolink::IOServicePtr& getIOService() {
return (getController()->io_service_);
}
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2016 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
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+#include <asiolink/io_service.h>
#include <d_test_stubs.h>
#include <d2/io_service_signal.h>
class IOSignalTest : public ::testing::Test {
public:
/// @brief IOService instance to process IO.
- IOServicePtr io_service_;
+ asiolink::IOServicePtr io_service_;
/// @brief Failsafe timer to ensure test(s) do not hang.
isc::asiolink::IntervalTimer test_timer_;
/// @brief Maximum time should be allowed to run.
// Tests IOSignal constructor.
TEST(IOSignal, construction) {
- IOServicePtr io_service(new asiolink::IOService());
+ asiolink::IOServicePtr io_service(new asiolink::IOService());
IOSignalPtr signal;
IOSignalPtr signal2;
// Tests IOSignalQueue constructors and exercises queuing methods.
TEST(IOSignalQueue, constructionAndQueuing) {
IOSignalQueuePtr queue;
- IOServicePtr io_service;
+ asiolink::IOServicePtr io_service;
// Verify constructing with an empty IOService will throw.
ASSERT_THROW(queue.reset(new IOSignalQueue(io_service)), IOSignalError);
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+#include <asiolink/io_service.h>
#include <d2/d2_cfg_mgr.h>
#include <d2/d2_cfg_mgr.h>
#include <d2/nc_add.h>
// to protected methods.
class NameAddStub : public NameAddTransaction {
public:
- NameAddStub(IOServicePtr& io_service,
+ NameAddStub(asiolink::IOServicePtr& io_service,
dhcp_ddns::NameChangeRequestPtr& ncr,
DdnsDomainPtr& forward_domain,
DdnsDomainPtr& reverse_domain,
/// 1. Construction with invalid type of request
/// 2. Valid construction functions properly
TEST(NameAddTransaction, construction) {
- IOServicePtr io_service(new isc::asiolink::IOService());
+ asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
D2CfgMgrPtr cfg_mgr(new D2CfgMgr());
const char* msg_str =
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+#include <asiolink/io_service.h>
#include <d2/d2_cfg_mgr.h>
#include <d2/d2_cfg_mgr.h>
#include <d2/nc_remove.h>
// to protected methods.
class NameRemoveStub : public NameRemoveTransaction {
public:
- NameRemoveStub(IOServicePtr& io_service,
+ NameRemoveStub(asiolink::IOServicePtr& io_service,
dhcp_ddns::NameChangeRequestPtr& ncr,
DdnsDomainPtr& forward_domain,
DdnsDomainPtr& reverse_domain,
/// 1. Construction with invalid type of request
/// 2. Valid construction functions properly
TEST(NameRemoveTransaction, construction) {
- IOServicePtr io_service(new isc::asiolink::IOService());
+ asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
D2CfgMgrPtr cfg_mgr(new D2CfgMgr());
const char* msg_str =
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
/// @file nc_test_utils.h prototypes for functions related transaction testing.
+#include <asiolink/io_service.h>
+#include <asiolink/interval_timer.h>
#include <d2/nc_trans.h>
#include <asio/ip/udp.hpp>
/// valve so tests do not hang.
class TimedIO {
public:
- IOServicePtr io_service_;
+ asiolink::IOServicePtr io_service_;
asiolink::IntervalTimer timer_;
int run_time_;
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 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
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+#include <asiolink/io_service.h>
#include <asiolink/interval_timer.h>
#include <d2/nc_trans.h>
#include <dns/opcode.h>
/// @brief Constructor
///
/// Parameters match those needed by NameChangeTransaction.
- NameChangeStub(IOServicePtr& io_service,
+ NameChangeStub(asiolink::IOServicePtr& io_service,
dhcp_ddns::NameChangeRequestPtr& ncr,
DdnsDomainPtr& forward_domain,
DdnsDomainPtr& reverse_domain,
/// requires reverse change.
/// 4. Valid construction functions properly
TEST(NameChangeTransaction, construction) {
- IOServicePtr io_service(new isc::asiolink::IOService());
+ asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
D2CfgMgrPtr cfg_mgr(new D2CfgMgr());
const char* msg_str =
// Verify that construction with a null IOServicePtr fails.
// @todo Subject to change if multi-threading is implemented.
- IOServicePtr empty;
+ asiolink::IOServicePtr empty;
EXPECT_THROW(NameChangeTransaction(empty, ncr,
forward_domain, reverse_domain, cfg_mgr),
NameChangeTransactionError);
IOServiceImpl* io_impl_;
};
+/// @brief Defines a smart pointer to an IOService instance.
+typedef boost::shared_ptr<IOService> IOServicePtr;
+
} // namespace asiolink
} // namespace isc
#endif // ASIOLINK_IO_SERVICE_H