summaryrefslogtreecommitdiffstats
path: root/src/lib/xfr/xfrout_client.h
diff options
context:
space:
mode:
authorLikun Zhang <zlkzhy@gmail.com>2010-03-23 09:41:24 +0100
committerLikun Zhang <zlkzhy@gmail.com>2010-03-23 09:41:24 +0100
commit3771057f6f715fb11a0f3383931979c6a074f068 (patch)
tree29f0bd90e825313f77cf65fa179c0253564664e5 /src/lib/xfr/xfrout_client.h
parentAdd python binding code for function "parseHeader" in class Message. (diff)
downloadkea-3771057f6f715fb11a0f3383931979c6a074f068.tar.xz
kea-3771057f6f715fb11a0f3383931979c6a074f068.zip
Commit code for module xfrout, AXFR-out works now. Notes:
1. When auth server get axfr query in tcp, the query message and tcp socket will be sent to xfrout process over sendmsg/recvmsg, then auth server will close the tcp socket, or get the next tcp query on the socket. Xfrout send the query response over the tcp socket it received from auth server. 2. Since python3.1 didn't provide the wrapper of sendmsg() and recvmsg() for C socket module(Seems they plan do it in python3.2), I have to write the code in c++, and make python binding for it. See the code in file /src/lib/xfr/fd_share.cc and /src/lib/xfr/python_xfr.cc. git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1630 e5f2f494-b856-4b98-b285-d166d9295462
Diffstat (limited to 'src/lib/xfr/xfrout_client.h')
-rw-r--r--src/lib/xfr/xfrout_client.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/xfr/xfrout_client.h b/src/lib/xfr/xfrout_client.h
new file mode 100644
index 0000000000..f05abd79c5
--- /dev/null
+++ b/src/lib/xfr/xfrout_client.h
@@ -0,0 +1,41 @@
+#ifndef _XFROUT_CLIENT_H
+#define _XFROUT_CLIENT_H
+
+#include <boost/asio.hpp>
+#include <exceptions/exceptions.h>
+
+namespace isc {
+namespace xfr {
+
+class XfroutError: public Exception
+{
+public:
+ XfroutError(const char *file, size_t line, const char *what):
+ isc::Exception(file, line, what) {}
+};
+
+using boost::asio::local::stream_protocol;
+class XfroutClient
+{
+public:
+ XfroutClient(const std::string &file):
+ socket_(io_service_), file_path_(file) {}
+
+ void connect();
+ void disconnect();
+ int sendXfroutRequestInfo(int tcp_sock, uint8_t *msg_data, uint16_t msg_len);
+
+private:
+ void sendData(uint8_t *msg_data, uint16_t msg_len);
+
+private:
+ boost::asio::io_service io_service_;
+ // The socket used to communicate with the xfrout server.
+ stream_protocol::socket socket_;
+ const std::string file_path_;
+};
+
+} // End for namespace xfr
+} // End for namespace isc
+
+#endif