mgmt: support LpReliability flag in faces/create and faces/update
refs #4003
Change-Id: Iddf94ea55c630b038187c2503783591b118230ec
diff --git a/daemon/face/ethernet-channel.cpp b/daemon/face/ethernet-channel.cpp
index 44fb03c..bc149d2 100644
--- a/daemon/face/ethernet-channel.cpp
+++ b/daemon/face/ethernet-channel.cpp
@@ -55,12 +55,13 @@
void
EthernetChannel::connect(const ethernet::Address& remoteEndpoint,
ndn::nfd::FacePersistency persistency,
+ bool wantLpReliability,
const FaceCreatedCallback& onFaceCreated,
const FaceCreationFailedCallback& onConnectFailed)
{
shared_ptr<Face> face;
try {
- face = createFace(remoteEndpoint, persistency).second;
+ face = createFace(remoteEndpoint, persistency, wantLpReliability).second;
}
catch (const boost::system::system_error& e) {
NFD_LOG_CHAN_DEBUG("Face creation for " << remoteEndpoint << " failed: " << e.what());
@@ -165,7 +166,7 @@
bool isCreated = false;
shared_ptr<Face> face;
try {
- std::tie(isCreated, face) = createFace(sender, ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
+ std::tie(isCreated, face) = createFace(sender, ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, false);
}
catch (const EthernetTransport::Error& e) {
NFD_LOG_CHAN_DEBUG("Face creation for " << sender << " failed: " << e.what());
@@ -186,7 +187,8 @@
std::pair<bool, shared_ptr<Face>>
EthernetChannel::createFace(const ethernet::Address& remoteEndpoint,
- ndn::nfd::FacePersistency persistency)
+ ndn::nfd::FacePersistency persistency,
+ bool wantLpReliability)
{
auto it = m_channelFaces.find(remoteEndpoint);
if (it != m_channelFaces.end()) {
@@ -196,7 +198,9 @@
}
// else, create a new face
- auto linkService = make_unique<GenericLinkService>();
+ GenericLinkService::Options options;
+ options.reliabilityOptions.isEnabled = wantLpReliability;
+ auto linkService = make_unique<GenericLinkService>(options);
auto transport = make_unique<UnicastEthernetTransport>(*m_localEndpoint, remoteEndpoint,
persistency, m_idleFaceTimeout);
auto face = make_shared<Face>(std::move(linkService), std::move(transport));