summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorTomek Mrugalski <tomasz@isc.org>2012-06-01 14:46:05 +0200
committerTomek Mrugalski <tomasz@isc.org>2012-06-01 14:46:05 +0200
commit31f30b1e995c47d23a7ad1ec28ea665da775aa1c (patch)
tree2423c023030938508f3cb87f4e79475df90f31bd /doc
parent[1651] tests for Session::getSocketDesc() implemented. (diff)
downloadkea-31f30b1e995c47d23a7ad1ec28ea665da775aa1c.tar.xz
kea-31f30b1e995c47d23a7ad1ec28ea665da775aa1c.zip
[1651] Tests for IfaceMgr callback implemented, devel doc updated
Diffstat (limited to 'doc')
-rw-r--r--doc/devel/02-dhcp.dox36
-rw-r--r--doc/devel/mainpage.dox3
2 files changed, 33 insertions, 6 deletions
diff --git a/doc/devel/02-dhcp.dox b/doc/devel/02-dhcp.dox
index 7ebd9b203a..782301d5a6 100644
--- a/doc/devel/02-dhcp.dox
+++ b/doc/devel/02-dhcp.dox
@@ -15,11 +15,35 @@
* only), as support for transmission to hosts without IPv4 address
* assigned is not implemented in IfaceMgr yet.
*
- * DHCPv4 server component does not listen to BIND10 message queue.
- *
* DHCPv4 server component does not use BIND10 logging yet.
*
- * DHCPv4 server component is not integrated with boss yet.
+ * @section dhcpv4Session BIND10 message queue integration
+ *
+ * DHCPv4 server component is now integrated with BIND10 message queue.
+ * The integration is performed by establish_session() and disconnect_session()
+ * functions in src/bin/dhcp4/main.cc file. isc::cc::Session cc_session
+ * object uses ASIO for establishing connection. It registers its socket
+ * in isc::asiolink::IOService io_service object. Typically, other components that
+ * use ASIO for their communication, register their other sockets in the
+ * same io_service and then just call io_service.run() method that does
+ * not return, until one of the callback decides that it is time to shut down
+ * the whole component cal calls io_service.stop(). DHCPv4 works in a
+ * different way. It does receive messages using select()
+ * (see isc::dhcp::IfaceMgr::receive4()), which is incompatible with ASIO.
+ * To solve this problem, socket descriptor is extracted from cc_session
+ * object and is passed to IfaceMgr by using isc::dhcp::IfaceMgr::set_session_socket().
+ * IfaceMgr then uses this socket in its select() call. If there is some
+ * data to be read, it calls registered callback that is supposed to
+ * read and process incoming data.
+ *
+ * This somewhat complicated approach is needed for a simple reason. In
+ * embedded deployments there will be no message queue. Not referring directly
+ * to anything related to message queue in isc::dhcp::Dhcpv4Srv and
+ * isc::dhcp::IfaceMgr classes brings in two benefits. First, the can
+ * be used with and without message queue. Second benefit is related to the
+ * first one: \ref libdhcp is supposed to be simple and robust and not require
+ * many dependencies. One notable example of a use case that benefits from
+ * this approach is a perfdhcp tool.
*
* @page dhcpv6 DHCPv6 Server Component
*
@@ -42,9 +66,9 @@
*
* DHCPv6 server component is not integrated with boss yet.
*
- * @page libdhcp libdhcp++ library
+ * @page libdhcp libdhcp++
*
- * @section libdhcpIntro Libdhcp++ Introduction
+ * @section libdhcpIntro Libdhcp++ Library Introduction
*
* libdhcp++ is an all-purpose DHCP-manipulation library, written in
* C++. It offers packet parsing and assembly, DHCPv4 and DHCPv6
@@ -82,7 +106,7 @@
* isc::dhcp::Option::delOption(), isc::dhcp::Option::getOption() can be used
* for that purpose.
*
- * @section lidhcpIfaceMgr Interface Manager
+ * @section libdhcpIfaceMgr Interface Manager
*
* Interface Manager (or IfaceMgr) is an abstraction layer about low-level
* network operations. In particlar, it provides information about existing
diff --git a/doc/devel/mainpage.dox b/doc/devel/mainpage.dox
index a472add985..a7fd094152 100644
--- a/doc/devel/mainpage.dox
+++ b/doc/devel/mainpage.dox
@@ -19,8 +19,11 @@
*
* @section DHCP
* - @subpage dhcpv4
+ * - @subpage dhcpv4Session
* - @subpage dhcpv6
* - @subpage libdhcp
+ * - @subpage libdhcpIntro
+ * - @subpage libdhcpIfaceMgr
*
* @section misc Miscellaneous topics
* - @subpage LoggingApi