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
8fc7cdd2
Commit
8fc7cdd2
authored
Apr 08, 2011
by
Ocean Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[trac751] Move dns related code to asiodns lib
parent
8fdbc3e4
Changes
55
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
183 additions
and
100 deletions
+183
-100
configure.ac
configure.ac
+1
-0
src/lib/asiodns/.deps/libasiodns_la-dns_service.Plo
src/lib/asiodns/.deps/libasiodns_la-dns_service.Plo
+0
-1
src/lib/asiodns/.deps/libasiodns_la-dns_service.Tpo
src/lib/asiodns/.deps/libasiodns_la-dns_service.Tpo
+0
-0
src/lib/asiodns/Makefile.am
src/lib/asiodns/Makefile.am
+1
-0
src/lib/asiodns/dns_answer.h
src/lib/asiodns/dns_answer.h
+7
-3
src/lib/asiodns/dns_lookup.h
src/lib/asiodns/dns_lookup.h
+6
-4
src/lib/asiodns/dns_server.h
src/lib/asiodns/dns_server.h
+5
-3
src/lib/asiodns/dns_service.cc
src/lib/asiodns/dns_service.cc
+9
-8
src/lib/asiodns/dns_service.h
src/lib/asiodns/dns_service.h
+11
-9
src/lib/asiodns/io_fetch.cc
src/lib/asiodns/io_fetch.cc
+8
-4
src/lib/asiodns/io_fetch.h
src/lib/asiodns/io_fetch.h
+9
-6
src/lib/asiodns/tcp_server.cc
src/lib/asiodns/tcp_server.cc
+6
-4
src/lib/asiodns/tcp_server.h
src/lib/asiodns/tcp_server.h
+12
-8
src/lib/asiodns/tests/Makefile.am
src/lib/asiodns/tests/Makefile.am
+4
-0
src/lib/asiodns/tests/dns_server_unittest.cc
src/lib/asiodns/tests/dns_server_unittest.cc
+6
-5
src/lib/asiodns/tests/io_fetch_unittest.cc
src/lib/asiodns/tests/io_fetch_unittest.cc
+6
-3
src/lib/asiodns/tests/io_service_unittest.cc
src/lib/asiodns/tests/io_service_unittest.cc
+3
-1
src/lib/asiodns/udp_server.cc
src/lib/asiodns/udp_server.cc
+6
-3
src/lib/asiodns/udp_server.h
src/lib/asiodns/udp_server.h
+8
-6
src/lib/asiolink/Makefile.am
src/lib/asiolink/Makefile.am
+0
-1
src/lib/asiolink/asiodef.cc
src/lib/asiolink/asiodef.cc
+2
-0
src/lib/asiolink/asiodef.h
src/lib/asiolink/asiodef.h
+2
-0
src/lib/asiolink/asiolink_utilities.h
src/lib/asiolink/asiolink_utilities.h
+2
-0
src/lib/asiolink/dummy_io_cb.h
src/lib/asiolink/dummy_io_cb.h
+2
-0
src/lib/asiolink/interval_timer.cc
src/lib/asiolink/interval_timer.cc
+3
-1
src/lib/asiolink/interval_timer.h
src/lib/asiolink/interval_timer.h
+3
-1
src/lib/asiolink/io_address.cc
src/lib/asiolink/io_address.cc
+3
-1
src/lib/asiolink/io_address.h
src/lib/asiolink/io_address.h
+3
-1
src/lib/asiolink/io_asio_socket.h
src/lib/asiolink/io_asio_socket.h
+2
-1
src/lib/asiolink/io_endpoint.cc
src/lib/asiolink/io_endpoint.cc
+3
-1
src/lib/asiolink/io_endpoint.h
src/lib/asiolink/io_endpoint.h
+3
-1
src/lib/asiolink/io_error.h
src/lib/asiolink/io_error.h
+3
-1
src/lib/asiolink/io_message.h
src/lib/asiolink/io_message.h
+3
-1
src/lib/asiolink/io_service.cc
src/lib/asiolink/io_service.cc
+3
-1
src/lib/asiolink/io_service.h
src/lib/asiolink/io_service.h
+3
-1
src/lib/asiolink/io_socket.cc
src/lib/asiolink/io_socket.cc
+3
-3
src/lib/asiolink/io_socket.h
src/lib/asiolink/io_socket.h
+2
-0
src/lib/asiolink/qid_gen.cc
src/lib/asiolink/qid_gen.cc
+3
-1
src/lib/asiolink/qid_gen.h
src/lib/asiolink/qid_gen.h
+2
-0
src/lib/asiolink/simple_callback.h
src/lib/asiolink/simple_callback.h
+3
-1
src/lib/asiolink/tcp_endpoint.h
src/lib/asiolink/tcp_endpoint.h
+3
-1
src/lib/asiolink/tcp_socket.h
src/lib/asiolink/tcp_socket.h
+2
-0
src/lib/asiolink/tests/Makefile.am
src/lib/asiolink/tests/Makefile.am
+0
-1
src/lib/asiolink/tests/asiolink_utilities_unittest.cc
src/lib/asiolink/tests/asiolink_utilities_unittest.cc
+1
-1
src/lib/asiolink/tests/interval_timer_unittest.cc
src/lib/asiolink/tests/interval_timer_unittest.cc
+1
-1
src/lib/asiolink/tests/io_address_unittest.cc
src/lib/asiolink/tests/io_address_unittest.cc
+1
-1
src/lib/asiolink/tests/io_endpoint_unittest.cc
src/lib/asiolink/tests/io_endpoint_unittest.cc
+1
-1
src/lib/asiolink/tests/io_socket_unittest.cc
src/lib/asiolink/tests/io_socket_unittest.cc
+1
-1
src/lib/asiolink/tests/qid_gen_unittest.cc
src/lib/asiolink/tests/qid_gen_unittest.cc
+3
-3
src/lib/asiolink/tests/tcp_endpoint_unittest.cc
src/lib/asiolink/tests/tcp_endpoint_unittest.cc
+1
-1
src/lib/asiolink/tests/tcp_socket_unittest.cc
src/lib/asiolink/tests/tcp_socket_unittest.cc
+1
-1
src/lib/asiolink/tests/udp_endpoint_unittest.cc
src/lib/asiolink/tests/udp_endpoint_unittest.cc
+1
-1
src/lib/asiolink/tests/udp_socket_unittest.cc
src/lib/asiolink/tests/udp_socket_unittest.cc
+1
-1
src/lib/asiolink/udp_endpoint.h
src/lib/asiolink/udp_endpoint.h
+3
-1
src/lib/asiolink/udp_socket.h
src/lib/asiolink/udp_socket.h
+2
-0
No files found.
configure.ac
View file @
8fc7cdd2
...
...
@@ -643,6 +643,7 @@ AC_CONFIG_FILES([Makefile
src/lib/asiolink/Makefile
src/lib/asiolink/tests/Makefile
src/lib/asiodns/Makefile
src/lib/asiodns/tests/Makefile
src/lib/bench/Makefile
src/lib/bench/example/Makefile
src/lib/bench/tests/Makefile
...
...
src/lib/asiodns/.deps/libasiodns_la-dns_service.Plo
deleted
100644 → 0
View file @
8fdbc3e4
# dummy
src/lib/asiodns/.deps/libasiodns_la-dns_service.Tpo
deleted
100644 → 0
View file @
8fdbc3e4
src/lib/asiodns/Makefile.am
View file @
8fc7cdd2
...
...
@@ -19,6 +19,7 @@ libasiodns_la_SOURCES += dns_server.h
libasiodns_la_SOURCES
+=
dns_service.cc dns_service.h
libasiodns_la_SOURCES
+=
tcp_server.cc tcp_server.h
libasiodns_la_SOURCES
+=
udp_server.cc udp_server.h
libasiodns_la_SOURCES
+=
io_fetch.cc io_fetch.h
# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
# B10_CXXFLAGS)
...
...
src/lib/asiodns/dns_answer.h
View file @
8fc7cdd2
...
...
@@ -16,8 +16,11 @@
#define __ASIOLINK_DNS_ANSWER_H 1
#include <asiolink/io_message.h>
#include <dns/buffer.h>
#include <dns/message.h>
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
/// \brief The \c DNSAnswer class is an abstract base class for a DNS
/// Answer provider function.
...
...
@@ -63,11 +66,12 @@ public:
/// \param answer_message The DNS MessagePtr of the answer we are
/// building
/// \param buffer Intermediate data results are put here
virtual
void
operator
()(
const
IOMessage
&
io_message
,
virtual
void
operator
()(
const
asiolink
::
IOMessage
&
io_message
,
isc
::
dns
::
MessagePtr
query_message
,
isc
::
dns
::
MessagePtr
answer_message
,
isc
::
dns
::
OutputBufferPtr
buffer
)
const
=
0
;
};
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
#endif // __ASIOLINK_DNS_ANSWER_H
src/lib/asiodns/dns_lookup.h
View file @
8fc7cdd2
...
...
@@ -16,11 +16,12 @@
#define __ASIOLINK_DNS_LOOKUP_H 1
#include <asiolink/io_message.h>
#include <asio
link
/dns_server.h>
#include <asio
dns
/dns_server.h>
#include <dns/buffer.h>
#include <dns/message.h>
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
/// \brief The \c DNSLookup class is an abstract base class for a DNS
/// Lookup provider function.
...
...
@@ -67,7 +68,7 @@ public:
/// this MessagePtr
/// \param buffer The final answer is put here
/// \param server DNSServer object to use
virtual
void
operator
()(
const
IOMessage
&
io_message
,
virtual
void
operator
()(
const
asiolink
::
IOMessage
&
io_message
,
isc
::
dns
::
MessagePtr
message
,
isc
::
dns
::
MessagePtr
answer_message
,
isc
::
dns
::
OutputBufferPtr
buffer
,
...
...
@@ -79,5 +80,6 @@ private:
DNSLookup
*
self_
;
};
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
#endif // __ASIOLINK_DNS_LOOKUP_H
src/lib/asiodns/dns_server.h
View file @
8fc7cdd2
...
...
@@ -17,7 +17,8 @@
#include <asiolink/io_message.h>
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
/// \brief The \c DNSServer class is a wrapper (and base class) for
/// classes which provide DNS server functionality.
...
...
@@ -34,7 +35,7 @@ namespace asiolink {
/// instantiated through a base class) are sometimes passed by
/// reference (as this superclass); calls to methods in the base
/// class are then rerouted via this pointer to methods in the derived
/// class. This allows code from outside asio
link
, with no specific
/// class. This allows code from outside asio
dns
, with no specific
/// knowledge of \c TCPServer or \c UDPServer, to access their methods.
///
/// This class is both assignable and copy-constructable. Its subclasses
...
...
@@ -151,5 +152,6 @@ private:
};
}
// asiolink
}
// namespace asiodns
}
// namespace isc
#endif // __ASIOLINK_DNS_SERVER_H
src/lib/asiodns/dns_service.cc
View file @
8fc7cdd2
...
...
@@ -23,11 +23,11 @@
#include <log/dummylog.h>
#include <asio.hpp>
#include <
asiolink/
dns_service.h>
#include <dns_service.h>
#include <asiolink/io_service.h>
#include <asiolink/io_service.h>
#include <
asiolink/
tcp_server.h>
#include <
asiolink/
udp_server.h>
#include <tcp_server.h>
#include <udp_server.h>
#include <log/dummylog.h>
...
...
@@ -36,9 +36,11 @@
using
isc
::
log
::
dlog
;
namespace
asiolink
{
using
namespace
isc
::
asiolink
;
namespace
isc
{
namespace
asiodns
{
class
SimpleCallback
;
class
DNSLookup
;
class
DNSAnswer
;
...
...
@@ -195,6 +197,5 @@ DNSService::clearServers() {
impl_
->
servers_
.
clear
();
}
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
src/lib/asiodns/dns_service.h
View file @
8fc7cdd2
...
...
@@ -18,10 +18,11 @@
#include <resolve/resolver_interface.h>
#include <asiolink/io_service.h>
#include <asiolink/simple_callback.h>
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
class
SimpleCallback
;
class
DNSLookup
;
class
DNSAnswer
;
class
DNSServiceImpl
;
...
...
@@ -54,8 +55,8 @@ public:
/// \param checkin Provider for cc-channel events (see \c SimpleCallback)
/// \param lookup The lookup provider (see \c DNSLookup)
/// \param answer The answer provider (see \c DNSAnswer)
DNSService
(
IOService
&
io_service
,
const
char
&
port
,
const
char
&
address
,
SimpleCallback
*
checkin
,
DNSService
(
asiolink
::
IOService
&
io_service
,
const
char
&
port
,
const
char
&
address
,
isc
::
asiolink
::
SimpleCallback
*
checkin
,
DNSLookup
*
lookup
,
DNSAnswer
*
answer
);
/// \brief The constructor with a specific port on which the services
/// listen on.
...
...
@@ -71,14 +72,14 @@ public:
/// \param checkin Provider for cc-channel events (see \c SimpleCallback)
/// \param lookup The lookup provider (see \c DNSLookup)
/// \param answer The answer provider (see \c DNSAnswer)
DNSService
(
IOService
&
io_service
,
const
char
&
port
,
DNSService
(
asiolink
::
IOService
&
io_service
,
const
char
&
port
,
const
bool
use_ipv4
,
const
bool
use_ipv6
,
SimpleCallback
*
checkin
,
DNSLookup
*
lookup
,
isc
::
asiolink
::
SimpleCallback
*
checkin
,
DNSLookup
*
lookup
,
DNSAnswer
*
answer
);
/// \brief The constructor without any servers.
///
/// Use addServer() to add some servers.
DNSService
(
IOService
&
io_service
,
SimpleCallback
*
checkin
,
DNSService
(
asiolink
::
IOService
&
io_service
,
isc
::
asiolink
::
SimpleCallback
*
checkin
,
DNSLookup
*
lookup
,
DNSAnswer
*
answer
);
/// \brief The destructor.
~
DNSService
();
...
...
@@ -105,8 +106,9 @@ public:
private:
DNSServiceImpl
*
impl_
;
IOService
&
io_service_
;
asiolink
::
IOService
&
io_service_
;
};
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
#endif // __ASIOLINK_DNS_SERVICE_H
src/lib/asio
link
/io_fetch.cc
→
src/lib/asio
dns
/io_fetch.cc
View file @
8fc7cdd2
...
...
@@ -37,7 +37,6 @@
#include <asiolink/io_address.h>
#include <asiolink/io_asio_socket.h>
#include <asiolink/io_endpoint.h>
#include <asiolink/io_fetch.h>
#include <asiolink/io_service.h>
#include <asiolink/tcp_endpoint.h>
#include <asiolink/tcp_socket.h>
...
...
@@ -45,18 +44,22 @@
#include <asiolink/udp_socket.h>
#include <asiolink/qid_gen.h>
#include "io_fetch.h"
#include <stdint.h>
using
namespace
asio
;
using
namespace
isc
::
asiolink
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
log
;
using
namespace
std
;
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
/// Use the ASIO logger
isc
::
log
::
Logger
logger
(
"asio
link
"
);
isc
::
log
::
Logger
logger
(
"asio
dns
"
);
/// \brief IOFetch Data
///
...
...
@@ -376,5 +379,6 @@ void IOFetch::logIOFailure(asio::error_code ec) {
static_cast
<
int
>
(
data_
->
remote_snd
->
getPort
()));
}
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
src/lib/asio
link
/io_fetch.h
→
src/lib/asio
dns
/io_fetch.h
View file @
8fc7cdd2
...
...
@@ -24,16 +24,17 @@
#include <coroutine.h>
#include <asio/error_code.hpp>
#include <asiolink/io_service.h>
#include <asiolink/io_address.h>
#include <dns/buffer.h>
#include <dns/question.h>
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
// Forward declarations
class
IOAddress
;
class
IOFetchData
;
class
IOService
;
/// \brief Upstream Fetch Processing
///
...
...
@@ -132,8 +133,9 @@ public:
/// (default = 53)
/// \param wait Timeout for the fetch (in ms). The default value of
/// -1 indicates no timeout.
IOFetch
(
Protocol
protocol
,
IOService
&
service
,
const
isc
::
dns
::
Question
&
question
,
const
IOAddress
&
address
,
IOFetch
(
Protocol
protocol
,
isc
::
asiolink
::
IOService
&
service
,
const
isc
::
dns
::
Question
&
question
,
const
isc
::
asiolink
::
IOAddress
&
address
,
uint16_t
port
,
isc
::
dns
::
OutputBufferPtr
&
buff
,
Callback
*
cb
,
int
wait
=
-
1
);
...
...
@@ -174,6 +176,7 @@ private:
};
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
#endif // __IO_FETCH_H
src/lib/asiodns/tcp_server.cc
View file @
8fc7cdd2
...
...
@@ -27,7 +27,7 @@
#include <asiolink/dummy_io_cb.h>
#include <asiolink/tcp_endpoint.h>
#include <asiolink/tcp_socket.h>
#include <
asiolink/
tcp_server.h>
#include <tcp_server.h>
using
namespace
asio
;
...
...
@@ -36,8 +36,10 @@ using asio::ip::tcp;
using
namespace
std
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
asiolink
;
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
/// The following functions implement the \c TCPServer class.
///
...
...
@@ -235,5 +237,5 @@ TCPServer::resume(const bool done) {
io_
.
post
(
*
this
);
}
}
// namespace asio
link
}
// namespace asio
dns
}
// namespace isc
src/lib/asiodns/tcp_server.h
View file @
8fc7cdd2
...
...
@@ -24,9 +24,12 @@
#include <asiolink/asiolink.h>
#include <coroutine.h>
#include "dns_server.h"
#include "dns_lookup.h"
#include "dns_answer.h"
namespace
asio
link
{
namespace
isc
{
namespace
asio
dns
{
/// \brief A TCP-specific \c DNSServer object.
///
...
...
@@ -36,7 +39,7 @@ class TCPServer : public virtual DNSServer, public virtual coroutine {
public:
explicit
TCPServer
(
asio
::
io_service
&
io_service
,
const
asio
::
ip
::
address
&
addr
,
const
uint16_t
port
,
const
SimpleCallback
*
checkin
=
NULL
,
const
isc
::
asiolink
::
SimpleCallback
*
checkin
=
NULL
,
const
DNSLookup
*
lookup
=
NULL
,
const
DNSAnswer
*
answer
=
NULL
);
...
...
@@ -95,7 +98,7 @@ private:
// \c IOMessage and \c Message objects to be passed to the
// DNS lookup and answer providers
boost
::
shared_ptr
<
asiolink
::
IOMessage
>
io_message_
;
boost
::
shared_ptr
<
isc
::
asiolink
::
IOMessage
>
io_message_
;
isc
::
dns
::
MessagePtr
query_message_
;
isc
::
dns
::
MessagePtr
answer_message_
;
...
...
@@ -108,13 +111,14 @@ private:
bool
done_
;
// Callback functions provided by the caller
const
SimpleCallback
*
checkin_callback_
;
const
isc
::
asiolink
::
SimpleCallback
*
checkin_callback_
;
const
DNSLookup
*
lookup_callback_
;
const
DNSAnswer
*
answer_callback_
;
boost
::
shared_ptr
<
IOEndpoint
>
peer_
;
boost
::
shared_ptr
<
IOSocket
>
iosock_
;
boost
::
shared_ptr
<
isc
::
asiolink
::
IOEndpoint
>
peer_
;
boost
::
shared_ptr
<
isc
::
asiolink
::
IOSocket
>
iosock_
;
};
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
#endif // __TCP_SERVER_H
src/lib/asiodns/tests/Makefile.am
View file @
8fc7cdd2
...
...
@@ -16,8 +16,11 @@ TESTS =
if
HAVE_GTEST
TESTS
+=
run_unittests
run_unittests_SOURCES
=
run_unittests.cc
run_unittests_SOURCES
+=
$(top_srcdir)
/src/lib/dns/tests/unittest_util.h
run_unittests_SOURCES
+=
$(top_srcdir)
/src/lib/dns/tests/unittest_util.cc
run_unittests_SOURCES
+=
io_service_unittest.cc
run_unittests_SOURCES
+=
dns_server_unittest.cc
run_unittests_SOURCES
+=
io_fetch_unittest.cc
run_unittests_CPPFLAGS
=
$(AM_CPPFLAGS)
$(GTEST_INCLUDES)
...
...
@@ -27,6 +30,7 @@ run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
run_unittests_LDADD
+=
$(top_builddir)
/src/lib/asiolink/libasiolink.la
run_unittests_LDADD
+=
$(top_builddir)
/src/lib/log/liblog.la
run_unittests_LDADD
+=
$(top_builddir)
/src/lib/exceptions/libexceptions.la
run_unittests_LDADD
+=
$(top_builddir)
/src/lib/asiodns/libasiodns.la
run_unittests_LDFLAGS
=
$(AM_LDFLAGS)
$(GTEST_LDFLAGS)
...
...
src/lib/asiodns/tests/dns_server_unittest.cc
View file @
8fc7cdd2
...
...
@@ -18,10 +18,10 @@
#include <asio.hpp>
#include <asiolink/io_endpoint.h>
#include <asiolink/io_error.h>
#include <asio
link
/udp_server.h>
#include <asio
link
/tcp_server.h>
#include <asio
link
/dns_answer.h>
#include <asio
link
/dns_lookup.h>
#include <asio
dns
/udp_server.h>
#include <asio
dns
/tcp_server.h>
#include <asio
dns
/dns_answer.h>
#include <asio
dns
/dns_lookup.h>
#include <string>
#include <csignal>
#include <unistd.h> //for alarm
...
...
@@ -65,7 +65,8 @@
/// involved so the message sending between client and server is plain text
/// And the valid checker, question lookup and answer composition are dummy.
using
namespace
asiolink
;
using
namespace
isc
::
asiolink
;
using
namespace
isc
::
asiodns
;
using
namespace
asio
;
namespace
{
static
const
std
::
string
server_ip
=
"127.0.0.1"
;
...
...
src/lib/asio
link
/tests/io_fetch_unittest.cc
→
src/lib/asio
dns
/tests/io_fetch_unittest.cc
View file @
8fc7cdd2
...
...
@@ -37,15 +37,17 @@
#include <asiolink/asiolink_utilities.h>
#include <asiolink/io_address.h>
#include <asiolink/io_endpoint.h>
#include <asiolink/io_fetch.h>
#include <asiolink/io_service.h>
#include <asiodns/io_fetch.h>
using
namespace
asio
;
using
namespace
isc
::
dns
;
using
namespace
asio
::
ip
;
using
namespace
std
;
using
namespace
isc
::
asiolink
;
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
const
asio
::
ip
::
address
TEST_HOST
(
asio
::
ip
::
address
::
from_string
(
"127.0.0.1"
));
const
uint16_t
TEST_PORT
(
5301
);
...
...
@@ -720,4 +722,5 @@ TEST_F(IOFetchTest, TcpSendReceive8192ShortSend) {
}
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
src/lib/asiodns/tests/io_service_unittest.cc
View file @
8fc7cdd2
...
...
@@ -17,8 +17,10 @@
#include <asio.hpp>
#include <asiolink/asiolink.h>
#include <asiodns/asiodns.h>
using
namespace
asiolink
;
using
namespace
isc
::
asiolink
;
using
namespace
isc
::
asiodns
;
const
char
*
const
TEST_SERVER_PORT
=
"53535"
;
const
char
*
const
TEST_CLIENT_PORT
=
"53536"
;
...
...
src/lib/asiodns/udp_server.cc
View file @
8fc7cdd2
...
...
@@ -27,8 +27,8 @@
#include <asio/error.hpp>
#include <asiolink/dummy_io_cb.h>
#include <asiolink/udp_endpoint.h>
#include <asiolink/udp_server.h>
#include <asiolink/udp_socket.h>
#include "udp_server.h"
#include <dns/opcode.h>
...
...
@@ -38,8 +38,10 @@ using isc::log::dlog;
using
namespace
std
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
asiolink
;
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
/*
* Some of the member variables here are shared_ptrs and some are
...
...
@@ -318,4 +320,5 @@ UDPServer::hasAnswer() {
return
(
data_
->
done_
);
}
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
src/lib/asiodns/udp_server.h
View file @
8fc7cdd2
...
...
@@ -19,14 +19,15 @@
#error "asio.hpp must be included before including this, see asiolink.h as to why"
#endif
#include <asiolink/dns_server.h>
#include <asiolink/simple_callback.h>
#include <asiolink/dns_lookup.h>
#include <asiolink/dns_answer.h>
#include <asiodns/dns_answer.h>
#include <asiodns/dns_lookup.h>
#include <asiodns/dns_server.h>
#include <coroutine.h>
namespace
asiolink
{
namespace
isc
{
namespace
asiodns
{
//
// Asynchronous UDP server coroutine
...
...
@@ -47,7 +48,7 @@ public:
/// \param answer the callbackprovider for DNS answer events
explicit
UDPServer
(
asio
::
io_service
&
io_service
,
const
asio
::
ip
::
address
&
addr
,
const
uint16_t
port
,
SimpleCallback
*
checkin
=
NULL
,
isc
::
asiolink
::
SimpleCallback
*
checkin
=
NULL
,
DNSLookup
*
lookup
=
NULL
,
DNSAnswer
*
answer
=
NULL
);
...
...
@@ -102,5 +103,6 @@ private:
boost
::
shared_ptr
<
Data
>
data_
;
};
}
// namespace asiolink
}
// namespace asiodns
}
// namespace isc
#endif // __UDP_SERVER_H
src/lib/asiolink/Makefile.am
View file @
8fc7cdd2
...
...
@@ -21,7 +21,6 @@ libasiolink_la_SOURCES += io_address.cc io_address.h
libasiolink_la_SOURCES
+=
io_asio_socket.h
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
...
...
src/lib/asiolink/asiodef.cc
View file @
8fc7cdd2
...
...
@@ -4,6 +4,7 @@
#include <log/message_types.h>
#include <log/message_initializer.h>
namespace
isc
{
namespace
asiolink
{
extern
const
isc
::
log
::
MessageID
ASIO_FETCHCOMP
=
"FETCHCOMP"
;
...
...
@@ -16,6 +17,7 @@ extern const isc::log::MessageID ASIO_UNKORIGIN = "UNKORIGIN";
extern
const
isc
::
log
::
MessageID
ASIO_UNKRESULT
=
"UNKRESULT"
;
}
// namespace asiolink
}
// namespace isc
namespace
{
...
...
src/lib/asiolink/asiodef.h
View file @
8fc7cdd2
...
...
@@ -5,6 +5,7 @@
#include <log/message_types.h>
namespace
isc
{
namespace
asiolink
{
extern
const
isc
::
log
::
MessageID
ASIO_FETCHCOMP
;
...
...
@@ -17,5 +18,6 @@ extern const isc::log::MessageID ASIO_UNKORIGIN;
extern
const
isc
::
log
::
MessageID
ASIO_UNKRESULT
;
}
// namespace asiolink
}
// namespace isc
#endif // __ASIODEF_H
src/lib/asiolink/asiolink_utilities.h
View file @
8fc7cdd2
...
...
@@ -17,6 +17,7 @@
#include <cstddef>
namespace
isc
{
namespace
asiolink
{
/// \brief Read Unsigned 16-Bit Integer from Buffer
...
...
@@ -57,5 +58,6 @@ writeUint16(uint16_t value, void* buffer) {
}
}
// namespace asiolink
}
// namespace isc
#endif // __ASIOLINK_UTILITIES_H
src/lib/asiolink/dummy_io_cb.h
View file @
8fc7cdd2
...
...
@@ -20,6 +20,7 @@
#include <asio/error.hpp>
#include <asio/error_code.hpp>
namespace
isc
{
namespace
asiolink
{
/// \brief Asynchronous I/O Completion Callback
...
...
@@ -55,5 +56,6 @@ public:
};
}
// namespace asiolink
}
// namespace isc
#endif // __DUMMY_IO_CB_H
src/lib/asiolink/interval_timer.cc
View file @
8fc7cdd2
...
...
@@ -26,6 +26,7 @@
#include <asiolink/interval_timer.h>
#include <asiolink/io_service.h>
namespace
isc
{
namespace
asiolink
{
class
IntervalTimerImpl
{
...
...
@@ -133,4 +134,5 @@ IntervalTimer::getInterval() const {
return
(
impl_
->
getInterval
());
}
}
}
// namespace asiolink
}
// namespace isc
src/lib/asiolink/interval_timer.h
View file @
8fc7cdd2
...
...
@@ -19,6 +19,7 @@
#include <asiolink/io_service.h>
namespace
isc
{
namespace
asiolink
{
struct
IntervalTimerImpl
;
...
...
@@ -129,5 +130,6 @@ private:
IntervalTimerImpl
*
impl_
;
};
}
// namespace asiolink
}
// namespace asiolink
}
// namespace isc
#endif // __ASIOLINK_INTERVAL_TIMER_H
src/lib/asiolink/io_address.cc
View file @
8fc7cdd2
...
...
@@ -31,6 +31,7 @@ using asio::ip::tcp;
using
namespace
std
;
namespace
isc
{
namespace
asiolink
{
// XXX: we cannot simply construct the address in the initialization list,
...
...
@@ -62,4 +63,5 @@ IOAddress::getFamily() const {
}