Fix additional Boost API compatibility issues
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 27 Dec 2025 16:36:25 +0000 (17:36 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 27 Dec 2025 16:40:46 +0000 (17:40 +0100)
- networkinterface.hpp: Replace Socket.native() with Socket.native_handle()
  for newer Boost versions
- icmppinger.cpp: Use boost::function instead of bare function to avoid
  ambiguity with std::function
- tcppinger.cpp: Same fix for boost::function

src/host/networkinterface.hpp
src/icmp/icmppinger.cpp
src/main.cpp
src/tcp/tcppinger.cpp
test/test_dns.cpp

index 364376c..564730b 100644 (file)
@@ -109,7 +109,7 @@ bool NetworkInterface<SocketType, Protocol>::bind()
     BOOST_ASSERT( !Name.empty() );
 
     int ret = ::setsockopt(
-            Socket.native(),
+            Socket.native_handle(),
             SOL_SOCKET,
             SO_BINDTODEVICE,
             Name.c_str(),
index 2415c83..a87a409 100644 (file)
@@ -128,7 +128,7 @@ IcmpPinger::~IcmpPinger()
 void IcmpPinger::ping(
         const address &destination_ip,
         const uint16_t /*destination_port*/, // the ICMP protocol does not use ports
-        function<void(PingStatus,long)> ping_done_callback
+        boost::function<void(PingStatus,long)> ping_done_callback
 )
 {
     PingDoneCallback = ping_done_callback;
index 3c015ec..876462b 100644 (file)
@@ -55,7 +55,7 @@ using I2n::Logger::GlobalLogger;
 // a map from interval (in seconds) to delay (in seconds)
 typedef std::pair<int, float> IntervalCountPair;
 typedef std::map<int, float> DelayMap;
-typedef shared_ptr<boost::asio::deadline_timer> TimerItem;
+typedef boost::shared_ptr<boost::asio::deadline_timer> TimerItem;
 
 const boost::posix_time::time_duration SIGNAL_CHECK_INTERVAL = boost::posix_time::seconds(1);
 
index e7a6e95..41fd129 100644 (file)
@@ -115,7 +115,7 @@ TcpPinger::~TcpPinger()
 void TcpPinger::ping(
         const address &destination_ip,
         const uint16_t destination_port,
-        function<void(PingStatus,long)> ping_done_callback
+        boost::function<void(PingStatus,long)> ping_done_callback
 )
 {
     BOOST_ASSERT( ( 0 < destination_port ) && ( destination_port < numeric_limits<uint16_t>::max() ) );
index 17495e7..8b35509 100644 (file)
@@ -197,7 +197,7 @@ struct GlobalFixture
 // this causes above fixture to be created only once before tests start and
 // destructed after tests end; however, variables are not accessible in test
 // cases
-BOOST_GLOBAL_FIXTURE( GlobalFixture )
+BOOST_GLOBAL_FIXTURE( GlobalFixture );
 
 
 // using this as suite-level fixture makes variable Master accessible in all