Revert "fib: add EndpointId field in NextHop record"

This reverts commit 3ad49db6eaef0d3f4a0a9bdd3356c6bb9845db57.

refs: #4973

Change-Id: I3216a55a8c4ed52cd9181f790f8ab72e44330a38
diff --git a/tests/daemon/table/cleanup.t.cpp b/tests/daemon/table/cleanup.t.cpp
index 25405a6..911de1c 100644
--- a/tests/daemon/table/cleanup.t.cpp
+++ b/tests/daemon/table/cleanup.t.cpp
@@ -49,7 +49,7 @@
     Name name = Name("/P").appendVersion(i);
 
     fib::Entry* fibEntry = fib.insert(name).first;
-    fibEntry->addOrUpdateNextHop(*face1, 0, 0);
+    fibEntry->addOrUpdateNextHop(*face1, 0);
 
     shared_ptr<Interest> interest = makeInterest(name);
     shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
@@ -88,24 +88,24 @@
   BOOST_CHECK_EQUAL(fib.size(), 0);
 
   fib::Entry* entryA = fib.insert("/A").first;
-  entryA->addOrUpdateNextHop(*face1, 0, 0);
-  entryA->addOrUpdateNextHop(*face2, 0, 0);
+  entryA->addOrUpdateNextHop(*face1, 0);
+  entryA->addOrUpdateNextHop(*face2, 0);
   // {'/A':[1,2]}
 
   fib::Entry* entryB = fib.insert("/B").first;
-  entryB->addOrUpdateNextHop(*face1, 0, 0);
+  entryB->addOrUpdateNextHop(*face1, 0);
   // {'/A':[1,2], '/B':[1]}
 
   fib::Entry* entryC = fib.insert("/C").first;
-  entryC->addOrUpdateNextHop(*face2, 0, 1);
+  entryC->addOrUpdateNextHop(*face2, 1);
   // {'/A':[1,2], '/B':[1], '/C':[2]}
 
   fib::Entry* entryB1 = fib.insert("/B/1").first;
-  entryB1->addOrUpdateNextHop(*face1, 0, 0);
+  entryB1->addOrUpdateNextHop(*face1, 0);
   // {'/A':[1,2], '/B':[1], '/B/1':[1], '/C':[2]}
 
   fib::Entry* entryB12 = fib.insert("/B/1/2").first;
-  entryB12->addOrUpdateNextHop(*face1, 0, 0);
+  entryB12->addOrUpdateNextHop(*face1, 0);
   // {'/A':[1,2], '/B':[1], '/B/1':[1], '/B/1/2':[1], '/C':[2]}
 
   // ---- close face1 ----
diff --git a/tests/daemon/table/fib.t.cpp b/tests/daemon/table/fib.t.cpp
index 6e83a95..33cbdfe 100644
--- a/tests/daemon/table/fib.t.cpp
+++ b/tests/daemon/table/fib.t.cpp
@@ -52,138 +52,71 @@
   // []
   BOOST_CHECK_EQUAL(entry.getNextHops().size(), 0);
 
-  // [(face, cost, endpointId)]
-  entry.addOrUpdateNextHop(*face1, 200, 20);
-  // [(face1,200,20)]
+  entry.addOrUpdateNextHop(*face1, 20);
+  // [(face1,20)]
   BOOST_CHECK_EQUAL(entry.getNextHops().size(), 1);
   BOOST_CHECK_EQUAL(&entry.getNextHops().begin()->getFace(), face1.get());
-  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getEndpointId(), 200);
   BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 20);
 
-  entry.addOrUpdateNextHop(*face1, 300, 30);
-  // [(face1,200,20), (face1,300,30)]
-  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 2);
+  entry.addOrUpdateNextHop(*face1, 30);
+  // [(face1,30)]
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 1);
   BOOST_CHECK_EQUAL(&entry.getNextHops().begin()->getFace(), face1.get());
-  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getEndpointId(), 200);
-  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 20);
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 30);
 
-  entry.addOrUpdateNextHop(*face2, 400, 40);
-  // [(face1,200,20), (face1,300,30), (face2,400,40)]
-  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 3);
+  entry.addOrUpdateNextHop(*face2, 40);
+  // [(face1,30), (face2,40)]
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 2);
   {
     NextHopList::const_iterator it = entry.getNextHops().begin();
     BOOST_REQUIRE(it != entry.getNextHops().end());
     BOOST_CHECK_EQUAL(&it->getFace(), face1.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 200);
-    BOOST_CHECK_EQUAL(it->getCost(), 20);
-
-    ++it;
-    BOOST_REQUIRE(it != entry.getNextHops().end());
-    BOOST_CHECK_EQUAL(&it->getFace(), face1.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 300);
     BOOST_CHECK_EQUAL(it->getCost(), 30);
 
     ++it;
     BOOST_REQUIRE(it != entry.getNextHops().end());
     BOOST_CHECK_EQUAL(&it->getFace(), face2.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 400);
     BOOST_CHECK_EQUAL(it->getCost(), 40);
 
     ++it;
     BOOST_CHECK(it == entry.getNextHops().end());
   }
 
-  entry.addOrUpdateNextHop(*face2, 100, 10);
-  // [(face2,100,10), (face1,200,20), (face1,300,30), (face2,400,40)]
-  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 4);
+  entry.addOrUpdateNextHop(*face2, 10);
+  // [(face2,10), (face1,30)]
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 2);
   {
     NextHopList::const_iterator it = entry.getNextHops().begin();
     BOOST_REQUIRE(it != entry.getNextHops().end());
     BOOST_CHECK_EQUAL(&it->getFace(), face2.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 100);
     BOOST_CHECK_EQUAL(it->getCost(), 10);
 
     ++it;
     BOOST_REQUIRE(it != entry.getNextHops().end());
     BOOST_CHECK_EQUAL(&it->getFace(), face1.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 200);
-    BOOST_CHECK_EQUAL(it->getCost(), 20);
-
-    ++it;
-    BOOST_REQUIRE(it != entry.getNextHops().end());
-    BOOST_CHECK_EQUAL(&it->getFace(), face1.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 300);
     BOOST_CHECK_EQUAL(it->getCost(), 30);
 
     ++it;
-    BOOST_REQUIRE(it != entry.getNextHops().end());
-    BOOST_CHECK_EQUAL(&it->getFace(), face2.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 400);
-    BOOST_CHECK_EQUAL(it->getCost(), 40);
-
-    ++it;
     BOOST_CHECK(it == entry.getNextHops().end());
   }
 
-  entry.addOrUpdateNextHop(*face1, 200, 50);
-  // [(face2,100,10), (face1,300,30), (face2,400,40), (face1,200,50)]
-  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 4);
-  {
-    NextHopList::const_iterator it = entry.getNextHops().begin();
-    BOOST_REQUIRE(it != entry.getNextHops().end());
-    BOOST_CHECK_EQUAL(&it->getFace(), face2.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 100);
-    BOOST_CHECK_EQUAL(it->getCost(), 10);
-
-    ++it;
-    BOOST_REQUIRE(it != entry.getNextHops().end());
-    BOOST_CHECK_EQUAL(&it->getFace(), face1.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 300);
-    BOOST_CHECK_EQUAL(it->getCost(), 30);
-
-    ++it;
-    BOOST_REQUIRE(it != entry.getNextHops().end());
-    BOOST_CHECK_EQUAL(&it->getFace(), face2.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 400);
-    BOOST_CHECK_EQUAL(it->getCost(), 40);
-
-    ++it;
-    BOOST_REQUIRE(it != entry.getNextHops().end());
-    BOOST_CHECK_EQUAL(&it->getFace(), face1.get());
-    BOOST_CHECK_EQUAL(it->getEndpointId(), 200);
-    BOOST_CHECK_EQUAL(it->getCost(), 50);
-
-    ++it;
-    BOOST_CHECK(it == entry.getNextHops().end());
-  }
-
-  entry.removeNextHop(*face1, 200);
-  // [(face2,100,10), (face1,300,30), (face2,400,40)]
-  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 3);
-  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getFace().getId(), face2->getId());
-  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getEndpointId(), 100);
-  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 10);
-
-  entry.removeNextHop(*face1, 200);
-  // [(face2,100,10), (face1,300,30), (face2,400,40)]
-  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 3);
-  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getFace().getId(), face2->getId());
-  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getEndpointId(), 100);
-  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 10);
-
-  entry.removeNextHop(*face2,100);
-  // [(face1,300,30), (face2,400,40)]
-  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 2);
-
-  entry.removeNextHop(*face2,400);
-  // [(face1,300,30)]
+  entry.removeNextHop(*face1);
+  // [(face2,10)]
   BOOST_CHECK_EQUAL(entry.getNextHops().size(), 1);
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getFace().getId(), face2->getId());
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 10);
 
-  entry.removeNextHop(*face1,300);
+  entry.removeNextHop(*face1);
+  // [(face2,10)]
+  BOOST_CHECK_EQUAL(entry.getNextHops().size(), 1);
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getFace().getId(), face2->getId());
+  BOOST_CHECK_EQUAL(entry.getNextHops().begin()->getCost(), 10);
+
+  entry.removeNextHop(*face2);
   // []
   BOOST_CHECK_EQUAL(entry.getNextHops().size(), 0);
 
-  entry.removeNextHop(*face1,300);
+  entry.removeNextHop(*face2);
   // []
   BOOST_CHECK_EQUAL(entry.getNextHops().size(), 0);
 }