Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastian Schrader
Kea
Commits
f6aa7d59
Commit
f6aa7d59
authored
Apr 11, 2011
by
chenzhengzhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[trac749] refactor C++ utility library
parent
ea679d6d
Changes
182
Show whitespace changes
Inline
Side-by-side
Showing
182 changed files
with
367 additions
and
6038 deletions
+367
-6038
configure.ac
configure.ac
+2
-0
src/bin/auth/auth_srv.cc
src/bin/auth/auth_srv.cc
+3
-1
src/bin/auth/auth_srv.h
src/bin/auth/auth_srv.h
+1
-1
src/bin/auth/benchmarks/query_bench.cc
src/bin/auth/benchmarks/query_bench.cc
+2
-1
src/bin/auth/main.cc
src/bin/auth/main.cc
+3
-1
src/bin/auth/tests/auth_srv_unittest.cc
src/bin/auth/tests/auth_srv_unittest.cc
+1
-0
src/bin/host/host.cc
src/bin/host/host.cc
+3
-1
src/bin/resolver/main.cc
src/bin/resolver/main.cc
+1
-1
src/bin/resolver/resolver.cc
src/bin/resolver/resolver.cc
+3
-1
src/bin/resolver/resolver.h
src/bin/resolver/resolver.h
+1
-1
src/lib/Makefile.am
src/lib/Makefile.am
+2
-2
src/lib/asiolink/Makefile.am
src/lib/asiolink/Makefile.am
+0
-2
src/lib/asiolink/asiolink_utilities.h
src/lib/asiolink/asiolink_utilities.h
+0
-61
src/lib/asiolink/dns_answer.h
src/lib/asiolink/dns_answer.h
+1
-1
src/lib/asiolink/dns_lookup.h
src/lib/asiolink/dns_lookup.h
+2
-2
src/lib/asiolink/io_asio_socket.h
src/lib/asiolink/io_asio_socket.h
+3
-3
src/lib/asiolink/io_fetch.cc
src/lib/asiolink/io_fetch.cc
+9
-7
src/lib/asiolink/io_fetch.h
src/lib/asiolink/io_fetch.h
+2
-2
src/lib/asiolink/qid_gen.cc
src/lib/asiolink/qid_gen.cc
+0
-54
src/lib/asiolink/qid_gen.h
src/lib/asiolink/qid_gen.h
+0
-85
src/lib/asiolink/tcp_server.cc
src/lib/asiolink/tcp_server.cc
+3
-0
src/lib/asiolink/tcp_server.h
src/lib/asiolink/tcp_server.h
+1
-1
src/lib/asiolink/tcp_socket.h
src/lib/asiolink/tcp_socket.h
+7
-7
src/lib/asiolink/tests/Makefile.am
src/lib/asiolink/tests/Makefile.am
+2
-2
src/lib/asiolink/tests/asiolink_utilities_unittest.cc
src/lib/asiolink/tests/asiolink_utilities_unittest.cc
+0
-74
src/lib/asiolink/tests/dns_server_unittest.cc
src/lib/asiolink/tests/dns_server_unittest.cc
+2
-2
src/lib/asiolink/tests/io_fetch_unittest.cc
src/lib/asiolink/tests/io_fetch_unittest.cc
+4
-2
src/lib/asiolink/tests/qid_gen_unittest.cc
src/lib/asiolink/tests/qid_gen_unittest.cc
+0
-59
src/lib/asiolink/tests/tcp_socket_unittest.cc
src/lib/asiolink/tests/tcp_socket_unittest.cc
+3
-3
src/lib/asiolink/tests/udp_socket_unittest.cc
src/lib/asiolink/tests/udp_socket_unittest.cc
+3
-3
src/lib/asiolink/udp_server.cc
src/lib/asiolink/udp_server.cc
+2
-1
src/lib/asiolink/udp_socket.h
src/lib/asiolink/udp_socket.h
+2
-2
src/lib/bench/benchmark_util.cc
src/lib/bench/benchmark_util.cc
+2
-1
src/lib/bench/tests/Makefile.am
src/lib/bench/tests/Makefile.am
+1
-0
src/lib/bench/tests/loadquery_unittest.cc
src/lib/bench/tests/loadquery_unittest.cc
+2
-1
src/lib/cache/Makefile.am
src/lib/cache/Makefile.am
+1
-0
src/lib/cache/message_cache.h
src/lib/cache/message_cache.h
+2
-2
src/lib/cache/rrset_cache.h
src/lib/cache/rrset_cache.h
+3
-2
src/lib/cache/tests/Makefile.am
src/lib/cache/tests/Makefile.am
+2
-0
src/lib/cache/tests/cache_test_messagefromfile.h
src/lib/cache/tests/cache_test_messagefromfile.h
+2
-2
src/lib/cache/tests/cache_test_sectioncount.h
src/lib/cache/tests/cache_test_sectioncount.h
+1
-1
src/lib/cache/tests/message_cache_unittest.cc
src/lib/cache/tests/message_cache_unittest.cc
+2
-1
src/lib/cache/tests/message_entry_unittest.cc
src/lib/cache/tests/message_entry_unittest.cc
+1
-1
src/lib/datasrc/data_source.cc
src/lib/datasrc/data_source.cc
+5
-3
src/lib/datasrc/tests/datasrc_unittest.cc
src/lib/datasrc/tests/datasrc_unittest.cc
+3
-1
src/lib/dns/Makefile.am
src/lib/dns/Makefile.am
+5
-9
src/lib/dns/buffer.h
src/lib/dns/buffer.h
+0
-446
src/lib/dns/dnssectime.cc
src/lib/dns/dnssectime.cc
+0
-211
src/lib/dns/dnssectime.h
src/lib/dns/dnssectime.h
+0
-145
src/lib/dns/edns.cc
src/lib/dns/edns.cc
+1
-0
src/lib/dns/edns.h
src/lib/dns/edns.h
+5
-1
src/lib/dns/message.cc
src/lib/dns/message.cc
+2
-1
src/lib/dns/message.h
src/lib/dns/message.h
+6
-3
src/lib/dns/messagerenderer.cc
src/lib/dns/messagerenderer.cc
+3
-1
src/lib/dns/messagerenderer.h
src/lib/dns/messagerenderer.h
+5
-2
src/lib/dns/name.cc
src/lib/dns/name.cc
+2
-1
src/lib/dns/name.h
src/lib/dns/name.h
+6
-3
src/lib/dns/python/edns_python.cc
src/lib/dns/python/edns_python.cc
+1
-0
src/lib/dns/python/message_python.cc
src/lib/dns/python/message_python.cc
+1
-0
src/lib/dns/python/messagerenderer_python.cc
src/lib/dns/python/messagerenderer_python.cc
+1
-0
src/lib/dns/python/name_python.cc
src/lib/dns/python/name_python.cc
+1
-0
src/lib/dns/python/pydnspp.cc
src/lib/dns/python/pydnspp.cc
+1
-1
src/lib/dns/python/rdata_python.cc
src/lib/dns/python/rdata_python.cc
+1
-0
src/lib/dns/python/rrclass_python.cc
src/lib/dns/python/rrclass_python.cc
+1
-0
src/lib/dns/python/rrset_python.cc
src/lib/dns/python/rrset_python.cc
+1
-0
src/lib/dns/python/rrttl_python.cc
src/lib/dns/python/rrttl_python.cc
+1
-0
src/lib/dns/python/rrtype_python.cc
src/lib/dns/python/rrtype_python.cc
+1
-0
src/lib/dns/question.cc
src/lib/dns/question.cc
+2
-1
src/lib/dns/question.h
src/lib/dns/question.h
+7
-3
src/lib/dns/rdata.cc
src/lib/dns/rdata.cc
+2
-1
src/lib/dns/rdata.h
src/lib/dns/rdata.h
+7
-5
src/lib/dns/rdata/any_255/tsig_250.cc
src/lib/dns/rdata/any_255/tsig_250.cc
+4
-2
src/lib/dns/rdata/ch_3/a_1.cc
src/lib/dns/rdata/ch_3/a_1.cc
+2
-1
src/lib/dns/rdata/generic/cname_5.cc
src/lib/dns/rdata/generic/cname_5.cc
+2
-1
src/lib/dns/rdata/generic/dname_39.cc
src/lib/dns/rdata/generic/dname_39.cc
+2
-1
src/lib/dns/rdata/generic/dnskey_48.cc
src/lib/dns/rdata/generic/dnskey_48.cc
+3
-2
src/lib/dns/rdata/generic/ds_43.cc
src/lib/dns/rdata/generic/ds_43.cc
+4
-2
src/lib/dns/rdata/generic/mx_15.cc
src/lib/dns/rdata/generic/mx_15.cc
+2
-1
src/lib/dns/rdata/generic/ns_2.cc
src/lib/dns/rdata/generic/ns_2.cc
+2
-1
src/lib/dns/rdata/generic/nsec3_50.cc
src/lib/dns/rdata/generic/nsec3_50.cc
+5
-3
src/lib/dns/rdata/generic/nsec3param_51.cc
src/lib/dns/rdata/generic/nsec3param_51.cc
+3
-2
src/lib/dns/rdata/generic/nsec_47.cc
src/lib/dns/rdata/generic/nsec_47.cc
+3
-2
src/lib/dns/rdata/generic/opt_41.cc
src/lib/dns/rdata/generic/opt_41.cc
+2
-1
src/lib/dns/rdata/generic/ptr_12.cc
src/lib/dns/rdata/generic/ptr_12.cc
+2
-1
src/lib/dns/rdata/generic/rrsig_46.cc
src/lib/dns/rdata/generic/rrsig_46.cc
+4
-3
src/lib/dns/rdata/generic/soa_6.cc
src/lib/dns/rdata/generic/soa_6.cc
+2
-1
src/lib/dns/rdata/generic/txt_16.cc
src/lib/dns/rdata/generic/txt_16.cc
+2
-1
src/lib/dns/rdata/hs_4/a_1.cc
src/lib/dns/rdata/hs_4/a_1.cc
+2
-1
src/lib/dns/rdata/in_1/a_1.cc
src/lib/dns/rdata/in_1/a_1.cc
+2
-1
src/lib/dns/rdata/in_1/aaaa_28.cc
src/lib/dns/rdata/in_1/aaaa_28.cc
+2
-1
src/lib/dns/rdata/template.cc
src/lib/dns/rdata/template.cc
+2
-1
src/lib/dns/rrclass.cc
src/lib/dns/rrclass.cc
+2
-1
src/lib/dns/rrparamregistry.h
src/lib/dns/rrparamregistry.h
+2
-2
src/lib/dns/rrset.cc
src/lib/dns/rrset.cc
+2
-1
src/lib/dns/rrset.h
src/lib/dns/rrset.h
+6
-3
src/lib/dns/rrttl.cc
src/lib/dns/rrttl.cc
+2
-1
src/lib/dns/rrttl.h
src/lib/dns/rrttl.h
+7
-4
src/lib/dns/rrtype.cc
src/lib/dns/rrtype.cc
+2
-2
src/lib/dns/tests/Makefile.am
src/lib/dns/tests/Makefile.am
+2
-6
src/lib/dns/tests/base32hex_unittest.cc
src/lib/dns/tests/base32hex_unittest.cc
+0
-159
src/lib/dns/tests/base64_unittest.cc
src/lib/dns/tests/base64_unittest.cc
+0
-93
src/lib/dns/tests/buffer_unittest.cc
src/lib/dns/tests/buffer_unittest.cc
+0
-193
src/lib/dns/tests/dnssectime_unittest.cc
src/lib/dns/tests/dnssectime_unittest.cc
+0
-163
src/lib/dns/tests/edns_unittest.cc
src/lib/dns/tests/edns_unittest.cc
+2
-1
src/lib/dns/tests/hex_unittest.cc
src/lib/dns/tests/hex_unittest.cc
+0
-120
src/lib/dns/tests/message_unittest.cc
src/lib/dns/tests/message_unittest.cc
+2
-1
src/lib/dns/tests/messagerenderer_unittest.cc
src/lib/dns/tests/messagerenderer_unittest.cc
+2
-2
src/lib/dns/tests/name_unittest.cc
src/lib/dns/tests/name_unittest.cc
+2
-1
src/lib/dns/tests/question_unittest.cc
src/lib/dns/tests/question_unittest.cc
+2
-1
src/lib/dns/tests/rdata_cname_unittest.cc
src/lib/dns/tests/rdata_cname_unittest.cc
+2
-1
src/lib/dns/tests/rdata_dname_unittest.cc
src/lib/dns/tests/rdata_dname_unittest.cc
+2
-1
src/lib/dns/tests/rdata_dnskey_unittest.cc
src/lib/dns/tests/rdata_dnskey_unittest.cc
+2
-1
src/lib/dns/tests/rdata_ds_unittest.cc
src/lib/dns/tests/rdata_ds_unittest.cc
+2
-1
src/lib/dns/tests/rdata_in_a_unittest.cc
src/lib/dns/tests/rdata_in_a_unittest.cc
+2
-1
src/lib/dns/tests/rdata_in_aaaa_unittest.cc
src/lib/dns/tests/rdata_in_aaaa_unittest.cc
+2
-1
src/lib/dns/tests/rdata_mx_unittest.cc
src/lib/dns/tests/rdata_mx_unittest.cc
+2
-1
src/lib/dns/tests/rdata_ns_unittest.cc
src/lib/dns/tests/rdata_ns_unittest.cc
+2
-1
src/lib/dns/tests/rdata_nsec3_unittest.cc
src/lib/dns/tests/rdata_nsec3_unittest.cc
+3
-2
src/lib/dns/tests/rdata_nsec3param_unittest.cc
src/lib/dns/tests/rdata_nsec3param_unittest.cc
+4
-3
src/lib/dns/tests/rdata_nsec_unittest.cc
src/lib/dns/tests/rdata_nsec_unittest.cc
+2
-1
src/lib/dns/tests/rdata_opt_unittest.cc
src/lib/dns/tests/rdata_opt_unittest.cc
+2
-1
src/lib/dns/tests/rdata_ptr_unittest.cc
src/lib/dns/tests/rdata_ptr_unittest.cc
+2
-1
src/lib/dns/tests/rdata_rrsig_unittest.cc
src/lib/dns/tests/rdata_rrsig_unittest.cc
+2
-1
src/lib/dns/tests/rdata_soa_unittest.cc
src/lib/dns/tests/rdata_soa_unittest.cc
+2
-1
src/lib/dns/tests/rdata_tsig_unittest.cc
src/lib/dns/tests/rdata_tsig_unittest.cc
+2
-1
src/lib/dns/tests/rdata_txt_unittest.cc
src/lib/dns/tests/rdata_txt_unittest.cc
+2
-1
src/lib/dns/tests/rdata_unittest.cc
src/lib/dns/tests/rdata_unittest.cc
+2
-1
src/lib/dns/tests/rdata_unittest.h
src/lib/dns/tests/rdata_unittest.h
+3
-1
src/lib/dns/tests/rrclass_unittest.cc
src/lib/dns/tests/rrclass_unittest.cc
+2
-1
src/lib/dns/tests/rrparamregistry_unittest.cc
src/lib/dns/tests/rrparamregistry_unittest.cc
+1
-0
src/lib/dns/tests/rrset_unittest.cc
src/lib/dns/tests/rrset_unittest.cc
+2
-1
src/lib/dns/tests/rrttl_unittest.cc
src/lib/dns/tests/rrttl_unittest.cc
+2
-1
src/lib/dns/tests/rrtype_unittest.cc
src/lib/dns/tests/rrtype_unittest.cc
+2
-1
src/lib/dns/tests/sha1_unittest.cc
src/lib/dns/tests/sha1_unittest.cc
+0
-108
src/lib/dns/util/README
src/lib/dns/util/README
+0
-31
src/lib/dns/util/base16_from_binary.h
src/lib/dns/util/base16_from_binary.h
+0
-108
src/lib/dns/util/base32hex.h
src/lib/dns/util/base32hex.h
+0
-61
src/lib/dns/util/base32hex_from_binary.h
src/lib/dns/util/base32hex_from_binary.h
+0
-110
src/lib/dns/util/base64.h
src/lib/dns/util/base64.h
+0
-76
src/lib/dns/util/base_n.cc
src/lib/dns/util/base_n.cc
+0
-398
src/lib/dns/util/binary_from_base16.h
src/lib/dns/util/binary_from_base16.h
+0
-120
src/lib/dns/util/binary_from_base32hex.h
src/lib/dns/util/binary_from_base32hex.h
+0
-123
src/lib/dns/util/hex.h
src/lib/dns/util/hex.h
+0
-62
src/lib/dns/util/sha1.cc
src/lib/dns/util/sha1.cc
+0
-484
src/lib/dns/util/sha1.h
src/lib/dns/util/sha1.h
+0
-84
src/lib/log/Makefile.am
src/lib/log/Makefile.am
+2
-2
src/lib/log/compiler/Makefile.am
src/lib/log/compiler/Makefile.am
+2
-0
src/lib/log/compiler/message.cc
src/lib/log/compiler/message.cc
+4
-2
src/lib/log/filename.cc
src/lib/log/filename.cc
+0
-138
src/lib/log/filename.h
src/lib/log/filename.h
+0
-161
src/lib/log/logger.cc
src/lib/log/logger.cc
+2
-1
src/lib/log/logger_impl.cc
src/lib/log/logger_impl.cc
+2
-1
src/lib/log/logger_impl_log4cxx.cc
src/lib/log/logger_impl_log4cxx.cc
+2
-1
src/lib/log/message_reader.cc
src/lib/log/message_reader.cc
+1
-1
src/lib/log/strutil.cc
src/lib/log/strutil.cc
+0
-135
src/lib/log/strutil.h
src/lib/log/strutil.h
+0
-145
src/lib/log/tests/Makefile.am
src/lib/log/tests/Makefile.am
+3
-2
src/lib/log/tests/filename_unittest.cc
src/lib/log/tests/filename_unittest.cc
+0
-179
src/lib/log/tests/strutil_unittest.cc
src/lib/log/tests/strutil_unittest.cc
+0
-214
src/lib/nsas/Makefile.am
src/lib/nsas/Makefile.am
+1
-3
src/lib/nsas/hash_deleter.h
src/lib/nsas/hash_deleter.h
+3
-2
src/lib/nsas/hash_table.h
src/lib/nsas/hash_table.h
+2
-1
src/lib/nsas/locks.h
src/lib/nsas/locks.h
+0
-116
src/lib/nsas/lru_list.h
src/lib/nsas/lru_list.h
+0
-260
src/lib/nsas/nameserver_address_store.cc
src/lib/nsas/nameserver_address_store.cc
+5
-5
src/lib/nsas/nameserver_address_store.h
src/lib/nsas/nameserver_address_store.h
+6
-3
src/lib/nsas/nameserver_entry.h
src/lib/nsas/nameserver_entry.h
+2
-1
src/lib/nsas/nsas_entry.h
src/lib/nsas/nsas_entry.h
+5
-5
src/lib/nsas/random_number_generator.h
src/lib/nsas/random_number_generator.h
+0
-207
src/lib/nsas/tests/Makefile.am
src/lib/nsas/tests/Makefile.am
+2
-2
src/lib/nsas/tests/hash_deleter_unittest.cc
src/lib/nsas/tests/hash_deleter_unittest.cc
+2
-1
src/lib/nsas/tests/lru_list_unittest.cc
src/lib/nsas/tests/lru_list_unittest.cc
+0
-318
src/lib/nsas/tests/nsas_test.h
src/lib/nsas/tests/nsas_test.h
+2
-1
src/lib/nsas/tests/random_number_generator_unittest.cc
src/lib/nsas/tests/random_number_generator_unittest.cc
+0
-309
src/lib/nsas/zone_entry.cc
src/lib/nsas/zone_entry.cc
+2
-1
src/lib/nsas/zone_entry.h
src/lib/nsas/zone_entry.h
+6
-5
src/lib/resolve/recursive_query.cc
src/lib/resolve/recursive_query.cc
+1
-0
src/lib/resolve/recursive_query.h
src/lib/resolve/recursive_query.h
+2
-2
src/lib/resolve/tests/recursive_query_unittest.cc
src/lib/resolve/tests/recursive_query_unittest.cc
+3
-2
src/lib/resolve/tests/recursive_query_unittest_2.cc
src/lib/resolve/tests/recursive_query_unittest_2.cc
+4
-2
src/lib/testutils/srv_test.cc
src/lib/testutils/srv_test.cc
+2
-1
src/lib/testutils/srv_test.h
src/lib/testutils/srv_test.h
+3
-3
No files found.
configure.ac
View file @
f6aa7d59
...
...
@@ -677,6 +677,8 @@ AC_CONFIG_FILES([Makefile
src/lib/datasrc/Makefile
src/lib/datasrc/tests/Makefile
src/lib/xfr/Makefile
src/lib/util/Makefile
src/lib/util/tests/Makefile
src/lib/log/Makefile
src/lib/log/compiler/Makefile
src/lib/log/tests/Makefile
...
...
src/bin/auth/auth_srv.cc
View file @
f6aa7d59
...
...
@@ -31,7 +31,8 @@
#include <exceptions/exceptions.h>
#include <dns/buffer.h>
#include <util/buffer.h>
#include <dns/edns.h>
#include <dns/exceptions.h>
#include <dns/messagerenderer.h>
...
...
@@ -63,6 +64,7 @@ using namespace isc;
using
namespace
isc
::
cc
;
using
namespace
isc
::
datasrc
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
util
;
using
namespace
isc
::
auth
;
using
namespace
isc
::
dns
::
rdata
;
using
namespace
isc
::
data
;
...
...
src/bin/auth/auth_srv.h
View file @
f6aa7d59
...
...
@@ -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
::
dns
::
OutputBufferPtr
buffer
,
isc
::
util
::
OutputBufferPtr
buffer
,
asiolink
::
DNSServer
*
server
);
/// \brief Set verbose flag
...
...
src/bin/auth/benchmarks/query_bench.cc
View file @
f6aa7d59
...
...
@@ -22,7 +22,7 @@
#include <bench/benchmark.h>
#include <bench/benchmark_util.h>
#include <
dns
/buffer.h>
#include <
util
/buffer.h>
#include <dns/message.h>
#include <dns/name.h>
#include <dns/question.h>
...
...
@@ -41,6 +41,7 @@ using namespace isc;
using
namespace
isc
::
data
;
using
namespace
isc
::
auth
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
util
;
using
namespace
isc
::
xfr
;
using
namespace
isc
::
bench
;
using
namespace
asiolink
;
...
...
src/bin/auth/main.cc
View file @
f6aa7d59
...
...
@@ -25,7 +25,8 @@
#include <exceptions/exceptions.h>
#include <dns/buffer.h>
#include <util/buffer.h>
#include <dns/message.h>
#include <dns/messagerenderer.h>
...
...
@@ -49,6 +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
::
xfr
;
using
namespace
asiolink
;
...
...
src/bin/auth/tests/auth_srv_unittest.cc
View file @
f6aa7d59
...
...
@@ -41,6 +41,7 @@
using
namespace
std
;
using
namespace
isc
::
cc
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
util
;
using
namespace
isc
::
dns
::
rdata
;
using
namespace
isc
::
data
;
using
namespace
isc
::
xfr
;
...
...
src/bin/host/host.cc
View file @
f6aa7d59
...
...
@@ -24,7 +24,8 @@
#include <string>
#include <iostream>
#include <dns/buffer.h>
#include <util/buffer.h>
#include <dns/name.h>
#include <dns/message.h>
#include <dns/messagerenderer.h>
...
...
@@ -37,6 +38,7 @@
using
namespace
std
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
util
;
namespace
{
char
*
dns_type
=
NULL
;
// not set, so A, AAAA, MX
...
...
src/bin/resolver/main.cc
View file @
f6aa7d59
...
...
@@ -29,7 +29,7 @@
#include <exceptions/exceptions.h>
#include <
dns
/buffer.h>
#include <
util
/buffer.h>
#include <dns/rcode.h>
#include <dns/message.h>
#include <dns/messagerenderer.h>
...
...
src/bin/resolver/resolver.cc
View file @
f6aa7d59
...
...
@@ -29,9 +29,10 @@
#include <exceptions/exceptions.h>
#include <util/buffer.h>
#include <dns/opcode.h>
#include <dns/rcode.h>
#include <dns/buffer.h>
#include <dns/exceptions.h>
#include <dns/name.h>
#include <dns/question.h>
...
...
@@ -50,6 +51,7 @@
using
namespace
std
;
using
namespace
isc
;
using
namespace
isc
::
util
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
data
;
using
namespace
isc
::
config
;
...
...
src/bin/resolver/resolver.h
View file @
f6aa7d59
...
...
@@ -77,7 +77,7 @@ public:
void
processMessage
(
const
asiolink
::
IOMessage
&
io_message
,
isc
::
dns
::
MessagePtr
query_message
,
isc
::
dns
::
MessagePtr
answer_message
,
isc
::
dns
::
OutputBufferPtr
buffer
,
isc
::
util
::
OutputBufferPtr
buffer
,
asiolink
::
DNSServer
*
server
);
/// \brief Set and get the config session
...
...
src/lib/Makefile.am
View file @
f6aa7d59
SUBDIRS
=
exceptions
dns cc config python xfr bench log asiolink
\
nsas cache resolve testutils datasrc server_common
SUBDIRS
=
exceptions
util dns cc config python xfr bench log
\
asiolink
nsas cache resolve testutils datasrc server_common
src/lib/asiolink/Makefile.am
View file @
f6aa7d59
...
...
@@ -13,7 +13,6 @@ CLEANFILES = *.gcno *.gcda
# which would make the build fail with -Werror (our default setting).
lib_LTLIBRARIES
=
libasiolink.la
libasiolink_la_SOURCES
=
asiolink.h
libasiolink_la_SOURCES
+=
asiolink_utilities.h
libasiolink_la_SOURCES
+=
asiodef.cc asiodef.h
libasiolink_la_SOURCES
+=
dns_answer.h
libasiolink_la_SOURCES
+=
dns_lookup.h
...
...
@@ -27,7 +26,6 @@ libasiolink_la_SOURCES += io_endpoint.cc io_endpoint.h
libasiolink_la_SOURCES
+=
io_error.h
libasiolink_la_SOURCES
+=
io_fetch.cc io_fetch.h
libasiolink_la_SOURCES
+=
io_message.h
libasiolink_la_SOURCES
+=
qid_gen.cc qid_gen.h
libasiolink_la_SOURCES
+=
io_service.h io_service.cc
libasiolink_la_SOURCES
+=
io_socket.h io_socket.cc
libasiolink_la_SOURCES
+=
simple_callback.h
...
...
src/lib/asiolink/asiolink_utilities.h
deleted
100644 → 0
View file @
ea679d6d
// Copyright (C) 2011 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 __ASIOLINK_UTILITIES_H
#define __ASIOLINK_UTILITIES_H
#include <cstddef>
namespace
asiolink
{
/// \brief Read Unsigned 16-Bit Integer from Buffer
///
/// This is essentially a copy of the isc::dns::InputBuffer::readUint16. It
/// should really be moved into a separate library.
///
/// \param buffer Data buffer at least two bytes long of which the first two
/// bytes are assumed to represent a 16-bit integer in network-byte
/// order.
///
/// \return Value of 16-bit integer
inline
uint16_t
readUint16
(
const
void
*
buffer
)
{
const
uint8_t
*
byte_buffer
=
static_cast
<
const
uint8_t
*>
(
buffer
);
uint16_t
result
=
(
static_cast
<
uint16_t
>
(
byte_buffer
[
0
]))
<<
8
;
result
|=
static_cast
<
uint16_t
>
(
byte_buffer
[
1
]);
return
(
result
);
}
/// \brief Write Unisgned 16-Bit Integer to Buffer
///
/// This is essentially a copy of isc::dns::OutputBuffer::writeUint16. It
/// should really be moved into a separate library.
///
/// \param value 16-bit value to convert
/// \param buffer Data buffer at least two bytes long into which the 16-bit
/// value is written in network-byte order.
inline
void
writeUint16
(
uint16_t
value
,
void
*
buffer
)
{
uint8_t
*
byte_buffer
=
static_cast
<
uint8_t
*>
(
buffer
);
byte_buffer
[
0
]
=
static_cast
<
uint8_t
>
((
value
&
0xff00U
)
>>
8
);
byte_buffer
[
1
]
=
static_cast
<
uint8_t
>
(
value
&
0x00ffU
);
}
}
// namespace asiolink
#endif // __ASIOLINK_UTILITIES_H
src/lib/asiolink/dns_answer.h
View file @
f6aa7d59
...
...
@@ -66,7 +66,7 @@ public:
virtual
void
operator
()(
const
IOMessage
&
io_message
,
isc
::
dns
::
MessagePtr
query_message
,
isc
::
dns
::
MessagePtr
answer_message
,
isc
::
dns
::
OutputBufferPtr
buffer
)
const
=
0
;
isc
::
util
::
OutputBufferPtr
buffer
)
const
=
0
;
};
}
// namespace asiolink
...
...
src/lib/asiolink/dns_lookup.h
View file @
f6aa7d59
...
...
@@ -17,7 +17,7 @@
#include <asiolink/io_message.h>
#include <asiolink/dns_server.h>
#include <
dns
/buffer.h>
#include <
util
/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
::
dns
::
OutputBufferPtr
buffer
,
isc
::
util
::
OutputBufferPtr
buffer
,
DNSServer
*
server
)
const
{
(
*
self_
)(
io_message
,
message
,
answer_message
,
buffer
,
server
);
...
...
src/lib/asiolink/io_asio_socket.h
View file @
f6aa7d59
...
...
@@ -26,7 +26,7 @@
#include <exceptions/exceptions.h>
#include <coroutine.h>
#include <
dns
/buffer.h>
#include <
util
/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
::
dns
::
OutputBufferPtr
&
outbuff
)
=
0
;
isc
::
util
::
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
::
dns
::
OutputBufferPtr
&
outbuff
)
isc
::
util
::
OutputBufferPtr
&
outbuff
)
{
return
(
true
);
}
...
...
src/lib/asiolink/io_fetch.cc
View file @
f6aa7d59
...
...
@@ -22,13 +22,16 @@
#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 <asiolink/qid_gen.h>
#include <util/qid_gen.h>
#include <util/qid_gen.h>
#include <asio.hpp>
#include <asio/deadline_timer.hpp>
...
...
@@ -43,12 +46,12 @@
#include <asiolink/tcp_socket.h>
#include <asiolink/udp_endpoint.h>
#include <asiolink/udp_socket.h>
#include <asiolink/qid_gen.h>
#include <stdint.h>
using
namespace
asio
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
util
;
using
namespace
isc
::
log
;
using
namespace
std
;
...
...
@@ -76,8 +79,8 @@ struct IOFetchData {
boost
::
scoped_ptr
<
IOEndpoint
>
remote_snd
;
///< Where the fetch is sent
boost
::
scoped_ptr
<
IOEndpoint
>
remote_rcv
;
///< Where the response came from
isc
::
dns
::
Question
question
;
///< Question to be asked
isc
::
dns
::
OutputBufferPtr
msgbuf
;
///< Wire buffer for question
isc
::
dns
::
OutputBufferPtr
received
;
///< Received data put here
OutputBufferPtr
msgbuf
;
///< Wire buffer for question
OutputBufferPtr
received
;
///< Received data put here
IOFetch
::
Callback
*
callback
;
///< Called on I/O Completion
asio
::
deadline_timer
timer
;
///< Timer to measure timeouts
IOFetch
::
Protocol
protocol
;
///< Protocol being used
...
...
@@ -117,8 +120,7 @@ struct IOFetchData {
/// TODO: May need to alter constructor (see comment 4 in Trac ticket #554)
IOFetchData
(
IOFetch
::
Protocol
proto
,
IOService
&
service
,
const
isc
::
dns
::
Question
&
query
,
const
IOAddress
&
address
,
uint16_t
port
,
isc
::
dns
::
OutputBufferPtr
&
buff
,
IOFetch
::
Callback
*
cb
,
int
wait
)
uint16_t
port
,
OutputBufferPtr
&
buff
,
IOFetch
::
Callback
*
cb
,
int
wait
)
:
socket
((
proto
==
IOFetch
::
UDP
)
?
static_cast
<
IOAsioSocket
<
IOFetch
>*>
(
...
...
@@ -135,7 +137,7 @@ struct IOFetchData {
static_cast
<
IOEndpoint
*>
(
new
TCPEndpoint
(
address
,
port
))
),
question
(
query
),
msgbuf
(
new
isc
::
dns
::
OutputBuffer
(
512
)),
msgbuf
(
new
OutputBuffer
(
512
)),
received
(
buff
),
callback
(
cb
),
...
...
src/lib/asiolink/io_fetch.h
View file @
f6aa7d59
...
...
@@ -25,7 +25,7 @@
#include <asio/error_code.hpp>
#include <
dns
/buffer.h>
#include <
util
/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
::
dns
::
OutputBufferPtr
&
buff
,
Callback
*
cb
,
uint16_t
port
,
isc
::
util
::
OutputBufferPtr
&
buff
,
Callback
*
cb
,
int
wait
=
-
1
);
/// \brief Return Current Protocol
...
...
src/lib/asiolink/qid_gen.cc
deleted
100644 → 0
View file @
ea679d6d
// Copyright (C) 2011 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.
// qid_gen defines a generator for query id's
//
// We probably want to merge this with the weighted random in the nsas
// (and other parts where we need randomness, perhaps another thing
// for a general libutil?)
#include <asiolink/qid_gen.h>
#include <sys/time.h>
namespace
{
asiolink
::
QidGenerator
qid_generator_instance
;
}
namespace
asiolink
{
QidGenerator
&
QidGenerator
::
getInstance
()
{
return
(
qid_generator_instance
);
}
QidGenerator
::
QidGenerator
()
:
dist_
(
0
,
65535
),
vgen_
(
generator_
,
dist_
)
{
seed
();
}
void
QidGenerator
::
seed
()
{
struct
timeval
tv
;
gettimeofday
(
&
tv
,
0
);
generator_
.
seed
((
tv
.
tv_sec
*
1000000
)
+
tv
.
tv_usec
);
}
isc
::
dns
::
qid_t
QidGenerator
::
generateQid
()
{
return
(
vgen_
());
}
}
// namespace asiolink
src/lib/asiolink/qid_gen.h
deleted
100644 → 0
View file @
ea679d6d
// Copyright (C) 2011 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.
// qid_gen defines a generator for query id's
//
// We probably want to merge this with the weighted random in the nsas
// (and other parts where we need randomness, perhaps another thing
// for a general libutil?)
#ifndef __QID_GEN_H
#define __QID_GEN_H
#include <dns/message.h>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
namespace
asiolink
{
/// This class generates Qids for outgoing queries
///
/// It is implemented as a singleton; the public way to access it
/// is to call getInstance()->generateQid().
///
/// It automatically seeds it with the current time when it is first
/// used.
class
QidGenerator
{
public:
/// \brief Returns the singleton instance of the QidGenerator
///
/// Returns a reference to the singleton instance of the generator
static
QidGenerator
&
getInstance
();
/// \brief Default constructor
///
/// It is recommended that getInstance is used rather than creating
/// separate instances of this class.
///
/// The constructor automatically seeds the generator with the
/// current time.
QidGenerator
();
/// Generate a Qid
///
/// \return A random Qid
isc
::
dns
::
qid_t
generateQid
();
/// \brief Seeds the QidGenerator (based on the current time)
///
/// This is automatically called by the constructor
void
seed
();
private:
// "Mersenne Twister: A 623-dimensionally equidistributed
// uniform pseudo-random number generator", Makoto Matsumoto and
// Takuji Nishimura, ACM Transactions on Modeling and Computer
// Simulation: Special Issue on Uniform Random Number Generation,
// Vol. 8, No. 1, January 1998, pp. 3-30.
//
// mt19937 is an implementation of one of the pseudo random
// generators described in this paper.
boost
::
mt19937
generator_
;
// For qid's we want a uniform distribution
boost
::
uniform_int
<>
dist_
;
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
uniform_int
<>
>
vgen_
;
};
}
// namespace asiolink
#endif // __QID_GEN_H
src/lib/asiolink/tcp_server.cc
View file @
f6aa7d59
...
...
@@ -23,6 +23,8 @@
#include <log/dummylog.h>
#include <util/buffer.h>
#include <asio.hpp>
#include <asiolink/dummy_io_cb.h>
#include <asiolink/tcp_endpoint.h>
...
...
@@ -36,6 +38,7 @@ using asio::ip::tcp;
using
namespace
std
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
util
;
namespace
asiolink
{
...
...
src/lib/asiolink/tcp_server.h
View file @
f6aa7d59
...
...
@@ -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
::
dns
::
OutputBuffer
>
respbuf_
;
boost
::
shared_ptr
<
isc
::
util
::
OutputBuffer
>
respbuf_
;
// \c IOMessage and \c Message objects to be passed to the
// DNS lookup and answer providers
...
...
src/lib/asiolink/tcp_socket.h
View file @
f6aa7d59
...
...
@@ -33,9 +33,9 @@
#include <config.h>
#include <dns/buffer.h>
#include <util/buffer.h>
#include <util/asiolink_utilities.h>
#include <asiolink/asiolink_utilities.h>
#include <asiolink/io_asio_socket.h>
#include <asiolink/io_endpoint.h>
#include <asiolink/io_service.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
::
dns
::
OutputBufferPtr
&
outbuff
);
isc
::
util
::
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
::
dns
::
OutputBufferPtr
send_buffer_
;
///< Send buffer
isc
::
util
::
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
::
dns
::
OutputBuffer
(
length
+
2
));
send_buffer_
.
reset
(
new
isc
::
util
::
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
::
dns
::
OutputBufferPtr
&
outbuff
)
isc
::
util
::
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
=
readUint16
(
data
);
expected
=
isc
::
util
::
readUint16
(
data
);
// We have two bytes less of data to process. Point to the start of the