core+face: avoid deprecated Boost.Asio interfaces
Change-Id: I07ec286531edf63f258babe1561b4da2a88edd10
diff --git a/tests/daemon/face/multicast-udp-transport-fixture.hpp b/tests/daemon/face/multicast-udp-transport-fixture.hpp
index 4c984f4..40c79ee 100644
--- a/tests/daemon/face/multicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/multicast-udp-transport-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -49,11 +49,11 @@
ip::address mcastAddr;
if (address.is_v4()) {
// the administratively scoped group 224.0.0.254 is reserved for experimentation (RFC 4727)
- mcastAddr = ip::address_v4(0xE00000FE);
+ mcastAddr = ip::make_address_v4(0xE00000FE);
}
else {
// the group FF0X::114 is reserved for experimentation at all scope levels (RFC 4727)
- auto v6Addr = ip::address_v6::from_string("FF01::114");
+ auto v6Addr = ip::make_address_v6("FF01::114");
v6Addr.scope_id(netif->getIndex());
mcastAddr = v6Addr;
}
diff --git a/tests/daemon/face/network-predicate.t.cpp b/tests/daemon/face/network-predicate.t.cpp
index 05094fc..0595b48 100644
--- a/tests/daemon/face/network-predicate.t.cpp
+++ b/tests/daemon/face/network-predicate.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -69,19 +69,19 @@
protected:
NetworkInterfacePredicateFixture()
{
- using namespace boost::asio::ip;
using namespace ndn::net;
namespace ethernet = ndn::ethernet;
+ namespace ip = boost::asio::ip;
netifs.push_back(NetworkMonitorStub::makeNetworkInterface());
netifs.back()->setIndex(0);
netifs.back()->setName("eth0");
netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:00"));
netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
- address_v4::from_string("129.82.100.1"), address_v4::from_string("129.82.255.255"),
+ ip::make_address_v4("129.82.100.1"), ip::make_address_v4("129.82.255.255"),
16, AddressScope::GLOBAL, 0));
netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V6,
- address_v6::from_string("2001:db8:1::1"), address_v6::from_string("2001:db8:1::ffff:ffff:ffff:ffff"),
+ ip::make_address_v6("2001:db8:1::1"), ip::make_address_v6("2001:db8:1::ffff:ffff:ffff:ffff"),
64, AddressScope::GLOBAL, 0));
netifs.back()->setFlags(IFF_UP);
@@ -90,10 +90,10 @@
netifs.back()->setName("eth1");
netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:01"));
netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
- address_v4::from_string("192.168.2.1"), address_v4::from_string("192.168.2.255"),
+ ip::make_address_v4("192.168.2.1"), ip::make_address_v4("192.168.2.255"),
24, AddressScope::GLOBAL, 0));
netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V6,
- address_v6::from_string("2001:db8:2::1"), address_v6::from_string("2001:db8:2::ffff:ffff:ffff:ffff"),
+ ip::make_address_v6("2001:db8:2::1"), ip::make_address_v6("2001:db8:2::ffff:ffff:ffff:ffff"),
64, AddressScope::GLOBAL, 0));
netifs.back()->setFlags(IFF_UP);
@@ -102,10 +102,10 @@
netifs.back()->setName("eth2");
netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:02"));
netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
- address_v4::from_string("198.51.100.1"), address_v4::from_string("198.51.100.255"),
+ ip::make_address_v4("198.51.100.1"), ip::make_address_v4("198.51.100.255"),
24, AddressScope::GLOBAL, 0));
netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V6,
- address_v6::from_string("2001:db8::1"), address_v6::from_string("2001:db8::ffff"),
+ ip::make_address_v6("2001:db8::1"), ip::make_address_v6("2001:db8::ffff"),
112, AddressScope::GLOBAL, 0));
netifs.back()->setFlags(IFF_MULTICAST | IFF_BROADCAST | IFF_UP);
@@ -114,7 +114,7 @@
netifs.back()->setName("enp68s0f1");
netifs.back()->setEthernetAddress(ethernet::Address::fromString("3e:15:c2:8b:65:03"));
netifs.back()->addNetworkAddress(NetworkAddress(AddressFamily::V4,
- address_v4::from_string("192.168.2.3"), address_v4::from_string("192.168.2.255"),
+ ip::make_address_v4("192.168.2.3"), ip::make_address_v4("192.168.2.255"),
24, AddressScope::GLOBAL, 0));
netifs.back()->setFlags(IFF_UP);
}
@@ -382,10 +382,10 @@
{
using namespace boost::asio::ip;
- addrs.push_back(address_v4::from_string("129.82.100.1"));
- addrs.push_back(address_v6::from_string("2001:db8:1::1"));
- addrs.push_back(address_v4::from_string("192.168.2.1"));
- addrs.push_back(address_v6::from_string("2001:db8:2::1"));
+ addrs.emplace_back(make_address_v4("129.82.100.1"));
+ addrs.emplace_back(make_address_v6("2001:db8:1::1"));
+ addrs.emplace_back(make_address_v4("192.168.2.1"));
+ addrs.emplace_back(make_address_v6("2001:db8:2::1"));
}
protected:
diff --git a/tests/daemon/face/tcp-factory.t.cpp b/tests/daemon/face/tcp-factory.t.cpp
index fba95fe..e2aa73d 100644
--- a/tests/daemon/face/tcp-factory.t.cpp
+++ b/tests/daemon/face/tcp-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -42,7 +42,7 @@
shared_ptr<TcpChannel>
createChannel(const std::string& localIp, const std::string& localPort)
{
- tcp::Endpoint endpoint(boost::asio::ip::address::from_string(localIp),
+ tcp::Endpoint endpoint(boost::asio::ip::make_address(localIp),
boost::lexical_cast<uint16_t>(localPort));
return factory.createChannel(endpoint);
}
diff --git a/tests/daemon/face/test-netif.cpp b/tests/daemon/face/test-netif.cpp
index 68b66cd..2dd9da5 100644
--- a/tests/daemon/face/test-netif.cpp
+++ b/tests/daemon/face/test-netif.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -37,7 +37,7 @@
if (netmon.getCapabilities() & NetworkMonitor::CAP_ENUM) {
netmon.onEnumerationCompleted.connect([] { getGlobalIoService().stop(); });
getGlobalIoService().run();
- getGlobalIoService().reset();
+ getGlobalIoService().restart();
}
return netmon.listNetworkInterfaces();
}
diff --git a/tests/daemon/face/udp-factory.t.cpp b/tests/daemon/face/udp-factory.t.cpp
index 259dbb3..106ba0b 100644
--- a/tests/daemon/face/udp-factory.t.cpp
+++ b/tests/daemon/face/udp-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -42,7 +42,7 @@
shared_ptr<UdpChannel>
createChannel(const std::string& localIp, uint16_t localPort)
{
- udp::Endpoint endpoint(boost::asio::ip::address::from_string(localIp), localPort);
+ udp::Endpoint endpoint(boost::asio::ip::make_address(localIp), localPort);
return factory.createChannel(endpoint, 5_min);
}
};
@@ -75,8 +75,8 @@
shared_ptr<Face>
createMulticastFace(const std::string& localIp, const std::string& mcastIp, uint16_t mcastPort)
{
- auto localAddress = boost::asio::ip::address::from_string(localIp);
- udp::Endpoint mcastEndpoint(boost::asio::ip::address::from_string(mcastIp), mcastPort);
+ auto localAddress = boost::asio::ip::make_address(localIp);
+ udp::Endpoint mcastEndpoint(boost::asio::ip::make_address(mcastIp), mcastPort);
if (localAddress.is_v4()) {
BOOST_ASSERT(!netifsV4.empty());
@@ -129,7 +129,7 @@
static bool
isFaceOnNetif(const Face& face, const NetworkInterface& netif)
{
- auto ip = boost::asio::ip::address::from_string(face.getLocalUri().getHost());
+ auto ip = boost::asio::ip::make_address(face.getLocalUri().getHost());
return std::any_of(netif.getNetworkAddresses().begin(), netif.getNetworkAddresses().end(),
[ip] (const auto& a) { return a.getIp() == ip; });
}
@@ -427,9 +427,9 @@
auto uri = udpMcastFaces.front()->getRemoteUri();
BOOST_CHECK_EQUAL(uri.getScheme(), "udp6");
// check the address ignoring the scope id
- auto addr = boost::asio::ip::address_v6::from_string(uri.getHost());
+ auto addr = boost::asio::ip::make_address_v6(uri.getHost());
addr.scope_id(0);
- BOOST_CHECK_EQUAL(addr, boost::asio::ip::address_v6::from_string("ff02::1101"));
+ BOOST_CHECK_EQUAL(addr, boost::asio::ip::make_address_v6("ff02::1101"));
BOOST_CHECK_EQUAL(uri.getPort(), "7011");
parseConfig(CONFIG2, false);
@@ -439,9 +439,9 @@
uri = udpMcastFaces.front()->getRemoteUri();
BOOST_CHECK_EQUAL(uri.getScheme(), "udp6");
// check the address ignoring the scope id
- addr = boost::asio::ip::address_v6::from_string(uri.getHost());
+ addr = boost::asio::ip::make_address_v6(uri.getHost());
addr.scope_id(0);
- BOOST_CHECK_EQUAL(addr, boost::asio::ip::address_v6::from_string("ff02::1102"));
+ BOOST_CHECK_EQUAL(addr, boost::asio::ip::make_address_v6("ff02::1102"));
BOOST_CHECK_EQUAL(uri.getPort(), "7012");
}
diff --git a/tests/daemon/face/websocket-factory.t.cpp b/tests/daemon/face/websocket-factory.t.cpp
index aac1eca..c133671 100644
--- a/tests/daemon/face/websocket-factory.t.cpp
+++ b/tests/daemon/face/websocket-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -41,7 +41,7 @@
shared_ptr<WebSocketChannel>
createChannel(const std::string& localIp, const std::string& localPort)
{
- websocket::Endpoint endpoint(boost::asio::ip::address::from_string(localIp),
+ websocket::Endpoint endpoint(boost::asio::ip::make_address(localIp),
boost::lexical_cast<uint16_t>(localPort));
return factory.createChannel(endpoint);
}
diff --git a/tests/daemon/face/websocket-transport.t.cpp b/tests/daemon/face/websocket-transport.t.cpp
index 23d15f0..d28d8a3 100644
--- a/tests/daemon/face/websocket-transport.t.cpp
+++ b/tests/daemon/face/websocket-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -63,7 +63,7 @@
BOOST_FIXTURE_TEST_CASE_TEMPLATE(StaticPropertiesV4Mapped, T, StaticPropertiesV4MappedFixtures, T)
{
TRANSPORT_TEST_CHECK_PRECONDITIONS();
- auto mappedAddr = ip::address_v6::v4_mapped(this->address.to_v4());
+ auto mappedAddr = ip::make_address_v6(ip::v4_mapped, this->address.to_v4());
BOOST_REQUIRE(mappedAddr.is_v4_mapped());
WebSocketTransportFixture::initialize(this->interface, mappedAddr);
diff --git a/tests/daemon/limited-io.cpp b/tests/daemon/limited-io.cpp
index 9f10f99..7b54190 100644
--- a/tests/daemon/limited-io.cpp
+++ b/tests/daemon/limited-io.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -70,7 +70,7 @@
m_lastException = std::current_exception();
}
- getGlobalIoService().reset();
+ getGlobalIoService().restart();
m_timeout.cancel();
m_isRunning = false;
diff --git a/tests/daemon/rib-io-fixture.cpp b/tests/daemon/rib-io-fixture.cpp
index d8931df..df67694 100644
--- a/tests/daemon/rib-io-fixture.cpp
+++ b/tests/daemon/rib-io-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -61,7 +61,7 @@
}
if (g_ribIo->stopped()) {
- g_ribIo->reset();
+ g_ribIo->restart();
}
while (g_ribIo->poll() > 0)
;
@@ -109,7 +109,7 @@
m_ribPollStartCv.notify_all();
if (g_io.stopped()) {
- g_io.reset();
+ g_io.restart();
}
nHandlersRun = g_io.poll();