summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2024-12-20 14:40:47 +0100
committerFrancis Dupont <fdupont@isc.org>2025-01-15 15:26:32 +0100
commit1ecfaf9bd6996fdb5f4caf3b71e275f4d912d2d6 (patch)
tree882c272dd54fc60d2460b9d30cf847b5815415bc
parent[#3696] Updated UT files (diff)
downloadkea-1ecfaf9bd6996fdb5f4caf3b71e275f4d912d2d6.tar.xz
kea-1ecfaf9bd6996fdb5f4caf3b71e275f4d912d2d6.zip
[#3696] Made >= 1.66 mandatory
-rw-r--r--m4macros/ax_boost_for_kea.m42
-rw-r--r--src/lib/asiolink/io_acceptor.h4
-rw-r--r--src/lib/asiolink/io_address.cc4
-rw-r--r--src/lib/asiolink/io_service.cc12
-rw-r--r--src/lib/asiolink/io_service.h22
-rw-r--r--src/lib/asiolink/tcp_socket.h4
-rw-r--r--src/lib/asiolink/tls_socket.h4
-rw-r--r--src/lib/asiolink/udp_socket.h4
-rw-r--r--src/lib/asiolink/unix_domain_socket.cc4
9 files changed, 23 insertions, 37 deletions
diff --git a/m4macros/ax_boost_for_kea.m4 b/m4macros/ax_boost_for_kea.m4
index c2714eef27..996413374a 100644
--- a/m4macros/ax_boost_for_kea.m4
+++ b/m4macros/ax_boost_for_kea.m4
@@ -101,6 +101,8 @@ AC_CHECK_HEADERS(boost/asio/coroutine.hpp,,AC_MSG_RESULT(not found, using built-
AC_CHECK_HEADERS(boost/integer/common_factor.hpp)
+AC_CHECK_HEADERS(boost/asio/io_context.hpp,,AC_MSG_ERROR([Missing boost asio io_context header: boost version must be at least 1.66]))
+
# Verify that the path does not include standard headers by mistake.
# There are two regex.h headers: one is a standard system header (usually
# in /usr/include) and the second one is provided by boost. If you specify the
diff --git a/src/lib/asiolink/io_acceptor.h b/src/lib/asiolink/io_acceptor.h
index 0909048880..4491f7c3aa 100644
--- a/src/lib/asiolink/io_acceptor.h
+++ b/src/lib/asiolink/io_acceptor.h
@@ -47,11 +47,7 @@ public:
/// @brief Returns file descriptor of the underlying socket.
virtual int getNative() const {
-#if BOOST_VERSION < 106600
- return (acceptor_->native());
-#else
return (acceptor_->native_handle());
-#endif
}
/// @brief Opens acceptor socket given the endpoint.
diff --git a/src/lib/asiolink/io_address.cc b/src/lib/asiolink/io_address.cc
index 06b7d3d990..a5af531513 100644
--- a/src/lib/asiolink/io_address.cc
+++ b/src/lib/asiolink/io_address.cc
@@ -19,6 +19,10 @@
#include <sys/socket.h>
#include <netinet/in.h>
+#if BOOST_VERSION < 106600
+#error "Boost ASIO older than 1.66 are not supported"
+#endif
+
using namespace boost::asio;
using boost::asio::ip::udp;
using boost::asio::ip::tcp;
diff --git a/src/lib/asiolink/io_service.cc b/src/lib/asiolink/io_service.cc
index cc28d24c19..91af69ade3 100644
--- a/src/lib/asiolink/io_service.cc
+++ b/src/lib/asiolink/io_service.cc
@@ -101,13 +101,13 @@ public:
work_.reset();
}
- /// @brief Return the native @c io_service object used in this wrapper.
+ /// @brief Return the native @c io_context object used in this wrapper.
///
/// This is a short term work around to support other Kea modules
- /// that share the same @c io_service with the authoritative server.
+ /// that share the same @c io_context with the authoritative server.
/// It will eventually be removed once the wrapper interface is
/// generalized.
- boost::asio::io_service& getInternalIOService() {
+ boost::asio::io_context& getInternalIOService() {
return (io_service_);
}
@@ -119,8 +119,8 @@ public:
}
private:
- boost::asio::io_service io_service_;
- boost::asio::executor_work_guard<boost::asio::io_service::executor_type> work_;
+ boost::asio::io_context io_service_;
+ boost::asio::executor_work_guard<boost::asio::io_context::executor_type> work_;
};
IOService::IOService() : io_impl_(new IOServiceImpl()) {
@@ -169,7 +169,7 @@ IOService::stopWork() {
io_impl_->stopWork();
}
-boost::asio::io_service&
+boost::asio::io_context&
IOService::getInternalIOService() {
return (io_impl_->getInternalIOService());
}
diff --git a/src/lib/asiolink/io_service.h b/src/lib/asiolink/io_service.h
index 66dff619b9..c1aa04b4bf 100644
--- a/src/lib/asiolink/io_service.h
+++ b/src/lib/asiolink/io_service.h
@@ -12,14 +12,14 @@
#include <functional>
#include <list>
-namespace boost {
-namespace asio {
#if BOOST_VERSION < 106600
- class io_service;
-#else
- class io_context;
- typedef io_context io_service;
+#error "Boost ASIO older than 1.66 are not supported"
#endif
+
+// Include boost/asio/io_context.hpp instead?
+namespace boost {
+namespace asio {
+class io_context;
}
}
@@ -32,7 +32,7 @@ class IOService;
/// @brief Defines a smart pointer to an IOService instance.
typedef boost::shared_ptr<IOService> IOServicePtr;
-/// @brief The @ref IOService class is a wrapper for the ASIO @c io_service
+/// @brief The @ref IOService class is a wrapper for the ASIO @c io_context
/// class.
class IOService {
/// @brief Constructors and Destructor.
@@ -99,15 +99,15 @@ public:
/// when all handlers have been invoked.
void stopWork();
- /// @brief Return the native @c io_service object used in this wrapper.
+ /// @brief Return the native @c io_context object used in this wrapper.
///
/// This is a short term work around to support other Kea modules
- /// that share the same @c io_service with the authoritative server.
+ /// that share the same @c io_context with the authoritative server.
/// It will eventually be removed once the wrapper interface is
/// generalized.
///
- /// @return The internal io_service object.
- boost::asio::io_service& getInternalIOService();
+ /// @return The internal io_context object.
+ boost::asio::io_context& getInternalIOService();
/// @brief Post a callback to the end of the queue.
///
diff --git a/src/lib/asiolink/tcp_socket.h b/src/lib/asiolink/tcp_socket.h
index e56abe412d..830f1a2a28 100644
--- a/src/lib/asiolink/tcp_socket.h
+++ b/src/lib/asiolink/tcp_socket.h
@@ -73,11 +73,7 @@ public:
/// \brief Return file descriptor of underlying socket
virtual int getNative() const {
-#if BOOST_VERSION < 106600
- return (socket_.native());
-#else
return (socket_.native_handle());
-#endif
}
/// \brief Return protocol of socket
diff --git a/src/lib/asiolink/tls_socket.h b/src/lib/asiolink/tls_socket.h
index 80006dc10c..96382cc77f 100644
--- a/src/lib/asiolink/tls_socket.h
+++ b/src/lib/asiolink/tls_socket.h
@@ -50,11 +50,7 @@ public:
/// @brief Return file descriptor of underlying socket.
virtual int getNative() const {
-#if BOOST_VERSION < 106600
- return (socket_.native());
-#else
return (socket_.native_handle());
-#endif
}
/// @brief Return protocol of socket.
diff --git a/src/lib/asiolink/udp_socket.h b/src/lib/asiolink/udp_socket.h
index 380d344e36..db6c3a8eb4 100644
--- a/src/lib/asiolink/udp_socket.h
+++ b/src/lib/asiolink/udp_socket.h
@@ -63,11 +63,7 @@ public:
/// \brief Return file descriptor of underlying socket
virtual int getNative() const {
-#if BOOST_VERSION < 106600
- return (socket_.native());
-#else
return (socket_.native_handle());
-#endif
}
/// \brief Return protocol of socket
diff --git a/src/lib/asiolink/unix_domain_socket.cc b/src/lib/asiolink/unix_domain_socket.cc
index 43ff3c8f24..88d3dcdc55 100644
--- a/src/lib/asiolink/unix_domain_socket.cc
+++ b/src/lib/asiolink/unix_domain_socket.cc
@@ -289,11 +289,7 @@ UnixDomainSocket::UnixDomainSocket(const IOServicePtr& io_service)
int
UnixDomainSocket::getNative() const {
-#if BOOST_VERSION < 106600
- return (impl_->socket_.native());
-#else
return (impl_->socket_.native_handle());
-#endif
}
int