use ndn::ip::address(V6)FromString for scope-id aware conversion
Change-Id: Ifdc31771b8a990867c0a79ba42b71c87a97bcd56
Refs: #1428
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index 8214969..1546d24 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -25,6 +25,8 @@
#include "tcp-factory.hpp"
+#include <ndn-cxx/net/address-converter.hpp>
+
namespace nfd {
namespace face {
@@ -143,7 +145,7 @@
return;
}
- tcp::Endpoint endpoint(ip::address::from_string(params.remoteUri.getHost()),
+ tcp::Endpoint endpoint(ndn::ip::addressFromString(params.remoteUri.getHost()),
boost::lexical_cast<uint16_t>(params.remoteUri.getPort()));
// a canonical tcp4/tcp6 FaceUri cannot have a multicast address
@@ -184,7 +186,7 @@
shared_ptr<TcpChannel>
TcpFactory::createChannel(const std::string& localIp, const std::string& localPort)
{
- tcp::Endpoint endpoint(ip::address::from_string(localIp),
+ tcp::Endpoint endpoint(ndn::ip::addressFromString(localIp),
boost::lexical_cast<uint16_t>(localPort));
return createChannel(endpoint);
}
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index f44e4e9..57be339 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -27,6 +27,8 @@
#include "generic-link-service.hpp"
#include "multicast-udp-transport.hpp"
#include "core/global-io.hpp"
+
+#include <ndn-cxx/net/address-converter.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm/copy.hpp>
@@ -227,7 +229,7 @@
return;
}
- udp::Endpoint endpoint(ip::address::from_string(params.remoteUri.getHost()),
+ udp::Endpoint endpoint(ndn::ip::addressFromString(params.remoteUri.getHost()),
boost::lexical_cast<uint16_t>(params.remoteUri.getPort()));
if (endpoint.address().is_multicast()) {
@@ -286,7 +288,7 @@
UdpFactory::createChannel(const std::string& localIp, const std::string& localPort,
time::nanoseconds idleTimeout)
{
- udp::Endpoint endpoint(ip::address::from_string(localIp),
+ udp::Endpoint endpoint(ndn::ip::addressFromString(localIp),
boost::lexical_cast<uint16_t>(localPort));
return createChannel(endpoint, idleTimeout);
}
@@ -387,9 +389,9 @@
const std::string& multicastPort,
const std::string& networkInterfaceName)
{
- udp::Endpoint localEndpoint(ip::address::from_string(localIp),
+ udp::Endpoint localEndpoint(ndn::ip::addressFromString(localIp),
boost::lexical_cast<uint16_t>(multicastPort));
- udp::Endpoint multicastEndpoint(ip::address::from_string(multicastIp),
+ udp::Endpoint multicastEndpoint(ndn::ip::addressFromString(multicastIp),
boost::lexical_cast<uint16_t>(multicastPort));
return createMulticastFace(localEndpoint, multicastEndpoint, networkInterfaceName);
}
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
index 9572216..6a87563 100644
--- a/daemon/face/websocket-factory.cpp
+++ b/daemon/face/websocket-factory.cpp
@@ -25,6 +25,8 @@
#include "websocket-factory.hpp"
+#include <ndn-cxx/net/address-converter.hpp>
+
namespace nfd {
namespace face {
@@ -141,7 +143,7 @@
shared_ptr<WebSocketChannel>
WebSocketFactory::createChannel(const std::string& localIp, const std::string& localPort)
{
- websocket::Endpoint endpoint(ip::address::from_string(localIp),
+ websocket::Endpoint endpoint(ndn::ip::addressFromString(localIp),
boost::lexical_cast<uint16_t>(localPort));
return createChannel(endpoint);
}