diff options
author | chenzhengzhang <jerry.zzpku@gmail.com> | 2011-04-12 09:26:09 +0200 |
---|---|---|
committer | chenzhengzhang <jerry.zzpku@gmail.com> | 2011-04-12 09:26:09 +0200 |
commit | 36dd3d4b0bdd8c40695ac186955196bd268db586 (patch) | |
tree | bcd88e70a9909b36b970f5979ae5723024517c51 | |
parent | [trac749] refactor C++ utility library (diff) | |
download | kea-36dd3d4b0bdd8c40695ac186955196bd268db586.tar.xz kea-36dd3d4b0bdd8c40695ac186955196bd268db586.zip |
[trac749] refactor more C++ utility code
121 files changed, 275 insertions, 244 deletions
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc index 297d509820..caef9a0237 100644 --- a/src/bin/auth/auth_srv.cc +++ b/src/bin/auth/auth_srv.cc @@ -31,7 +31,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/edns.h> #include <dns/exceptions.h> @@ -64,7 +64,7 @@ using namespace isc; using namespace isc::cc; using namespace isc::datasrc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::auth; using namespace isc::dns::rdata; using namespace isc::data; diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h index 8ccd4dcbe3..3d26eea58b 100644 --- a/src/bin/auth/auth_srv.h +++ b/src/bin/auth/auth_srv.h @@ -109,7 +109,7 @@ public: /// \throw isc::Unexpected Protocol type of \a message is unexpected void processMessage(const asiolink::IOMessage& io_message, isc::dns::MessagePtr message, - isc::util::OutputBufferPtr buffer, + isc::util::io::OutputBufferPtr buffer, asiolink::DNSServer* server); /// \brief Set verbose flag diff --git a/src/bin/auth/benchmarks/query_bench.cc b/src/bin/auth/benchmarks/query_bench.cc index 642186234d..fc98569cf3 100644 --- a/src/bin/auth/benchmarks/query_bench.cc +++ b/src/bin/auth/benchmarks/query_bench.cc @@ -22,7 +22,7 @@ #include <bench/benchmark.h> #include <bench/benchmark_util.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/message.h> #include <dns/name.h> #include <dns/question.h> @@ -41,7 +41,7 @@ using namespace isc; using namespace isc::data; using namespace isc::auth; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::xfr; using namespace isc::bench; using namespace asiolink; diff --git a/src/bin/auth/main.cc b/src/bin/auth/main.cc index b47395fcb0..3154b40586 100644 --- a/src/bin/auth/main.cc +++ b/src/bin/auth/main.cc @@ -25,7 +25,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/message.h> #include <dns/messagerenderer.h> @@ -50,7 +50,7 @@ using namespace isc::data; using namespace isc::cc; using namespace isc::config; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::xfr; using namespace asiolink; diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc index 4ac7352798..41d9d65310 100644 --- a/src/bin/auth/tests/auth_srv_unittest.cc +++ b/src/bin/auth/tests/auth_srv_unittest.cc @@ -41,7 +41,7 @@ using namespace std; using namespace isc::cc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; using namespace isc::data; using namespace isc::xfr; diff --git a/src/bin/host/host.cc b/src/bin/host/host.cc index 973509e956..a8ec026961 100644 --- a/src/bin/host/host.cc +++ b/src/bin/host/host.cc @@ -24,7 +24,7 @@ #include <string> #include <iostream> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/message.h> @@ -38,7 +38,7 @@ using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace { char* dns_type = NULL; // not set, so A, AAAA, MX diff --git a/src/bin/resolver/main.cc b/src/bin/resolver/main.cc index ac6d441df2..8a858de9fd 100644 --- a/src/bin/resolver/main.cc +++ b/src/bin/resolver/main.cc @@ -29,7 +29,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/rcode.h> #include <dns/message.h> #include <dns/messagerenderer.h> diff --git a/src/bin/resolver/resolver.cc b/src/bin/resolver/resolver.cc index f132a0dbdd..51b27c1c2f 100644 --- a/src/bin/resolver/resolver.cc +++ b/src/bin/resolver/resolver.cc @@ -29,7 +29,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/opcode.h> #include <dns/rcode.h> @@ -51,7 +51,7 @@ using namespace std; using namespace isc; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns; using namespace isc::data; using namespace isc::config; diff --git a/src/bin/resolver/resolver.h b/src/bin/resolver/resolver.h index 6d3e306441..30d222cd1c 100644 --- a/src/bin/resolver/resolver.h +++ b/src/bin/resolver/resolver.h @@ -77,7 +77,7 @@ public: void processMessage(const asiolink::IOMessage& io_message, isc::dns::MessagePtr query_message, isc::dns::MessagePtr answer_message, - isc::util::OutputBufferPtr buffer, + isc::util::io::OutputBufferPtr buffer, asiolink::DNSServer* server); /// \brief Set and get the config session diff --git a/src/lib/asiolink/dns_answer.h b/src/lib/asiolink/dns_answer.h index e6e404d965..b6c3211aae 100644 --- a/src/lib/asiolink/dns_answer.h +++ b/src/lib/asiolink/dns_answer.h @@ -66,7 +66,7 @@ public: virtual void operator()(const IOMessage& io_message, isc::dns::MessagePtr query_message, isc::dns::MessagePtr answer_message, - isc::util::OutputBufferPtr buffer) const = 0; + isc::util::io::OutputBufferPtr buffer) const = 0; }; } // namespace asiolink diff --git a/src/lib/asiolink/dns_lookup.h b/src/lib/asiolink/dns_lookup.h index 2e87c4b243..99d75bde03 100644 --- a/src/lib/asiolink/dns_lookup.h +++ b/src/lib/asiolink/dns_lookup.h @@ -17,7 +17,7 @@ #include <asiolink/io_message.h> #include <asiolink/dns_server.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/message.h> namespace asiolink { @@ -70,7 +70,7 @@ public: virtual void operator()(const IOMessage& io_message, isc::dns::MessagePtr message, isc::dns::MessagePtr answer_message, - isc::util::OutputBufferPtr buffer, + isc::util::io::OutputBufferPtr buffer, DNSServer* server) const { (*self_)(io_message, message, answer_message, buffer, server); diff --git a/src/lib/asiolink/io_asio_socket.h b/src/lib/asiolink/io_asio_socket.h index 9d229906bc..8aaabeea64 100644 --- a/src/lib/asiolink/io_asio_socket.h +++ b/src/lib/asiolink/io_asio_socket.h @@ -26,7 +26,7 @@ #include <exceptions/exceptions.h> #include <coroutine.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <asiolink/io_error.h> #include <asiolink/io_socket.h> @@ -270,7 +270,7 @@ public: virtual bool processReceivedData(const void* staging, size_t length, size_t& cumulative, size_t& offset, size_t& expected, - isc::util::OutputBufferPtr& outbuff) = 0; + isc::util::io::OutputBufferPtr& outbuff) = 0; /// \brief Cancel I/O On AsioSocket virtual void cancel() = 0; @@ -372,7 +372,7 @@ public: virtual bool receiveComplete(const void* staging, size_t length, size_t& cumulative, size_t& offset, size_t& expected, - isc::util::OutputBufferPtr& outbuff) + isc::util::io::OutputBufferPtr& outbuff) { return (true); } diff --git a/src/lib/asiolink/io_fetch.cc b/src/lib/asiolink/io_fetch.cc index 542469f386..bfa756e63b 100644 --- a/src/lib/asiolink/io_fetch.cc +++ b/src/lib/asiolink/io_fetch.cc @@ -22,16 +22,14 @@ #include <boost/scoped_ptr.hpp> #include <boost/date_time/posix_time/posix_time_types.hpp> -#include <util/buffer.h> - #include <dns/message.h> #include <dns/messagerenderer.h> #include <dns/opcode.h> #include <dns/rcode.h> #include <log/logger.h> -#include <util/qid_gen.h> -#include <util/qid_gen.h> +#include <util/io/buffer.h> +#include <util/random/qid_gen.h> #include <asio.hpp> #include <asio/deadline_timer.hpp> @@ -51,7 +49,8 @@ using namespace asio; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::random; using namespace isc::log; using namespace std; diff --git a/src/lib/asiolink/io_fetch.h b/src/lib/asiolink/io_fetch.h index 8a522d614c..19aee10860 100644 --- a/src/lib/asiolink/io_fetch.h +++ b/src/lib/asiolink/io_fetch.h @@ -25,7 +25,7 @@ #include <asio/error_code.hpp> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/question.h> namespace asiolink { @@ -134,7 +134,7 @@ public: /// -1 indicates no timeout. IOFetch(Protocol protocol, IOService& service, const isc::dns::Question& question, const IOAddress& address, - uint16_t port, isc::util::OutputBufferPtr& buff, Callback* cb, + uint16_t port, isc::util::io::OutputBufferPtr& buff, Callback* cb, int wait = -1); /// \brief Return Current Protocol diff --git a/src/lib/asiolink/tcp_server.cc b/src/lib/asiolink/tcp_server.cc index 6ea862bf16..68af8e025a 100644 --- a/src/lib/asiolink/tcp_server.cc +++ b/src/lib/asiolink/tcp_server.cc @@ -23,7 +23,7 @@ #include <log/dummylog.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <asio.hpp> #include <asiolink/dummy_io_cb.h> @@ -38,7 +38,7 @@ using asio::ip::tcp; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace asiolink { diff --git a/src/lib/asiolink/tcp_server.h b/src/lib/asiolink/tcp_server.h index a4449f7f93..64e4dda965 100644 --- a/src/lib/asiolink/tcp_server.h +++ b/src/lib/asiolink/tcp_server.h @@ -91,7 +91,7 @@ private: boost::shared_ptr<asio::ip::tcp::socket> socket_; // The buffer into which the response is written - boost::shared_ptr<isc::util::OutputBuffer> respbuf_; + boost::shared_ptr<isc::util::io::OutputBuffer> respbuf_; // \c IOMessage and \c Message objects to be passed to the // DNS lookup and answer providers diff --git a/src/lib/asiolink/tcp_socket.h b/src/lib/asiolink/tcp_socket.h index 70f435892b..0b9ef69514 100644 --- a/src/lib/asiolink/tcp_socket.h +++ b/src/lib/asiolink/tcp_socket.h @@ -33,8 +33,8 @@ #include <config.h> -#include <util/buffer.h> -#include <util/asiolink_utilities.h> +#include <util/io/buffer.h> +#include <util/io/io_utilities.h> #include <asiolink/io_asio_socket.h> #include <asiolink/io_endpoint.h> @@ -155,7 +155,7 @@ public: virtual bool processReceivedData(const void* staging, size_t length, size_t& cumulative, size_t& offset, size_t& expected, - isc::util::OutputBufferPtr& outbuff); + isc::util::io::OutputBufferPtr& outbuff); /// \brief Cancel I/O On Socket virtual void cancel(); @@ -185,7 +185,7 @@ private: // The option of sending the data in two operations, the count followed by // the data was discounted as that would lead to two callbacks which would // cause problems with the stackless coroutine code. - isc::util::OutputBufferPtr send_buffer_; ///< Send buffer + isc::util::io::OutputBufferPtr send_buffer_; ///< Send buffer }; // Constructor - caller manages socket @@ -268,7 +268,7 @@ TCPSocket<C>::asyncSend(const void* data, size_t length, uint16_t count = boost::numeric_cast<uint16_t>(length); // Copy data into a buffer preceded by the count field. - send_buffer_.reset(new isc::util::OutputBuffer(length + 2)); + send_buffer_.reset(new isc::util::io::OutputBuffer(length + 2)); send_buffer_->writeUint16(count); send_buffer_->writeData(data, length); @@ -333,7 +333,7 @@ template <typename C> bool TCPSocket<C>::processReceivedData(const void* staging, size_t length, size_t& cumulative, size_t& offset, size_t& expected, - isc::util::OutputBufferPtr& outbuff) + isc::util::io::OutputBufferPtr& outbuff) { // Point to the data in the staging buffer and note how much there is. const uint8_t* data = static_cast<const uint8_t*>(staging); @@ -358,7 +358,7 @@ TCPSocket<C>::processReceivedData(const void* staging, size_t length, } // Have enough data to interpret the packet count, so do so now. - expected = isc::util::readUint16(data); + expected = isc::util::io::readUint16(data); // We have two bytes less of data to process. Point to the start of the // data and adjust the packet size. Note that at this point, diff --git a/src/lib/asiolink/tests/dns_server_unittest.cc b/src/lib/asiolink/tests/dns_server_unittest.cc index 7292140af3..2e07e3f71b 100644 --- a/src/lib/asiolink/tests/dns_server_unittest.cc +++ b/src/lib/asiolink/tests/dns_server_unittest.cc @@ -67,6 +67,7 @@ using namespace asiolink; using namespace asio; + namespace { static const std::string server_ip = "127.0.0.1"; const int server_port = 5553; @@ -109,7 +110,7 @@ class DummyLookup : public DNSLookup, public ServerStopper { void operator()(const IOMessage& io_message, isc::dns::MessagePtr message, isc::dns::MessagePtr answer_message, - isc::util::OutputBufferPtr buffer, + isc::util::io::OutputBufferPtr buffer, DNSServer* server) const { stopServer(); server->resume(true); @@ -123,7 +124,7 @@ class SimpleAnswer : public DNSAnswer, public ServerStopper { void operator()(const IOMessage& message, isc::dns::MessagePtr query_message, isc::dns::MessagePtr answer_message, - isc::util::OutputBufferPtr buffer) const + isc::util::io::OutputBufferPtr buffer) const { //copy what we get from user buffer->writeData(message.getData(), message.getDataSize()); diff --git a/src/lib/asiolink/tests/io_fetch_unittest.cc b/src/lib/asiolink/tests/io_fetch_unittest.cc index 0e63c5c7e9..c65fc69387 100644 --- a/src/lib/asiolink/tests/io_fetch_unittest.cc +++ b/src/lib/asiolink/tests/io_fetch_unittest.cc @@ -26,8 +26,8 @@ #include <asio.hpp> -#include <util/buffer.h> -#include <util/asiolink_utilities.h> +#include <util/io/buffer.h> +#include <util/io/io_utilities.h> #include <dns/question.h> #include <dns/message.h> @@ -43,7 +43,7 @@ using namespace asio; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace asio::ip; using namespace std; diff --git a/src/lib/asiolink/tests/tcp_socket_unittest.cc b/src/lib/asiolink/tests/tcp_socket_unittest.cc index 515b29e83b..28f0d9eabb 100644 --- a/src/lib/asiolink/tests/tcp_socket_unittest.cc +++ b/src/lib/asiolink/tests/tcp_socket_unittest.cc @@ -35,8 +35,8 @@ #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> -#include <util/buffer.h> -#include <util/asiolink_utilities.h> +#include <util/io/buffer.h> +#include <util/io/io_utilities.h> #include <asio.hpp> @@ -47,7 +47,7 @@ using namespace asio; using namespace asio::ip; using namespace asiolink; -using namespace isc::util; +using namespace isc::util::io; using namespace std; namespace { diff --git a/src/lib/asiolink/tests/udp_socket_unittest.cc b/src/lib/asiolink/tests/udp_socket_unittest.cc index c3a96d264f..f006991101 100644 --- a/src/lib/asiolink/tests/udp_socket_unittest.cc +++ b/src/lib/asiolink/tests/udp_socket_unittest.cc @@ -35,8 +35,8 @@ #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> -#include <util/buffer.h> -#include <util/asiolink_utilities.h> +#include <util/io/buffer.h> +#include <util/io/io_utilities.h> #include <asio.hpp> @@ -46,7 +46,7 @@ using namespace asio; using namespace asiolink; -using namespace isc::util; +using namespace isc::util::io; using namespace std; namespace { diff --git a/src/lib/asiolink/udp_server.cc b/src/lib/asiolink/udp_server.cc index 5e9fe1d2b9..afbc75431a 100644 --- a/src/lib/asiolink/udp_server.cc +++ b/src/lib/asiolink/udp_server.cc @@ -38,7 +38,7 @@ using isc::log::dlog; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace asiolink { @@ -135,7 +135,7 @@ struct UDPServer::Data { isc::dns::MessagePtr answer_message_; // The buffer into which the response is written - isc::util::OutputBufferPtr respbuf_; + isc::util::io::OutputBufferPtr respbuf_; // The buffer into which the query packet is written boost::shared_array<char> data_; diff --git a/src/lib/asiolink/udp_socket.h b/src/lib/asiolink/udp_socket.h index a03d3d4fcb..c378ea7e6d 100644 --- a/src/lib/asiolink/udp_socket.h +++ b/src/lib/asiolink/udp_socket.h @@ -141,7 +141,7 @@ public: virtual bool processReceivedData(const void* staging, size_t length, size_t& cumulative, size_t& offset, size_t& expected, - isc::util::OutputBufferPtr& outbuff); + isc::util::io::OutputBufferPtr& outbuff); /// \brief Cancel I/O On Socket virtual void cancel(); @@ -283,7 +283,7 @@ template <typename C> bool UDPSocket<C>::processReceivedData(const void* staging, size_t length, size_t& cumulative, size_t& offset, size_t& expected, - isc::util::OutputBufferPtr& outbuff) + isc::util::io::OutputBufferPtr& outbuff) { // Set return values to what we should expect. cumulative = length; diff --git a/src/lib/bench/benchmark_util.cc b/src/lib/bench/benchmark_util.cc index c67a851eb3..dbc28fd491 100644 --- a/src/lib/bench/benchmark_util.cc +++ b/src/lib/bench/benchmark_util.cc @@ -19,7 +19,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/name.h> #include <dns/message.h> @@ -35,7 +35,7 @@ using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace isc { namespace bench { diff --git a/src/lib/bench/tests/loadquery_unittest.cc b/src/lib/bench/tests/loadquery_unittest.cc index 93130d2fc7..acb7ac27b2 100644 --- a/src/lib/bench/tests/loadquery_unittest.cc +++ b/src/lib/bench/tests/loadquery_unittest.cc @@ -17,7 +17,7 @@ #include <vector> #include <sstream> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/message.h> #include <dns/name.h> #include <dns/opcode.h> @@ -32,7 +32,7 @@ using namespace std; using namespace isc::bench; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace { typedef pair<string, string> QueryParam; diff --git a/src/lib/cache/tests/cache_test_messagefromfile.h b/src/lib/cache/tests/cache_test_messagefromfile.h index 7d55f08c71..611386c999 100644 --- a/src/lib/cache/tests/cache_test_messagefromfile.h +++ b/src/lib/cache/tests/cache_test_messagefromfile.h @@ -14,7 +14,7 @@ #include <vector> #include <dns/tests/unittest_util.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/message.h> using namespace isc; @@ -31,7 +31,7 @@ messageFromFile(Message& message, const char* datafile) { std::vector<unsigned char> data; UnitTestUtil::readWireData(datafile, data); - isc::util::InputBuffer buffer(&data[0], data.size()); + isc::util::io::InputBuffer buffer(&data[0], data.size()); message.fromWire(buffer); } diff --git a/src/lib/cache/tests/cache_test_sectioncount.h b/src/lib/cache/tests/cache_test_sectioncount.h index df7cb5258d..6cb37a54af 100644 --- a/src/lib/cache/tests/cache_test_sectioncount.h +++ b/src/lib/cache/tests/cache_test_sectioncount.h @@ -14,7 +14,7 @@ #include <vector> #include <dns/tests/unittest_util.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/message.h> using namespace isc; diff --git a/src/lib/cache/tests/message_cache_unittest.cc b/src/lib/cache/tests/message_cache_unittest.cc index 60ae0371a2..c9f816f393 100644 --- a/src/lib/cache/tests/message_cache_unittest.cc +++ b/src/lib/cache/tests/message_cache_unittest.cc @@ -16,7 +16,7 @@ #include <string> #include <gtest/gtest.h> #include <dns/tests/unittest_util.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include "../message_cache.h" #include "../rrset_cache.h" #include "../resolver_cache.h" @@ -25,7 +25,7 @@ using namespace isc::cache; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace std; namespace { diff --git a/src/lib/cache/tests/message_entry_unittest.cc b/src/lib/cache/tests/message_entry_unittest.cc index d9709ed298..cb6df760b4 100644 --- a/src/lib/cache/tests/message_entry_unittest.cc +++ b/src/lib/cache/tests/message_entry_unittest.cc @@ -15,7 +15,7 @@ #include <gtest/gtest.h> #include <dns/tests/unittest_util.h> #include <dns/message.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include "../message_entry.h" #include "../rrset_cache.h" #include "../resolver_cache.h" diff --git a/src/lib/datasrc/data_source.cc b/src/lib/datasrc/data_source.cc index 5123d5b25a..c242ef5dd4 100644 --- a/src/lib/datasrc/data_source.cc +++ b/src/lib/datasrc/data_source.cc @@ -26,9 +26,9 @@ #include <datasrc/data_source.h> #include <datasrc/query.h> -#include <util/base32hex.h> -#include <util/buffer.h> -#include <util/sha1.h> +#include <util/compat/base32hex.h> +#include <util/compat/sha1.h> +#include <util/io/buffer.h> #include <dns/message.h> #include <dns/name.h> @@ -46,7 +46,8 @@ } while (0) using namespace std; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; using namespace isc::dns; using namespace isc::dns::rdata; diff --git a/src/lib/datasrc/tests/datasrc_unittest.cc b/src/lib/datasrc/tests/datasrc_unittest.cc index 01de77abd4..8d36e73ae1 100644 --- a/src/lib/datasrc/tests/datasrc_unittest.cc +++ b/src/lib/datasrc/tests/datasrc_unittest.cc @@ -20,7 +20,7 @@ #include <gtest/gtest.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/message.h> #include <dns/messagerenderer.h> @@ -45,7 +45,7 @@ using isc::UnitTestUtil; using namespace std; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns; using namespace isc::dns::rdata; using namespace isc::datasrc; diff --git a/src/lib/dns/Makefile.am b/src/lib/dns/Makefile.am index 8fe311002c..b7fb9b1d35 100644 --- a/src/lib/dns/Makefile.am +++ b/src/lib/dns/Makefile.am @@ -64,7 +64,6 @@ lib_LTLIBRARIES = libdns++.la libdns___la_SOURCES = libdns___la_SOURCES += edns.h edns.cc libdns___la_SOURCES += exceptions.h exceptions.cc -libdns___la_SOURCES += util/hex.h libdns___la_SOURCES += masterload.h masterload.cc libdns___la_SOURCES += message.h message.cc libdns___la_SOURCES += messagerenderer.h messagerenderer.cc diff --git a/src/lib/dns/edns.cc b/src/lib/dns/edns.cc index 43b75b4fc7..ebdad81f19 100644 --- a/src/lib/dns/edns.cc +++ b/src/lib/dns/edns.cc @@ -36,7 +36,7 @@ using namespace std; using namespace boost; using namespace isc::dns::rdata; -using namespace isc::util; +using namespace isc::util::io; namespace isc { namespace dns { diff --git a/src/lib/dns/edns.h b/src/lib/dns/edns.h index b794183ad1..fea0e2aed9 100644 --- a/src/lib/dns/edns.h +++ b/src/lib/dns/edns.h @@ -25,8 +25,10 @@ namespace isc { namespace util { +namespace io { class OutputBuffer; } +} namespace dns { @@ -323,7 +325,7 @@ public: /// except it renders the OPT RR in an \c OutputBuffer and therefore /// does not care about message size limit. /// As a consequence it always returns 1. - unsigned int toWire(isc::util::OutputBuffer& buffer, + unsigned int toWire(isc::util::io::OutputBuffer& buffer, const uint8_t extended_rcode) const; /// \brief Convert the EDNS to a string. diff --git a/src/lib/dns/message.cc b/src/lib/dns/message.cc index a4502e99d1..3516f6ab1b 100644 --- a/src/lib/dns/message.cc +++ b/src/lib/dns/message.cc @@ -25,7 +25,8 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> + #include <dns/edns.h> #include <dns/exceptions.h> #include <dns/message.h> @@ -43,7 +44,7 @@ using namespace std; using namespace boost; using namespace isc::dns::rdata; -using namespace isc::util; +using namespace isc::util::io; namespace isc { namespace dns { diff --git a/src/lib/dns/message.h b/src/lib/dns/message.h index 560129924f..2b6af9b6a9 100644 --- a/src/lib/dns/message.h +++ b/src/lib/dns/message.h @@ -29,8 +29,10 @@ namespace isc { namespace util { +namespace io { class InputBuffer; } +} namespace dns { @@ -532,10 +534,10 @@ public: void toWire(MessageRenderer& renderer); /// \brief Parse the header section of the \c Message. - void parseHeader(isc::util::InputBuffer& buffer); + void parseHeader(isc::util::io::InputBuffer& buffer); /// \brief Parse the \c Message. - void fromWire(isc::util::InputBuffer& buffer); + void fromWire(isc::util::io::InputBuffer& buffer); /// /// \name Protocol constants diff --git a/src/lib/dns/messagerenderer.cc b/src/lib/dns/messagerenderer.cc index 9ae2d34007..eeb1f1cf3e 100644 --- a/src/lib/dns/messagerenderer.cc +++ b/src/lib/dns/messagerenderer.cc @@ -16,11 +16,11 @@ #include <cassert> #include <set> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/messagerenderer.h> -using namespace isc::util; +using namespace isc::util::io; namespace isc { namespace dns { diff --git a/src/lib/dns/messagerenderer.h b/src/lib/dns/messagerenderer.h index 4d51eea395..41507aa9c8 100644 --- a/src/lib/dns/messagerenderer.h +++ b/src/lib/dns/messagerenderer.h @@ -17,8 +17,10 @@ namespace isc { namespace util { +namespace io { class OutputBuffer; } +} namespace dns { // forward declarations @@ -104,7 +106,7 @@ public: /// /// \param buffer An \c OutputBuffer object to which wire format data is /// written. - MessageRenderer(isc::util::OutputBuffer& buffer); + MessageRenderer(isc::util::io::OutputBuffer& buffer); /// \brief The destructor. /// /// The destructor does nothing on the given \c buffer on construction; diff --git a/src/lib/dns/name.cc b/src/lib/dns/name.cc index 8269b40f38..5ff419c4d7 100644 --- a/src/lib/dns/name.cc +++ b/src/lib/dns/name.cc @@ -20,13 +20,13 @@ #include <iostream> #include <algorithm> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/name.h> #include <dns/messagerenderer.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; using isc::dns::NameComparisonResult; using isc::dns::MessageRenderer; diff --git a/src/lib/dns/name.h b/src/lib/dns/name.h index f58bb93e70..562a1d524d 100644 --- a/src/lib/dns/name.h +++ b/src/lib/dns/name.h @@ -24,9 +24,11 @@ namespace isc { namespace util { +namespace io { class InputBuffer; class OutputBuffer; } +} namespace dns { class MessageRenderer; @@ -250,7 +252,7 @@ public: /// /// \param buffer A buffer storing the wire format %data. /// \param downcase Whether to convert upper case alphabets to lower case. - explicit Name(isc::util::InputBuffer& buffer, bool downcase = false); + explicit Name(isc::util::io::InputBuffer& buffer, bool downcase = false); /// /// We use the default copy constructor intentionally. //@} @@ -362,7 +364,7 @@ public: /// then this method should not throw an exception. /// /// \param buffer An output buffer to store the wire %data. - void toWire(isc::util::OutputBuffer& buffer) const; + void toWire(isc::util::io::OutputBuffer& buffer) const; //@} /// diff --git a/src/lib/dns/python/edns_python.cc b/src/lib/dns/python/edns_python.cc index 07dcc14c6b..bceee7adda 100644 --- a/src/lib/dns/python/edns_python.cc +++ b/src/lib/dns/python/edns_python.cc @@ -17,7 +17,7 @@ #include <dns/edns.h> using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; // diff --git a/src/lib/dns/python/message_python.cc b/src/lib/dns/python/message_python.cc index 30100f41ac..42af4d4af3 100644 --- a/src/lib/dns/python/message_python.cc +++ b/src/lib/dns/python/message_python.cc @@ -15,7 +15,7 @@ #include <exceptions/exceptions.h> #include <dns/message.h> using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; // // Declaration of the custom exceptions diff --git a/src/lib/dns/python/messagerenderer_python.cc b/src/lib/dns/python/messagerenderer_python.cc index 139475ab34..9da2a632f3 100644 --- a/src/lib/dns/python/messagerenderer_python.cc +++ b/src/lib/dns/python/messagerenderer_python.cc @@ -18,7 +18,7 @@ // and static wrappers around the methods we export), a list of methods, // and a type description using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; // MessageRenderer diff --git a/src/lib/dns/python/name_python.cc b/src/lib/dns/python/name_python.cc index b36e3135c7..d8070b8e70 100644 --- a/src/lib/dns/python/name_python.cc +++ b/src/lib/dns/python/name_python.cc @@ -41,7 +41,7 @@ static PyObject* po_NameRelation; // and static wrappers around the methods we export), a list of methods, // and a type description using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; // NameComparisonResult class s_NameComparisonResult : public PyObject { diff --git a/src/lib/dns/python/pydnspp.cc b/src/lib/dns/python/pydnspp.cc index 27dbae684a..8fd1e1711e 100644 --- a/src/lib/dns/python/pydnspp.cc +++ b/src/lib/dns/python/pydnspp.cc @@ -31,7 +31,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/name.h> #include <dns/messagerenderer.h> diff --git a/src/lib/dns/python/rdata_python.cc b/src/lib/dns/python/rdata_python.cc index faa4f4c41f..8f07ef271d 100644 --- a/src/lib/dns/python/rdata_python.cc +++ b/src/lib/dns/python/rdata_python.cc @@ -14,7 +14,7 @@ #include <dns/rdata.h> using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; // diff --git a/src/lib/dns/python/rrclass_python.cc b/src/lib/dns/python/rrclass_python.cc index 8e8b60b01e..66611a3f64 100644 --- a/src/lib/dns/python/rrclass_python.cc +++ b/src/lib/dns/python/rrclass_python.cc @@ -14,7 +14,7 @@ #include <dns/rrclass.h> using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; // // Declaration of the custom exceptions diff --git a/src/lib/dns/python/rrset_python.cc b/src/lib/dns/python/rrset_python.cc index c7d05d1e1d..952503cf93 100644 --- a/src/lib/dns/python/rrset_python.cc +++ b/src/lib/dns/python/rrset_python.cc @@ -29,7 +29,7 @@ static PyObject* po_EmptyRRset; // and static wrappers around the methods we export), a list of methods, // and a type description using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; // RRset diff --git a/src/lib/dns/python/rrttl_python.cc b/src/lib/dns/python/rrttl_python.cc index db9d736bc6..7d244e8df7 100644 --- a/src/lib/dns/python/rrttl_python.cc +++ b/src/lib/dns/python/rrttl_python.cc @@ -18,7 +18,7 @@ using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; // // Declaration of the custom exceptions diff --git a/src/lib/dns/python/rrtype_python.cc b/src/lib/dns/python/rrtype_python.cc index 10895c6d5f..a31bb548bb 100644 --- a/src/lib/dns/python/rrtype_python.cc +++ b/src/lib/dns/python/rrtype_python.cc @@ -18,7 +18,7 @@ using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; // // Declaration of the custom exceptions diff --git a/src/lib/dns/question.cc b/src/lib/dns/question.cc index 723fc88ae0..86f1d482fa 100644 --- a/src/lib/dns/question.cc +++ b/src/lib/dns/question.cc @@ -15,7 +15,7 @@ #include <iostream> #include <string> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/name.h> #include <dns/question.h> @@ -23,7 +23,7 @@ #include <dns/rrtype.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; namespace isc { namespace dns { diff --git a/src/lib/dns/question.h b/src/lib/dns/question.h index 3c038b371d..42d2dfe933 100644 --- a/src/lib/dns/question.h +++ b/src/lib/dns/question.h @@ -26,9 +26,11 @@ namespace isc { namespace util { +namespace io { class InputBuffer; class OutputBuffer; } +} namespace dns { @@ -122,7 +124,7 @@ public: /// classes fails. /// /// \param buffer A buffer storing the wire format data. - Question(isc::util::InputBuffer& buffer); + Question(isc::util::io::InputBuffer& buffer); /// \brief Constructor from fixed parameters of the \c Question. /// @@ -228,7 +230,7 @@ public: /// /// \param buffer An output buffer to store the wire data. /// \return 1 - unsigned int toWire(isc::util::OutputBuffer& buffer) const; + unsigned int toWire(isc::util::io::OutputBuffer& buffer) const; //@} /// diff --git a/src/lib/dns/rdata.cc b/src/lib/dns/rdata.cc index d8825fadb7..4e5ec0e08f 100644 --- a/src/lib/dns/rdata.cc +++ b/src/lib/dns/rdata.cc @@ -27,7 +27,7 @@ #include <boost/lexical_cast.hpp> #include <boost/shared_ptr.hpp> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -36,7 +36,7 @@ using namespace std; using namespace boost; -using namespace isc::util; +using namespace isc::util::io; namespace isc { namespace dns { diff --git a/src/lib/dns/rdata.h b/src/lib/dns/rdata.h index 1e57f270e8..ab15918f76 100644 --- a/src/lib/dns/rdata.h +++ b/src/lib/dns/rdata.h @@ -23,9 +23,11 @@ namespace isc { namespace util { +namespace io { class InputBuffer; class OutputBuffer; } +} namespace dns { class MessageRenderer; class RRType; @@ -170,7 +172,7 @@ public: /// should be explicitly defined in the derived class. /// /// \param buffer An output buffer to store the wire data. - virtual void toWire(isc::util::OutputBuffer& buffer) const = 0; + virtual void toWire(isc::util::io::OutputBuffer& buffer) const = 0; /// \brief Render the \c Rdata in the wire format into a /// \c MessageRenderer object. /// @@ -274,7 +276,7 @@ public: /// \param buffer A reference to an \c InputBuffer object storing the /// \c Rdata to parse. /// \param rdata_len The length in buffer of the \c Rdata. In bytes. - Generic(isc::util::InputBuffer& buffer, size_t rdata_len); + Generic(isc::util::io::InputBuffer& buffer, size_t rdata_len); /// /// \brief The destructor. virtual ~Generic(); @@ -318,7 +320,7 @@ public: /// be thrown. /// /// \param buffer An output buffer to store the wire data. - virtual void toWire(isc::util::OutputBuffer& buffer) const; + virtual void toWire(isc::util::io::OutputBuffer& buffer) const; /// \brief Render the \c generic::Generic in the wire format into a /// \c MessageRenderer object. /// @@ -445,7 +447,7 @@ RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass, /// \return An \c RdataPtr object pointing to the created \c Rdata /// object. RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass, - isc::util::InputBuffer& buffer, size_t len); + isc::util::io::InputBuffer& buffer, size_t len); /// \brief Create RDATA of a given pair of RR type and class, copying /// of another RDATA of same kind. /// diff --git a/src/lib/dns/rdata/any_255/tsig_250.cc b/src/lib/dns/rdata/any_255/tsig_250.cc index 130ce2f538..994623d780 100644 --- a/src/lib/dns/rdata/any_255/tsig_250.cc +++ b/src/lib/dns/rdata/any_255/tsig_250.cc @@ -18,8 +18,8 @@ #include <boost/lexical_cast.hpp> -#include <util/buffer.h> -#include <util/base64.h> +#include <util/io/buffer.h> +#include <util/compat/base64.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,8 @@ using namespace std; using namespace boost; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/ch_3/a_1.cc b/src/lib/dns/rdata/ch_3/a_1.cc index 359624d0d2..dbd5613d12 100644 --- a/src/lib/dns/rdata/ch_3/a_1.cc +++ b/src/lib/dns/rdata/ch_3/a_1.cc @@ -16,13 +16,13 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/cname_5.cc b/src/lib/dns/rdata/generic/cname_5.cc index 6a3447d35c..a970b417be 100644 --- a/src/lib/dns/rdata/generic/cname_5.cc +++ b/src/lib/dns/rdata/generic/cname_5.cc @@ -16,14 +16,14 @@ #include <string> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/dname_39.cc b/src/lib/dns/rdata/generic/dname_39.cc index 7cd22bfb02..a2a685b709 100644 --- a/src/lib/dns/rdata/generic/dname_39.cc +++ b/src/lib/dns/rdata/generic/dname_39.cc @@ -16,14 +16,14 @@ #include <string> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/dnskey_48.cc b/src/lib/dns/rdata/generic/dnskey_48.cc index 8203fba85f..823e60da4c 100644 --- a/src/lib/dns/rdata/generic/dnskey_48.cc +++ b/src/lib/dns/rdata/generic/dnskey_48.cc @@ -20,8 +20,8 @@ #include <boost/lexical_cast.hpp> #include <boost/foreach.hpp> -#include <util/base64.h> -#include <util/buffer.h> +#include <util/compat/base64.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/name.h> #include <dns/rdata.h> @@ -31,7 +31,8 @@ #include <time.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/ds_43.cc b/src/lib/dns/rdata/generic/ds_43.cc index 36ea6fb740..69eb2a3f84 100644 --- a/src/lib/dns/rdata/generic/ds_43.cc +++ b/src/lib/dns/rdata/generic/ds_43.cc @@ -19,8 +19,8 @@ #include <boost/lexical_cast.hpp> -#include <util/buffer.h> -#include <util/hex.h> +#include <util/io/buffer.h> +#include <util/compat/hex.h> #include <dns/messagerenderer.h> #include <dns/name.h> @@ -31,7 +31,8 @@ #include <time.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/mx_15.cc b/src/lib/dns/rdata/generic/mx_15.cc index 8999384575..858ca92884 100644 --- a/src/lib/dns/rdata/generic/mx_15.cc +++ b/src/lib/dns/rdata/generic/mx_15.cc @@ -20,7 +20,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,7 @@ using namespace std; using namespace boost; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/ns_2.cc b/src/lib/dns/rdata/generic/ns_2.cc index dcdbcd2dbf..e2a2b23937 100644 --- a/src/lib/dns/rdata/generic/ns_2.cc +++ b/src/lib/dns/rdata/generic/ns_2.cc @@ -16,14 +16,14 @@ #include <string> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/nsec3_50.cc b/src/lib/dns/rdata/generic/nsec3_50.cc index 41d274fd40..3efdfebedb 100644 --- a/src/lib/dns/rdata/generic/nsec3_50.cc +++ b/src/lib/dns/rdata/generic/nsec3_50.cc @@ -20,11 +20,11 @@ #include <boost/lexical_cast.hpp> -#include <util/base32hex.h> -#include <util/buffer.h> -#include <util/hex.h> -#include <dns/exceptions.h> +#include <util/compat/base32hex.h> +#include <util/compat/hex.h> +#include <util/io/buffer.h> +#include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/name.h> #include <dns/rrtype.h> @@ -38,7 +38,8 @@ using namespace std; using namespace isc::dns::rdata::generic::detail::nsec; -using namespace isc::util; +using namespace isc::util::comapt; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/nsec3param_51.cc b/src/lib/dns/rdata/generic/nsec3param_51.cc index cc2c9debd3..c190cb2233 100644 --- a/src/lib/dns/rdata/generic/nsec3param_51.cc +++ b/src/lib/dns/rdata/generic/nsec3param_51.cc @@ -19,8 +19,8 @@ #include <boost/lexical_cast.hpp> -#include <util/buffer.h> -#include <util/hex.h> +#include <util/io/buffer.h> +#include <util/compat/hex.h> #include <dns/messagerenderer.h> #include <dns/name.h> #include <dns/rdata.h> @@ -30,7 +30,8 @@ #include <time.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/nsec_47.cc b/src/lib/dns/rdata/generic/nsec_47.cc index 379bd0b432..040a83a915 100644 --- a/src/lib/dns/rdata/generic/nsec_47.cc +++ b/src/lib/dns/rdata/generic/nsec_47.cc @@ -17,8 +17,8 @@ #include <sstream> #include <vector> -#include <util/base64.h> -#include <util/buffer.h> +#include <util/compat/base64.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/name.h> @@ -32,7 +32,8 @@ #include <time.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; using namespace isc::dns::rdata::generic::detail::nsec; // BEGIN_ISC_NAMESPACE diff --git a/src/lib/dns/rdata/generic/opt_41.cc b/src/lib/dns/rdata/generic/opt_41.cc index fc80832c3b..cb8025656c 100644 --- a/src/lib/dns/rdata/generic/opt_41.cc +++ b/src/lib/dns/rdata/generic/opt_41.cc @@ -16,13 +16,13 @@ #include <string> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/ptr_12.cc b/src/lib/dns/rdata/generic/ptr_12.cc index 63585b052d..304da08778 100644 --- a/src/lib/dns/rdata/generic/ptr_12.cc +++ b/src/lib/dns/rdata/generic/ptr_12.cc @@ -16,14 +16,14 @@ #include <string> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/rrsig_46.cc b/src/lib/dns/rdata/generic/rrsig_46.cc index def54885eb..65eb0c78ce 100644 --- a/src/lib/dns/rdata/generic/rrsig_46.cc +++ b/src/lib/dns/rdata/generic/rrsig_46.cc @@ -20,9 +20,9 @@ #include <boost/lexical_cast.hpp> -#include <util/base64.h> -#include <util/buffer.h> -#include <util/dnssectime.h> +#include <util/compat/base64.h> +#include <util/io/buffer.h> +#include <util/compat/time_utilities.h> #include <dns/messagerenderer.h> #include <dns/name.h> #include <dns/rrtype.h> @@ -35,6 +35,8 @@ using namespace std; using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/soa_6.cc b/src/lib/dns/rdata/generic/soa_6.cc index 58d6da4f0d..01cde31a0a 100644 --- a/src/lib/dns/rdata/generic/soa_6.cc +++ b/src/lib/dns/rdata/generic/soa_6.cc @@ -20,7 +20,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,7 @@ using namespace std; using namespace boost; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/generic/txt_16.cc b/src/lib/dns/rdata/generic/txt_16.cc index d1d4d89a3c..c7c6ddec7c 100644 --- a/src/lib/dns/rdata/generic/txt_16.cc +++ b/src/lib/dns/rdata/generic/txt_16.cc @@ -18,14 +18,14 @@ #include <string> #include <vector> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/hs_4/a_1.cc b/src/lib/dns/rdata/hs_4/a_1.cc index 359624d0d2..dbd5613d12 100644 --- a/src/lib/dns/rdata/hs_4/a_1.cc +++ b/src/lib/dns/rdata/hs_4/a_1.cc @@ -16,13 +16,13 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/in_1/a_1.cc b/src/lib/dns/rdata/in_1/a_1.cc index 1d7b8dee92..21f5a738d4 100644 --- a/src/lib/dns/rdata/in_1/a_1.cc +++ b/src/lib/dns/rdata/in_1/a_1.cc @@ -22,14 +22,14 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/in_1/aaaa_28.cc b/src/lib/dns/rdata/in_1/aaaa_28.cc index 1125a5975a..edaa1905d0 100644 --- a/src/lib/dns/rdata/in_1/aaaa_28.cc +++ b/src/lib/dns/rdata/in_1/aaaa_28.cc @@ -22,14 +22,14 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rdata/template.cc b/src/lib/dns/rdata/template.cc index b1dc571118..617ce2a566 100644 --- a/src/lib/dns/rdata/template.cc +++ b/src/lib/dns/rdata/template.cc @@ -14,13 +14,13 @@ #include <string> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE diff --git a/src/lib/dns/rrclass.cc b/src/lib/dns/rrclass.cc index f1bb8d7e07..43a6b9d5e3 100644 --- a/src/lib/dns/rrclass.cc +++ b/src/lib/dns/rrclass.cc @@ -18,14 +18,14 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rrparamregistry.h> #include <dns/rrclass.h> using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace isc { namespace dns { diff --git a/src/lib/dns/rrparamregistry.h b/src/lib/dns/rrparamregistry.h index ae41b5f6bc..7244d7fb8d 100644 --- a/src/lib/dns/rrparamregistry.h +++ b/src/lib/dns/rrparamregistry.h @@ -102,7 +102,7 @@ public: /// \c Rdata to parse. /// \param rdata_len The length in buffer of the \c Rdata. In bytes. /// \return An \c RdataPtr object pointing to the created \c Rdata object. - virtual RdataPtr create(isc::util::InputBuffer& buffer, size_t rdata_len) const = 0; + virtual RdataPtr create(isc::util::io::InputBuffer& buffer, size_t rdata_len) const = 0; /// /// \brief Create RDATA from another \c Rdata object of the same type. /// @@ -473,7 +473,7 @@ public: /// \return An \c rdata::RdataPtr object pointing to the created \c Rdata /// object. rdata::RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass, - isc::util::InputBuffer& buffer, size_t len); + isc::util::io::InputBuffer& buffer, size_t len); /// \brief Create RDATA of a given pair of RR type and class, copying /// of another RDATA of same kind. /// diff --git a/src/lib/dns/rrset.cc b/src/lib/dns/rrset.cc index e80afdbc42..fd95817348 100644 --- a/src/lib/dns/rrset.cc +++ b/src/lib/dns/rrset.cc @@ -18,7 +18,7 @@ #include <boost/shared_ptr.hpp> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/name.h> #include <dns/rrclass.h> @@ -28,7 +28,7 @@ using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace isc { diff --git a/src/lib/dns/rrset.h b/src/lib/dns/rrset.h index bf7adc0cf1..996bec1ac5 100644 --- a/src/lib/dns/rrset.h +++ b/src/lib/dns/rrset.h @@ -27,8 +27,10 @@ namespace isc { namespace util { +namespace io { class OututBuffer; } +} namespace dns { @@ -319,7 +321,7 @@ public: /// /// \param buffer An output buffer to store the wire data. /// \return The number of RRs rendered. - virtual unsigned int toWire(isc::util::OutputBuffer& buffer) const = 0; + virtual unsigned int toWire(isc::util::io::OutputBuffer& buffer) const = 0; //@} /// @@ -623,7 +625,7 @@ public: /// /// This method simply uses the default implementation. /// See \c AbstractRRset::toWire(OutputBuffer&)const. - virtual unsigned int toWire(isc::util::OutputBuffer& buffer) const; + virtual unsigned int toWire(isc::util::io::OutputBuffer& buffer) const; //@} /// diff --git a/src/lib/dns/rrttl.cc b/src/lib/dns/rrttl.cc index a4c4f83812..b85a4400e1 100644 --- a/src/lib/dns/rrttl.cc +++ b/src/lib/dns/rrttl.cc @@ -17,13 +17,13 @@ #include <sstream> #include <ostream> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rrttl.h> using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace isc { namespace dns { diff --git a/src/lib/dns/rrttl.h b/src/lib/dns/rrttl.h index 17ec8919af..f37b040522 100644 --- a/src/lib/dns/rrttl.h +++ b/src/lib/dns/rrttl.h @@ -21,9 +21,11 @@ namespace isc { namespace util { +namespace io { class InputBuffer; class OutputBuffer; } +} namespace dns { @@ -94,7 +96,7 @@ public: /// an exception of class \c IncompleteRRTTL will be thrown. /// /// \param buffer A buffer storing the wire format data. - explicit RRTTL(isc::util::InputBuffer& buffer); + explicit RRTTL(isc::util::io::InputBuffer& buffer); /// //@} @@ -133,7 +135,7 @@ public: /// standard exception will be thrown. /// /// \param buffer An output buffer to store the wire data. - void toWire(isc::util::OutputBuffer& buffer) const; + void toWire(isc::util::io::OutputBuffer& buffer) const; //@} /// diff --git a/src/lib/dns/rrtype.cc b/src/lib/dns/rrtype.cc index e234fadc17..c54fce5b8f 100644 --- a/src/lib/dns/rrtype.cc +++ b/src/lib/dns/rrtype.cc @@ -19,13 +19,13 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rrparamregistry.h> #include <dns/rrtype.h> using namespace std; -using namespace isc::util; +using namespace isc::util::io; using isc::dns::RRType; namespace isc { diff --git a/src/lib/dns/tests/edns_unittest.cc b/src/lib/dns/tests/edns_unittest.cc index 26cc01c343..292a4f98ec 100644 --- a/src/lib/dns/tests/edns_unittest.cc +++ b/src/lib/dns/tests/edns_unittest.cc @@ -16,7 +16,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/edns.h> #include <dns/exceptions.h> #include <dns/message.h> @@ -35,7 +35,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; const uint8_t EDNS::SUPPORTED_VERSION; diff --git a/src/lib/dns/tests/message_unittest.cc b/src/lib/dns/tests/message_unittest.cc index 4031e4f40b..d8ed6a8e48 100644 --- a/src/lib/dns/tests/message_unittest.cc +++ b/src/lib/dns/tests/message_unittest.cc @@ -14,7 +14,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/edns.h> #include <dns/exceptions.h> #include <dns/message.h> @@ -35,7 +35,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; // diff --git a/src/lib/dns/tests/messagerenderer_unittest.cc b/src/lib/dns/tests/messagerenderer_unittest.cc index fe790fe837..645e5f34d9 100644 --- a/src/lib/dns/tests/messagerenderer_unittest.cc +++ b/src/lib/dns/tests/messagerenderer_unittest.cc @@ -14,7 +14,7 @@ #include <vector> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/messagerenderer.h> @@ -25,7 +25,7 @@ using isc::UnitTestUtil; using isc::dns::Name; using isc::dns::MessageRenderer; -using isc::util::OutputBuffer; +using isc::util::io::OutputBuffer; namespace { class MessageRendererTest : public ::testing::Test { diff --git a/src/lib/dns/tests/name_unittest.cc b/src/lib/dns/tests/name_unittest.cc index 6434229dd9..6d4ae8249a 100644 --- a/src/lib/dns/tests/name_unittest.cc +++ b/src/lib/dns/tests/name_unittest.cc @@ -19,7 +19,7 @@ #include <limits> #include <stdexcept> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/name.h> #include <dns/messagerenderer.h> @@ -31,7 +31,7 @@ using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; // // XXX: these are defined as class static constants, but some compilers diff --git a/src/lib/dns/tests/question_unittest.cc b/src/lib/dns/tests/question_unittest.cc index 25fd75b4c6..3e10e3f53d 100644 --- a/src/lib/dns/tests/question_unittest.cc +++ b/src/lib/dns/tests/question_unittest.cc @@ -17,7 +17,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/name.h> @@ -32,7 +32,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace { class QuestionTest : public ::testing::Test { diff --git a/src/lib/dns/tests/rdata_cname_unittest.cc b/src/lib/dns/tests/rdata_cname_unittest.cc index d6b02aa49b..cc27d99fb6 100644 --- a/src/lib/dns/tests/rdata_cname_unittest.cc +++ b/src/lib/dns/tests/rdata_cname_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_dname_unittest.cc b/src/lib/dns/tests/rdata_dname_unittest.cc index ebd9e0e04f..3c26c5aedd 100644 --- a/src/lib/dns/tests/rdata_dname_unittest.cc +++ b/src/lib/dns/tests/rdata_dname_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_dnskey_unittest.cc b/src/lib/dns/tests/rdata_dnskey_unittest.cc index f0596ed989..5ddacbcd9f 100644 --- a/src/lib/dns/tests/rdata_dnskey_unittest.cc +++ b/src/lib/dns/tests/rdata_dnskey_unittest.cc @@ -16,7 +16,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> @@ -32,7 +32,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_ds_unittest.cc b/src/lib/dns/tests/rdata_ds_unittest.cc index 59886208cf..57c688d8d0 100644 --- a/src/lib/dns/tests/rdata_ds_unittest.cc +++ b/src/lib/dns/tests/rdata_ds_unittest.cc @@ -14,7 +14,7 @@ #include <string> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> @@ -29,7 +29,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_in_a_unittest.cc b/src/lib/dns/tests/rdata_in_a_unittest.cc index 47e2bfa480..a54988f8eb 100644 --- a/src/lib/dns/tests/rdata_in_a_unittest.cc +++ b/src/lib/dns/tests/rdata_in_a_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_in_aaaa_unittest.cc b/src/lib/dns/tests/rdata_in_aaaa_unittest.cc index 6fd4d0ed61..2e46b4c8ac 100644 --- a/src/lib/dns/tests/rdata_in_aaaa_unittest.cc +++ b/src/lib/dns/tests/rdata_in_aaaa_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_mx_unittest.cc b/src/lib/dns/tests/rdata_mx_unittest.cc index c4c9757a35..ef65ef992a 100644 --- a/src/lib/dns/tests/rdata_mx_unittest.cc +++ b/src/lib/dns/tests/rdata_mx_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> @@ -27,7 +27,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_ns_unittest.cc b/src/lib/dns/tests/rdata_ns_unittest.cc index b8057831b9..996d49dc7b 100644 --- a/src/lib/dns/tests/rdata_ns_unittest.cc +++ b/src/lib/dns/tests/rdata_ns_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_nsec3_unittest.cc b/src/lib/dns/tests/rdata_nsec3_unittest.cc index 7ac7ed7e15..bc0697e653 100644 --- a/src/lib/dns/tests/rdata_nsec3_unittest.cc +++ b/src/lib/dns/tests/rdata_nsec3_unittest.cc @@ -16,9 +16,9 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> +#include <util/compat/hex.h> #include <dns/exceptions.h> -#include <util/hex.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> @@ -34,7 +34,8 @@ using isc::UnitTestUtil; using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_nsec3param_unittest.cc b/src/lib/dns/tests/rdata_nsec3param_unittest.cc index 3cf5c24755..e8732cb5dd 100644 --- a/src/lib/dns/tests/rdata_nsec3param_unittest.cc +++ b/src/lib/dns/tests/rdata_nsec3param_unittest.cc @@ -16,9 +16,9 @@ #include <exceptions/exceptions.h> -#include <util/base32hex.h> -#include <util/buffer.h> -#include <util/hex.h> +#include <util/compat/base32hex.h> +#include <util/compat/hex.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> @@ -34,7 +34,8 @@ using isc::UnitTestUtil; using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_nsec_unittest.cc b/src/lib/dns/tests/rdata_nsec_unittest.cc index 5aa1e9c444..8e2ca12a15 100644 --- a/src/lib/dns/tests/rdata_nsec_unittest.cc +++ b/src/lib/dns/tests/rdata_nsec_unittest.cc @@ -14,7 +14,7 @@ #include <string> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -30,7 +30,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_opt_unittest.cc b/src/lib/dns/tests/rdata_opt_unittest.cc index 698d5863eb..e009ba2ab2 100644 --- a/src/lib/dns/tests/rdata_opt_unittest.cc +++ b/src/lib/dns/tests/rdata_opt_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> @@ -27,7 +27,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_ptr_unittest.cc b/src/lib/dns/tests/rdata_ptr_unittest.cc index 7f5de2056b..5e18fd4e57 100644 --- a/src/lib/dns/tests/rdata_ptr_unittest.cc +++ b/src/lib/dns/tests/rdata_ptr_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; // diff --git a/src/lib/dns/tests/rdata_rrsig_unittest.cc b/src/lib/dns/tests/rdata_rrsig_unittest.cc index e2bd6ab6e0..7aa6c055a5 100644 --- a/src/lib/dns/tests/rdata_rrsig_unittest.cc +++ b/src/lib/dns/tests/rdata_rrsig_unittest.cc @@ -14,8 +14,8 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> -#include <dns/dnssectime.h> +#include <util/io/buffer.h> +#include <util/compat/time_utilities.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> @@ -31,7 +31,8 @@ using isc::UnitTestUtil; using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; +using namespace isc::util::compat; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_soa_unittest.cc b/src/lib/dns/tests/rdata_soa_unittest.cc index 63fe1f7098..4786d6307a 100644 --- a/src/lib/dns/tests/rdata_soa_unittest.cc +++ b/src/lib/dns/tests/rdata_soa_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> @@ -27,7 +27,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_tsig_unittest.cc b/src/lib/dns/tests/rdata_tsig_unittest.cc index 76f91a6fcc..5bf04ba2d1 100644 --- a/src/lib/dns/tests/rdata_tsig_unittest.cc +++ b/src/lib/dns/tests/rdata_tsig_unittest.cc @@ -16,7 +16,7 @@ #include <exceptions/exceptions.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -32,7 +32,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_txt_unittest.cc b/src/lib/dns/tests/rdata_txt_unittest.cc index e5f8ac9edd..e71ee54ccf 100644 --- a/src/lib/dns/tests/rdata_txt_unittest.cc +++ b/src/lib/dns/tests/rdata_txt_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/exceptions.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> @@ -28,7 +28,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rdata_unittest.cc b/src/lib/dns/tests/rdata_unittest.cc index fa791dc053..2506af9c04 100644 --- a/src/lib/dns/tests/rdata_unittest.cc +++ b/src/lib/dns/tests/rdata_unittest.cc @@ -16,7 +16,7 @@ #include <string> #include <sstream> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rdata.h> #include <dns/rdataclass.h> @@ -31,7 +31,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace isc { diff --git a/src/lib/dns/tests/rdata_unittest.h b/src/lib/dns/tests/rdata_unittest.h index 1bc0fa4497..8b4813b6a8 100644 --- a/src/lib/dns/tests/rdata_unittest.h +++ b/src/lib/dns/tests/rdata_unittest.h @@ -15,7 +15,7 @@ #ifndef __RDATA_UNITTEST_H #define __RDATA_UNITTEST_H 1 -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rrclass.h> #include <dns/rrtype.h> @@ -23,7 +23,7 @@ #include <gtest/gtest.h> -using namespace isc::util; +using namespace isc::util::io; namespace isc { namespace dns { diff --git a/src/lib/dns/tests/rrclass_unittest.cc b/src/lib/dns/tests/rrclass_unittest.cc index 15f9a8c6e1..fcfcb95964 100644 --- a/src/lib/dns/tests/rrclass_unittest.cc +++ b/src/lib/dns/tests/rrclass_unittest.cc @@ -14,7 +14,7 @@ #include <gtest/gtest.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rrclass.h> @@ -23,7 +23,7 @@ using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace { class RRClassTest : public ::testing::Test { diff --git a/src/lib/dns/tests/rrparamregistry_unittest.cc b/src/lib/dns/tests/rrparamregistry_unittest.cc index d2bec5c0d4..15efff179f 100644 --- a/src/lib/dns/tests/rrparamregistry_unittest.cc +++ b/src/lib/dns/tests/rrparamregistry_unittest.cc @@ -27,7 +27,7 @@ using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rrset_unittest.cc b/src/lib/dns/tests/rrset_unittest.cc index f9513411c7..42a98a6ddc 100644 --- a/src/lib/dns/tests/rrset_unittest.cc +++ b/src/lib/dns/tests/rrset_unittest.cc @@ -14,7 +14,7 @@ #include <stdexcept> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/name.h> #include <dns/rdata.h> @@ -32,7 +32,7 @@ using isc::UnitTestUtil; using namespace std; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::dns::rdata; namespace { diff --git a/src/lib/dns/tests/rrttl_unittest.cc b/src/lib/dns/tests/rrttl_unittest.cc index fe75eb62e5..7eb6ee4884 100644 --- a/src/lib/dns/tests/rrttl_unittest.cc +++ b/src/lib/dns/tests/rrttl_unittest.cc @@ -14,7 +14,7 @@ #include <gtest/gtest.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rrttl.h> @@ -23,7 +23,7 @@ using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace { class RRTTLTest : public ::testing::Test { diff --git a/src/lib/dns/tests/rrtype_unittest.cc b/src/lib/dns/tests/rrtype_unittest.cc index 12f6001f92..c3a1bfcbd0 100644 --- a/src/lib/dns/tests/rrtype_unittest.cc +++ b/src/lib/dns/tests/rrtype_unittest.cc @@ -14,7 +14,7 @@ #include <gtest/gtest.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/messagerenderer.h> #include <dns/rrtype.h> @@ -23,7 +23,7 @@ using namespace std; using namespace isc; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace { class RRTypeTest : public ::testing::Test { diff --git a/src/lib/nsas/tests/nameserver_address_store_unittest.cc b/src/lib/nsas/tests/nameserver_address_store_unittest.cc index 9133daf170..d389063cb0 100644 --- a/src/lib/nsas/tests/nameserver_address_store_unittest.cc +++ b/src/lib/nsas/tests/nameserver_address_store_unittest.cc @@ -40,6 +40,7 @@ #include "nsas_test.h" using namespace isc::dns; +using namespace isc::util; using namespace std; namespace isc { diff --git a/src/lib/nsas/tests/nsas_test.h b/src/lib/nsas/tests/nsas_test.h index 0bd5e36aeb..0bdcd4bfef 100644 --- a/src/lib/nsas/tests/nsas_test.h +++ b/src/lib/nsas/tests/nsas_test.h @@ -26,7 +26,7 @@ #include <config.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/message.h> #include <dns/rdata.h> #include <dns/rrtype.h> @@ -40,7 +40,7 @@ using namespace isc::dns::rdata; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace { MessagePtr diff --git a/src/lib/nsas/tests/zone_entry_unittest.cc b/src/lib/nsas/tests/zone_entry_unittest.cc index 34f995c03c..c2110d1517 100644 --- a/src/lib/nsas/tests/zone_entry_unittest.cc +++ b/src/lib/nsas/tests/zone_entry_unittest.cc @@ -36,6 +36,7 @@ using namespace isc::nsas; using namespace asiolink; using namespace std; using namespace isc::dns; +using namespace isc::util; namespace { diff --git a/src/lib/nsas/zone_entry.cc b/src/lib/nsas/zone_entry.cc index 902727c899..878f193286 100644 --- a/src/lib/nsas/zone_entry.cc +++ b/src/lib/nsas/zone_entry.cc @@ -33,6 +33,7 @@ namespace isc { using namespace isc::dns; using namespace isc::util; +using namespace isc::util::random; namespace nsas { diff --git a/src/lib/nsas/zone_entry.h b/src/lib/nsas/zone_entry.h index c691438a45..acd769b95a 100644 --- a/src/lib/nsas/zone_entry.h +++ b/src/lib/nsas/zone_entry.h @@ -26,7 +26,7 @@ #include <resolve/resolver_interface.h> #include <util/locks.h> -#include <util/random_number_generator.h> +#include <util/random/random_number_generator.h> #include "hash_key.h" #include "nsas_entry.h" @@ -183,7 +183,7 @@ private: void insertCallback(NameserverPtr nameserver, AddressFamily family); // A random generator for this zone entry // TODO: A more global one? Per thread one? - isc::util::WeightedRandomIntegerGenerator address_selector; + isc::util::random::WeightedRandomIntegerGenerator address_selector; }; } // namespace nsas diff --git a/src/lib/resolve/recursive_query.cc b/src/lib/resolve/recursive_query.cc index 2acede80fe..af6cc2d71c 100644 --- a/src/lib/resolve/recursive_query.cc +++ b/src/lib/resolve/recursive_query.cc @@ -42,7 +42,7 @@ using isc::log::dlog; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace asiolink { diff --git a/src/lib/resolve/recursive_query.h b/src/lib/resolve/recursive_query.h index ebdab9591c..4f049a65ca 100644 --- a/src/lib/resolve/recursive_query.h +++ b/src/lib/resolve/recursive_query.h @@ -17,7 +17,7 @@ #include <asiolink/dns_service.h> #include <asiolink/dns_server.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <nsas/nameserver_address_store.h> #include <cache/resolver_cache.h> @@ -99,7 +99,7 @@ public: /// \param server A pointer to the \c DNSServer object handling the client void resolve(const isc::dns::Question& question, isc::dns::MessagePtr answer_message, - isc::util::OutputBufferPtr buffer, + isc::util::io::OutputBufferPtr buffer, DNSServer* server); /// \brief Set Test Server diff --git a/src/lib/resolve/tests/recursive_query_unittest.cc b/src/lib/resolve/tests/recursive_query_unittest.cc index 4f340c7c88..868d86c9f7 100644 --- a/src/lib/resolve/tests/recursive_query_unittest.cc +++ b/src/lib/resolve/tests/recursive_query_unittest.cc @@ -30,7 +30,7 @@ #include <dns/tests/unittest_util.h> #include <dns/rcode.h> -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/message.h> #include <nsas/nameserver_address_store.h> @@ -56,7 +56,7 @@ using isc::UnitTestUtil; using namespace std; using namespace asiolink; using namespace isc::dns; -using namespace isc::util; +using namespace isc::util::io; namespace { const char* const TEST_SERVER_PORT = "53535"; @@ -320,7 +320,7 @@ protected: boost::shared_ptr<asiolink::IOMessage> io_message_; isc::dns::MessagePtr message_; isc::dns::MessagePtr answer_message_; - isc::util::OutputBufferPtr respbuf_; + isc::util::io::OutputBufferPtr respbuf_; // Callback functions provided by the caller const SimpleCallback* checkin_; diff --git a/src/lib/resolve/tests/recursive_query_unittest_2.cc b/src/lib/resolve/tests/recursive_query_unittest_2.cc index eb8454caf0..a0048ae5ad 100644 --- a/src/lib/resolve/tests/recursive_query_unittest_2.cc +++ b/src/lib/resolve/tests/recursive_query_unittest_2.cc @@ -23,8 +23,8 @@ #include <asio.hpp> -#include <util/buffer.h> -#include <util/asiolink_utilities.h> +#include <util/io/buffer.h> +#include <util/io/io_utilities.h> #include <dns/question.h> #include <dns/message.h> @@ -49,7 +49,7 @@ using namespace asio; using namespace asio::ip; using namespace isc::dns; using namespace isc::dns::rdata; -using namespace isc::util; +using namespace isc::util::io; using namespace isc::resolve; using namespace std; diff --git a/src/lib/testutils/srv_test.cc b/src/lib/testutils/srv_test.cc index a48a96fbd2..fe5a742a47 100644 --- a/src/lib/testutils/srv_test.cc +++ b/src/lib/testutils/srv_test.cc @@ -25,8 +25,8 @@ #include <testutils/srv_test.h> using namespace isc::dns; -using namespace isc::util; using namespace asiolink; +using namespace isc::util::io; namespace isc { namespace testutils { @@ -204,7 +204,7 @@ SrvTestBase::ednsBadVers() { opcode.getCode(), QR_FLAG, 1, 0, 0, 1); EXPECT_FALSE(parse_message->getEDNS()); // EDNS isn't added at this point - isc::util::InputBuffer ib(response_obuffer->getData(), + InputBuffer ib(response_obuffer->getData(), response_obuffer->getLength()); isc::dns::Message parsed(isc::dns::Message::PARSE); parsed.fromWire(ib); diff --git a/src/lib/testutils/srv_test.h b/src/lib/testutils/srv_test.h index a848ffc965..85e4432494 100644 --- a/src/lib/testutils/srv_test.h +++ b/src/lib/testutils/srv_test.h @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/buffer.h> +#include <util/io/buffer.h> #include <dns/name.h> #include <dns/message.h> #include <dns/messagerenderer.h> @@ -99,9 +99,9 @@ protected: asiolink::IOSocket* io_sock; asiolink::IOMessage* io_message; const asiolink::IOEndpoint* endpoint; - isc::util::OutputBuffer request_obuffer; + isc::util::io::OutputBuffer request_obuffer; isc::dns::MessageRenderer request_renderer; - isc::util::OutputBufferPtr response_obuffer; + isc::util::io::OutputBufferPtr response_obuffer; std::vector<uint8_t> data; }; } // end of namespace testutils |