face: use IncomingFaceId, NextHopFaceId, CachePolicy tags
This commit replaces all LocalControlHeader usages with these tags,
and deletes LocalFace.
This commit also does minor improvements in RIB test suites.
refs #3339
Change-Id: I14cbfc296a6723a5860bf8bd95d9804d3bac3da5
diff --git a/tests/daemon/fw/client-control-strategy.t.cpp b/tests/daemon/fw/client-control-strategy.t.cpp
index 189d42f..8f0870b 100644
--- a/tests/daemon/fw/client-control-strategy.t.cpp
+++ b/tests/daemon/fw/client-control-strategy.t.cpp
@@ -48,7 +48,6 @@
shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
shared_ptr<DummyLocalFace> face4 = make_shared<DummyLocalFace>();
- face4->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
forwarder.addFace(face1);
forwarder.addFace(face2);
forwarder.addFace(face3);
@@ -62,7 +61,7 @@
// Interest with valid NextHopFaceId
shared_ptr<Interest> interest1 = makeInterest("ndn:/0z8r6yDDe");
- interest1->setNextHopFaceId(face1->getId());
+ interest1->setTag(make_shared<lp::NextHopFaceIdTag>(face1->getId()));
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
pitEntry1->insertOrUpdateInRecord(face4, *interest1);
@@ -83,7 +82,7 @@
// Interest with invalid NextHopFaceId
shared_ptr<Interest> interest3 = makeInterest("ndn:/0z8r6yDDe");
- interest3->setNextHopFaceId(face3->getId());
+ interest3->setTag(make_shared<lp::NextHopFaceIdTag>(face3->getId()));
shared_ptr<pit::Entry> pitEntry3 = pit.insert(*interest3).first;
pitEntry3->insertOrUpdateInRecord(face4, *interest3);
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index e40b5ad..67bce49 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -68,7 +68,8 @@
BOOST_CHECK_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
BOOST_REQUIRE_EQUAL(face2->m_sentInterests.size(), 1);
BOOST_CHECK_EQUAL(face2->m_sentInterests[0].getName(), nameAB);
- BOOST_CHECK_EQUAL(face2->m_sentInterests[0].getIncomingFaceId(), face1->getId());
+ BOOST_REQUIRE(face2->m_sentInterests[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
+ BOOST_CHECK_EQUAL(*face2->m_sentInterests[0].getTag<lp::IncomingFaceIdTag>(), face1->getId());
BOOST_CHECK_EQUAL(forwarder.getCounters().nInInterests, 1);
BOOST_CHECK_EQUAL(forwarder.getCounters().nOutInterests, 1);
@@ -78,7 +79,8 @@
BOOST_CHECK_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
BOOST_REQUIRE_EQUAL(face1->m_sentDatas.size(), 1);
BOOST_CHECK_EQUAL(face1->m_sentDatas[0].getName(), nameABC);
- BOOST_CHECK_EQUAL(face1->m_sentDatas[0].getIncomingFaceId(), face2->getId());
+ BOOST_REQUIRE(face1->m_sentDatas[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
+ BOOST_CHECK_EQUAL(*face1->m_sentDatas[0].getTag<lp::IncomingFaceIdTag>(), face2->getId());
BOOST_CHECK_EQUAL(forwarder.getCounters().nInData, 1);
BOOST_CHECK_EQUAL(forwarder.getCounters().nOutData, 1);
}
@@ -98,7 +100,7 @@
shared_ptr<Interest> interestA = makeInterest("ndn:/A");
interestA->setInterestLifetime(time::seconds(4));
shared_ptr<Data> dataA = makeData("ndn:/A");
- dataA->setIncomingFaceId(face3->getId());
+ dataA->setTag(make_shared<lp::IncomingFaceIdTag>(face3->getId()));
Fib& fib = forwarder.getFib();
shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
@@ -117,7 +119,8 @@
BOOST_REQUIRE_EQUAL(face1->m_sentDatas.size(), 1);
// IncomingFaceId field should be reset to represent CS
- BOOST_CHECK_EQUAL(face1->m_sentDatas[0].getIncomingFaceId(), FACEID_CONTENT_STORE);
+ BOOST_REQUIRE(face1->m_sentDatas[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
+ BOOST_CHECK_EQUAL(*face1->m_sentDatas[0].getTag<lp::IncomingFaceIdTag>(), FACEID_CONTENT_STORE);
limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(500));
// PIT entry should not be left behind