rib: Rename FaceEntry to Route
refs: #2159
Change-Id: Ia324a47816cac514dacc4a69a29fd30d08932e5b
diff --git a/tests/rib/fib-updates-common.hpp b/tests/rib/fib-updates-common.hpp
index c8c0af4..f3edd8f 100644
--- a/tests/rib/fib-updates-common.hpp
+++ b/tests/rib/fib-updates-common.hpp
@@ -27,10 +27,10 @@
namespace rib {
namespace tests {
-inline FaceEntry
-createFaceEntry(uint64_t faceId, uint64_t origin, uint64_t cost, uint64_t flags)
+inline Route
+createRoute(uint64_t faceId, uint64_t origin, uint64_t cost, uint64_t flags)
{
- FaceEntry temp;
+ Route temp;
temp.faceId = faceId;
temp.origin = origin;
temp.cost = cost;
@@ -73,25 +73,25 @@
{
public:
void
- insertFaceEntry(const Name& name, uint64_t faceId, uint64_t origin, uint64_t cost, uint64_t flags)
+ insertRoute(const Name& name, uint64_t faceId, uint64_t origin, uint64_t cost, uint64_t flags)
{
- rib::FaceEntry faceEntry;
- faceEntry.faceId = faceId;
- faceEntry.origin = origin;
- faceEntry.cost = cost;
- faceEntry.flags = flags;
+ rib::Route route;
+ route.faceId = faceId;
+ route.origin = origin;
+ route.cost = cost;
+ route.flags = flags;
- rib.insert(name, faceEntry);
+ rib.insert(name, route);
}
void
- eraseFaceEntry(const Name& name, uint64_t faceId, uint64_t origin)
+ eraseRoute(const Name& name, uint64_t faceId, uint64_t origin)
{
- rib::FaceEntry faceEntry;
- faceEntry.faceId = faceId;
- faceEntry.origin = origin;
+ rib::Route route;
+ route.faceId = faceId;
+ route.origin = origin;
- rib.erase(name, faceEntry);
+ rib.erase(name, route);
}
diff --git a/tests/rib/fib-updates-erase-face.cpp b/tests/rib/fib-updates-erase-face.cpp
index e56c0d3..1a98847 100644
--- a/tests/rib/fib-updates-erase-face.cpp
+++ b/tests/rib/fib-updates-erase-face.cpp
@@ -38,15 +38,15 @@
BOOST_AUTO_TEST_CASE(WithInheritedFace_Root)
{
- insertFaceEntry("/", 1, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 2, 0, 75, 0);
+ insertRoute("/", 1, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 2, 0, 75, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 1 updates: 1 to remove face 1 from /
- eraseFaceEntry("/", 1, 0);
+ eraseRoute("/", 1, 0);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -59,20 +59,20 @@
BOOST_AUTO_TEST_CASE(WithInheritedFace)
{
- insertFaceEntry("/a", 5, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 5, 255, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 20, 0);
- insertFaceEntry("/a/b", 3, 0, 5, 0);
+ insertRoute("/a", 5, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 5, 255, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 20, 0);
+ insertRoute("/a/b", 3, 0, 5, 0);
// /a should have face 5 with cost 10; /a/b should have face 3 with cost 5 and
// face 5 with cost 10
- eraseFaceEntry("/a", 5, 255);
+ eraseRoute("/a", 5, 255);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
- // Should generate 2 updates: 1 to remove face 3 from /a/b and one to remove inherited face.
- eraseFaceEntry("/a/b", 3, 0);
+ // Should generate 2 updates: 1 to remove face 3 from /a/b and one to remove inherited route
+ eraseRoute("/a/b", 3, 0);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -90,14 +90,14 @@
BOOST_AUTO_TEST_CASE(MultipleFaces)
{
- insertFaceEntry("/a", 5, 0, 10, 0);
- insertFaceEntry("/a", 5, 255, 5, 0);
+ insertRoute("/a", 5, 0, 10, 0);
+ insertRoute("/a", 5, 255, 5, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 1 updates: 1 to update cost to 10 for /a
- eraseFaceEntry("/a", 5, 255);
+ eraseRoute("/a", 5, 255);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -111,17 +111,17 @@
BOOST_AUTO_TEST_CASE(NoFlags_NoCaptureChange_NoCaptureOnRoute)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, 0);
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 100, 0);
+ insertRoute("/a", 1, 128, 50, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 1 updates: 1 to update cost for /a
- eraseFaceEntry("/a", 1, 128);
+ eraseRoute("/a", 1, 128);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -135,13 +135,13 @@
BOOST_AUTO_TEST_CASE(MakeRibEmpty)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
- // Should generate 1 updates: 1 to remove face from /
- eraseFaceEntry("/", 1, 0);
+ // Should generate 1 updates: 1 to remove route from /
+ eraseRoute("/", 1, 0);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -154,17 +154,17 @@
BOOST_AUTO_TEST_CASE(NoFlags_NoCaptureChange_CaptureOnRoute)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, 0);
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 100, 0);
+ insertRoute("/a", 1, 128, 50, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
- // Should generate 1 updates: 1 to remove face from /a
- eraseFaceEntry("/a", 1, 128);
+ // Should generate 1 updates: 1 to remove route from /a
+ eraseRoute("/a", 1, 128);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -177,19 +177,19 @@
BOOST_AUTO_TEST_CASE(BothFlags_NoCaptureChange_CaptureOnRoute)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 100, 0);
+ insertRoute("/a", 1, 128, 50, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
ndn::nfd::ROUTE_FLAG_CAPTURE));
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 2 updates: 1 to remove face1 from /a and
- // 1 to remove face1 to /a/b
- eraseFaceEntry("/a", 1, 128);
+ // 1 to remove face1 from /a/b
+ eraseRoute("/a", 1, 128);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -207,11 +207,11 @@
BOOST_AUTO_TEST_CASE(BothFlags_CaptureChange_NoCaptureOnRoute)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 100, 0);
+ insertRoute("/a", 1, 128, 50, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
ndn::nfd::ROUTE_FLAG_CAPTURE));
// Clear updates generated from previous insertions
@@ -219,7 +219,7 @@
// Should generate 2 updates: 1 to add face1 to /a and
// 1 to add face1 to /a/b
- eraseFaceEntry("/a", 1, 128);
+ eraseRoute("/a", 1, 128);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -239,17 +239,17 @@
BOOST_AUTO_TEST_CASE(ChildInherit_NoCaptureChange_NoCaptureOnRoute)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 100, 0);
+ insertRoute("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 2 updates: 2 to add face1 to /a and /a/b
- eraseFaceEntry("/a", 1, 128);
+ eraseRoute("/a", 1, 128);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -269,17 +269,17 @@
BOOST_AUTO_TEST_CASE(ChildInherit_NoCaptureChange_CaptureOnRoute)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 100, 0);
+ insertRoute("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 2 updates: 2 to remove face 1 from /a and /a/b
- eraseFaceEntry("/a", 1, 128);
+ eraseRoute("/a", 1, 128);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -297,18 +297,18 @@
BOOST_AUTO_TEST_CASE(Capture_CaptureChange_NoCaptureOnRoute)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 100, 0);
+ insertRoute("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 2 updates: 1 to update cost on /a and
// 1 to add face1 to /a/b
- eraseFaceEntry("/a", 1 ,128);
+ eraseRoute("/a", 1 ,128);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -328,17 +328,17 @@
BOOST_AUTO_TEST_CASE(Capture_NoCaptureChange_CaptureOnRoute)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 100, 0);
+ insertRoute("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
- // Should generate 1 updates: 1 to remove face from /a
- eraseFaceEntry("/a", 1, 128);
+ // Should generate 1 updates: 1 to remove route from /a
+ eraseRoute("/a", 1, 128);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -351,11 +351,11 @@
BOOST_AUTO_TEST_CASE(EraseFaceById)
{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 4, 0, 100, 0);
+ insertRoute("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
diff --git a/tests/rib/fib-updates-new-face.cpp b/tests/rib/fib-updates-new-face.cpp
index b8e7d69..4f41488 100644
--- a/tests/rib/fib-updates-new-face.cpp
+++ b/tests/rib/fib-updates-new-face.cpp
@@ -39,7 +39,7 @@
BOOST_AUTO_TEST_CASE(Basic)
{
// should generate 1 update
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
Rib::FibUpdateList updates = rib.getFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -55,7 +55,7 @@
rib.clearFibUpdates();
// should generate 2 updates
- insertFaceEntry("/a", 2, 0, 50, 0);
+ insertRoute("/a", 2, 0, 50, 0);
updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -76,7 +76,7 @@
rib.clearFibUpdates();
// should generate 2 updates
- insertFaceEntry("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/b", 3, 0, 10, 0);
updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -96,27 +96,27 @@
BOOST_AUTO_TEST_CASE(UpdateOnLowerCostNoChildInherit)
{
- insertFaceEntry("/", 1, 0, 50, 0);
+ insertRoute("/", 1, 0, 50, 0);
// Clear any updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 0 updates
- insertFaceEntry("/", 1, 128, 75, 0);
+ insertRoute("/", 1, 128, 75, 0);
BOOST_CHECK_EQUAL(rib.getFibUpdates().size(), 0);
}
BOOST_AUTO_TEST_CASE(UpdateOnLowerCostOnly)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 2 updates: to update cost for face 1 on / and /a
- insertFaceEntry("/", 1, 0, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 0, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -137,23 +137,23 @@
rib.clearFibUpdates();
// Should generate 0 updates
- insertFaceEntry("/", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
BOOST_CHECK_EQUAL(rib.getFibUpdates().size(), 0);
}
BOOST_AUTO_TEST_CASE(NoCaptureChangeWithoutChildInherit)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 1 update: 1 to add face 5 to /a
- insertFaceEntry("/a", 5, 128, 50, 0);
+ insertRoute("/a", 5, 128, 50, 0);
const Rib::FibUpdateList& updates = rib.getFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -168,17 +168,17 @@
BOOST_AUTO_TEST_CASE(NoCaptureChangeWithChildInherit)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
- // Should generate 2 updates: one for the inserted face and
- // one to add face to /a/b
- insertFaceEntry("/a", 4, 128, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ // Should generate 2 updates: one for the inserted route and
+ // one to add route to /a/b
+ insertRoute("/a", 4, 128, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -198,18 +198,18 @@
BOOST_AUTO_TEST_CASE(CaptureTurnedOnWithoutChildInherit)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, 0);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 4, 0, 10, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 3 updates:
- // - one for the inserted face for /a and
+ // - one for the inserted route for /a and
// - two to remove face1 from /a/b and /a/c
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CAPTURE);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 3);
@@ -233,18 +233,18 @@
BOOST_AUTO_TEST_CASE(CaptureTurnedOnWithChildInherit)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, 0);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 4, 0, 10, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 2 updates:
- // - one for the inserted face for /a and
+ // - one for the inserted route for /a and
// - one to update /a/b with the new cost
- insertFaceEntry("/a", 1, 128, 50, (ndn::nfd::ROUTE_FLAG_CAPTURE |
+ insertRoute("/a", 1, 128, 50, (ndn::nfd::ROUTE_FLAG_CAPTURE |
ndn::nfd::ROUTE_FLAG_CHILD_INHERIT));
Rib::FibUpdateList updates = getSortedFibUpdates();
diff --git a/tests/rib/fib-updates-new-namespace.cpp b/tests/rib/fib-updates-new-namespace.cpp
index e409c51..5339530 100644
--- a/tests/rib/fib-updates-new-namespace.cpp
+++ b/tests/rib/fib-updates-new-namespace.cpp
@@ -38,8 +38,8 @@
BOOST_AUTO_TEST_CASE(NoFlags)
{
- // No flags, empty RIB, should generate 1 update for the inserted face
- insertFaceEntry("/a/b", 1, 0, 10, 0);
+ // No flags, empty RIB, should generate 1 update for the inserted route
+ insertRoute("/a/b", 1, 0, 10, 0);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -51,18 +51,18 @@
BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
// Reset RIB
- eraseFaceEntry("/a/b", 1, 0);
+ eraseRoute("/a/b", 1, 0);
rib.clearFibUpdates();
// Parent with child inherit flag
- insertFaceEntry("/a", 2, 0, 70, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 3, 0, 30, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 70, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 3, 0, 30, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
- // Should generate 3 updates, 1 for the inserted face and 2 from inheritance
- insertFaceEntry("/a/b", 1, 0, 10, 0);
+ // Should generate 3 updates, 1 for the inserted route and 2 from inheritance
+ insertRoute("/a/b", 1, 0, 10, 0);
updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 3);
@@ -88,9 +88,8 @@
BOOST_AUTO_TEST_CASE(BothFlags)
{
- // Empty RIB, should generate 1 update for the inserted face
- insertFaceEntry("/a", 1, 0, 10, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
- ndn::nfd::ROUTE_FLAG_CAPTURE));
+ // Empty RIB, should generate 1 update for the inserted route
+ insertRoute("/a", 1, 0, 10, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT | ndn::nfd::ROUTE_FLAG_CAPTURE));
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -102,19 +101,18 @@
BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
// Reset RIB
- eraseFaceEntry("/a", 1, 0);
+ eraseRoute("/a", 1, 0);
rib.clearFibUpdates();
- insertFaceEntry("/", 2, 0, 70, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 30, 0);
+ insertRoute("/", 2, 0, 70, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 3, 0, 30, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
- // Should generate 3 updates, 1 for the inserted face, 1 to add the face to the child,
- // and 1 to remove the previously inherited entry
- insertFaceEntry("/a", 1, 0, 10, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
- ndn::nfd::ROUTE_FLAG_CAPTURE));
+ // Should generate 3 updates, 1 for the inserted route, 1 to add the route to the child,
+ // and 1 to remove the previously inherited route
+ insertRoute("/a", 1, 0, 10, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT | ndn::nfd::ROUTE_FLAG_CAPTURE));
updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 3);
@@ -139,15 +137,15 @@
BOOST_AUTO_TEST_CASE(ChildInherit)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 2, 0, 10, 0);
- insertFaceEntry("/a/c", 3, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 2, 0, 10, 0);
+ insertRoute("/a/c", 3, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
- // Should generate 2 updates: 1 for the inserted face and 1 to add the face to "/a/b"
- insertFaceEntry("/a", 1, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ // Should generate 2 updates: 1 for the inserted route and 1 to add the route to "/a/b"
+ insertRoute("/a", 1, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -167,16 +165,16 @@
BOOST_AUTO_TEST_CASE(Capture)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 2, 0, 10, 0);
- insertFaceEntry("/a/c", 3, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 2, 0, 10, 0);
+ insertRoute("/a/c", 3, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
- // Should generate 2 updates: 1 for the inserted face and
- // 1 to remove inherited face from "/a/b"
- insertFaceEntry("/a", 1, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ // Should generate 2 updates: 1 for the inserted route and
+ // 1 to remove the inherited route from "/a/b"
+ insertRoute("/a", 1, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
diff --git a/tests/rib/fib-updates-update-face.cpp b/tests/rib/fib-updates-update-face.cpp
index 13f5e21..e3dcd45 100644
--- a/tests/rib/fib-updates-update-face.cpp
+++ b/tests/rib/fib-updates-update-face.cpp
@@ -38,16 +38,16 @@
BOOST_AUTO_TEST_CASE(TurnOffChildInheritLowerCost)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/", 1, 128, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
+ insertRoute("/", 1, 128, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 2 updates: 1 to update the cost of / face 1 to 50 and
// 1 to update the cost of /a face 1 to 50
- insertFaceEntry("/", 1, 128, 75, 0);
+ insertRoute("/", 1, 128, 75, 0);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -67,15 +67,15 @@
BOOST_AUTO_TEST_CASE(UpdateOnLowerCostOnly)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/", 1, 128, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
+ insertRoute("/", 1, 128, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 0 updates
- insertFaceEntry("/", 1, 128, 75, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 128, 75, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 0);
@@ -84,7 +84,7 @@
rib.clearFibUpdates();
// Should generate 2 updates
- insertFaceEntry("/", 1, 128, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/", 1, 128, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -104,16 +104,16 @@
BOOST_AUTO_TEST_CASE(NoChangeInCost)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 0 updates
- insertFaceEntry("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 0);
@@ -121,17 +121,17 @@
BOOST_AUTO_TEST_CASE(ChangeCost)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Should generate 2 updates: 1 to add face2 with new cost to /a and
// 1 to add face2 with new cost to /a/b
- insertFaceEntry("/a", 2, 0, 300, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 300, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -151,17 +151,17 @@
BOOST_AUTO_TEST_CASE(TurnOnChildInherit)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Turn on child inherit flag for the entry in /a
// Should generate 1 updates: 1 to add face to /a/b
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -175,17 +175,17 @@
BOOST_AUTO_TEST_CASE(TurnOffChildInherit)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 1, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 2, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 25, 0);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 1, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a/b", 2, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 25, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
// Turn off child inherit flag for the entry in /a
// Should generate 1 update: 1 to add face1 to /a/b
- insertFaceEntry("/a", 1, 0, 100, 0);
+ insertRoute("/a", 1, 0, 100, 0);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 1);
@@ -199,10 +199,10 @@
BOOST_AUTO_TEST_CASE(TurnOnCapture)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 10, 0);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, 0);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 10, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
@@ -210,7 +210,7 @@
// Turn on capture flag for the entry in /a
// Should generate 2 updates: 1 to remove face1 from /a and
// 1 to remove face1 from /a/b
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
@@ -228,10 +228,10 @@
BOOST_AUTO_TEST_CASE(TurnOffCapture)
{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 10, 0);
+ insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
+ insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
+ insertRoute("/a/b", 3, 0, 10, 0);
+ insertRoute("/a/c", 1, 0, 10, 0);
// Clear updates generated from previous insertions
rib.clearFibUpdates();
@@ -239,7 +239,7 @@
// Turn off capture flag for the entry in /a
// Should generate 2 updates: 1 to add face1 to /a and
// 1 to add face1 to /a/b
- insertFaceEntry("/a", 2, 0, 10, 0);
+ insertRoute("/a", 2, 0, 10, 0);
Rib::FibUpdateList updates = getSortedFibUpdates();
BOOST_REQUIRE_EQUAL(updates.size(), 2);
diff --git a/tests/rib/remote-registrator.cpp b/tests/rib/remote-registrator.cpp
index ed3181a..8e30218 100644
--- a/tests/rib/remote-registrator.cpp
+++ b/tests/rib/remote-registrator.cpp
@@ -104,10 +104,10 @@
{
BOOST_CHECK_EQUAL(addIdentity(identity), true);
- FaceEntry faceEntry;
- faceEntry.faceId = faceId;
+ Route route;
+ route.faceId = faceId;
- rib.insert(identity.append(appName), faceEntry);
+ rib.insert(identity.append(appName), route);
advanceClocks(time::milliseconds(1));
}
@@ -117,10 +117,10 @@
name::Component appName = DEFAULT_APP_NAME,
uint64_t faceId = 0)
{
- FaceEntry faceEntry;
- faceEntry.faceId = faceId;
+ Route route;
+ route.faceId = faceId;
- rib.insert(identity.append(appName), faceEntry);
+ rib.insert(identity.append(appName), route);
advanceClocks(time::milliseconds(1));
}
@@ -132,10 +132,10 @@
{
BOOST_CHECK_EQUAL(addIdentity(identity), true);
- FaceEntry faceEntry;
- faceEntry.faceId = faceId;
+ Route route;
+ route.faceId = faceId;
- rib.erase(identity.append(appName), faceEntry);
+ rib.erase(identity.append(appName), route);
advanceClocks(time::milliseconds(1));
}
@@ -145,10 +145,10 @@
name::Component appName = DEFAULT_APP_NAME,
uint64_t faceId = 0)
{
- FaceEntry faceEntry;
- faceEntry.faceId = faceId;
+ Route route;
+ route.faceId = faceId;
- rib.erase(identity.append(appName), faceEntry);
+ rib.erase(identity.append(appName), route);
advanceClocks(time::milliseconds(1));
}
@@ -164,7 +164,7 @@
void
connectToHub()
{
- rib.insert(COMMAND_PREFIX, FaceEntry());
+ rib.insert(COMMAND_PREFIX, Route());
advanceClocks(time::milliseconds(1));
}
@@ -172,7 +172,7 @@
void
disconnectToHub()
{
- rib.erase(COMMAND_PREFIX, FaceEntry());
+ rib.erase(COMMAND_PREFIX, Route());
advanceClocks(time::milliseconds(1));
}
diff --git a/tests/rib/rib-manager.cpp b/tests/rib/rib-manager.cpp
index 39a4a5d..cca1659 100644
--- a/tests/rib/rib-manager.cpp
+++ b/tests/rib/rib-manager.cpp
@@ -234,20 +234,20 @@
BOOST_FIXTURE_TEST_CASE(RibStatusRequest, AuthorizedRibManager)
{
- FaceEntry entry;
+ Route route;
Name name("/");
- entry.faceId = 1;
- entry.origin = 128;
- entry.cost = 32;
- entry.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
+ route.faceId = 1;
+ route.origin = 128;
+ route.cost = 32;
+ route.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
ControlParameters parameters;
parameters
.setName(name)
- .setFaceId(entry.faceId)
- .setOrigin(entry.origin)
- .setCost(entry.cost)
- .setFlags(entry.flags)
+ .setFaceId(route.faceId)
+ .setOrigin(route.origin)
+ .setCost(route.cost)
+ .setFlags(route.flags)
.setExpirationPeriod(ndn::time::milliseconds::max());
Name commandName("/localhost/nfd/rib/register");
@@ -262,7 +262,7 @@
face->processEvents(time::milliseconds(1));
BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
- RibStatusPublisherFixture::decodeRibEntryBlock(face->sentDatas[0], name, entry);
+ RibStatusPublisherFixture::decodeRibEntryBlock(face->sentDatas[0], name, route);
}
BOOST_FIXTURE_TEST_CASE(CancelExpirationEvent, AuthorizedRibManager)
diff --git a/tests/rib/rib-status-publisher-common.hpp b/tests/rib/rib-status-publisher-common.hpp
index 58ccd68..a0f1f42 100644
--- a/tests/rib/rib-status-publisher-common.hpp
+++ b/tests/rib/rib-status-publisher-common.hpp
@@ -45,7 +45,7 @@
{
public:
static void
- validateRibEntry(const Block& block, const Name& referenceName, const FaceEntry& referenceFace)
+ validateRibEntry(const Block& block, const Name& referenceName, const Route& referenceRoute)
{
ndn::nfd::RibEntry entry;
BOOST_REQUIRE_NO_THROW(entry.wireDecode(block));
@@ -55,14 +55,14 @@
std::list<ndn::nfd::Route> routes = entry.getRoutes();
std::list<ndn::nfd::Route>::iterator it = routes.begin();
- BOOST_CHECK_EQUAL(it->getFaceId(), referenceFace.faceId);
- BOOST_CHECK_EQUAL(it->getOrigin(), referenceFace.origin);
- BOOST_CHECK_EQUAL(it->getCost(), referenceFace.cost);
- BOOST_CHECK_EQUAL(it->getFlags(), referenceFace.flags);
+ BOOST_CHECK_EQUAL(it->getFaceId(), referenceRoute.faceId);
+ BOOST_CHECK_EQUAL(it->getOrigin(), referenceRoute.origin);
+ BOOST_CHECK_EQUAL(it->getCost(), referenceRoute.cost);
+ BOOST_CHECK_EQUAL(it->getFlags(), referenceRoute.flags);
}
static void
- decodeRibEntryBlock(const Data& data, const Name& referenceName, const FaceEntry& referenceFace)
+ decodeRibEntryBlock(const Data& data, const Name& referenceName, const Route& referenceRoute)
{
ndn::EncodingBuffer buffer;
@@ -81,7 +81,7 @@
BOOST_FAIL("expected RibEntry, got type #" << i->type());
}
else {
- validateRibEntry(*i, referenceName, referenceFace);
+ validateRibEntry(*i, referenceName, referenceRoute);
}
}
};
diff --git a/tests/rib/rib-status-publisher.cpp b/tests/rib/rib-status-publisher.cpp
index b1414cc..1f81900 100644
--- a/tests/rib/rib-status-publisher.cpp
+++ b/tests/rib/rib-status-publisher.cpp
@@ -39,13 +39,13 @@
{
Rib rib;
- FaceEntry entry;
+ Route route;
Name name("/");
- entry.faceId = 1;
- entry.origin = 128;
- entry.cost = 32;
- entry.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
- rib.insert(name, entry);
+ route.faceId = 1;
+ route.origin = 128;
+ route.cost = 32;
+ route.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
+ rib.insert(name, route);
ndn::KeyChain keyChain;
shared_ptr<ndn::util::DummyClientFace> face = ndn::util::makeDummyClientFace();
@@ -55,7 +55,7 @@
face->processEvents(time::milliseconds(1));
BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
- decodeRibEntryBlock(face->sentDatas[0], name, entry);
+ decodeRibEntryBlock(face->sentDatas[0], name, route);
}
diff --git a/tests/rib/rib.cpp b/tests/rib/rib.cpp
index 3226e57..3427c95 100644
--- a/tests/rib/rib.cpp
+++ b/tests/rib/rib.cpp
@@ -37,102 +37,102 @@
{
rib::RibEntry entry;
- rib::FaceEntry face1;
- face1.faceId = 1;
- face1.origin = 0;
+ rib::Route route1;
+ route1.faceId = 1;
+ route1.origin = 0;
- entry.insertFace(face1);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 1);
+ entry.insertRoute(route1);
+ BOOST_CHECK_EQUAL(entry.getRoutes().size(), 1);
- FaceEntry face2;
- face2.faceId = 1;
- face2.origin = 128;
+ Route route2;
+ route2.faceId = 1;
+ route2.origin = 128;
- entry.insertFace(face2);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 2);
+ entry.insertRoute(route2);
+ BOOST_CHECK_EQUAL(entry.getRoutes().size(), 2);
- entry.eraseFace(face1);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 1);
+ entry.eraseRoute(route1);
+ BOOST_CHECK_EQUAL(entry.getRoutes().size(), 1);
- BOOST_CHECK(entry.findFace(face1) == entry.getFaces().end());
- BOOST_CHECK(entry.findFace(face2) != entry.getFaces().end());
+ BOOST_CHECK(entry.findRoute(route1) == entry.getRoutes().end());
+ BOOST_CHECK(entry.findRoute(route2) != entry.getRoutes().end());
- entry.insertFace(face2);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 1);
+ entry.insertRoute(route2);
+ BOOST_CHECK_EQUAL(entry.getRoutes().size(), 1);
- entry.eraseFace(face1);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 1);
- BOOST_CHECK(entry.findFace(face2) != entry.getFaces().end());
+ entry.eraseRoute(route1);
+ BOOST_CHECK_EQUAL(entry.getRoutes().size(), 1);
+ BOOST_CHECK(entry.findRoute(route2) != entry.getRoutes().end());
}
BOOST_AUTO_TEST_CASE(Parent)
{
rib::Rib rib;
- FaceEntry root;
+ Route root;
Name name1("/");
root.faceId = 1;
root.origin = 20;
rib.insert(name1, root);
- FaceEntry entry1;
+ Route route1;
Name name2("/hello");
- entry1.faceId = 2;
- entry1.origin = 20;
- rib.insert(name2, entry1);
+ route1.faceId = 2;
+ route1.origin = 20;
+ rib.insert(name2, route1);
- FaceEntry entry2;
+ Route route2;
Name name3("/hello/world");
- entry2.faceId = 3;
- entry2.origin = 20;
- rib.insert(name3, entry2);
+ route2.faceId = 3;
+ route2.origin = 20;
+ rib.insert(name3, route2);
shared_ptr<rib::RibEntry> ribEntry = rib.findParent(name3);
BOOST_REQUIRE(static_cast<bool>(ribEntry));
- BOOST_CHECK_EQUAL(ribEntry->getFaces().front().faceId, 2);
+ BOOST_CHECK_EQUAL(ribEntry->getRoutes().front().faceId, 2);
ribEntry = rib.findParent(name2);
BOOST_REQUIRE(static_cast<bool>(ribEntry));
- BOOST_CHECK_EQUAL(ribEntry->getFaces().front().faceId, 1);
+ BOOST_CHECK_EQUAL(ribEntry->getRoutes().front().faceId, 1);
- FaceEntry entry3;
+ Route route3;
Name name4("/hello/test/foo/bar");
- entry2.faceId = 3;
- entry2.origin = 20;
- rib.insert(name4, entry3);
+ route2.faceId = 3;
+ route2.origin = 20;
+ rib.insert(name4, route3);
ribEntry = rib.findParent(name4);
BOOST_CHECK(ribEntry != shared_ptr<rib::RibEntry>());
- BOOST_CHECK(ribEntry->getFaces().front().faceId == 2);
+ BOOST_CHECK(ribEntry->getRoutes().front().faceId == 2);
}
BOOST_AUTO_TEST_CASE(Children)
{
rib::Rib rib;
- FaceEntry entry1;
+ Route route1;
Name name1("/");
- entry1.faceId = 1;
- entry1.origin = 20;
- rib.insert(name1, entry1);
+ route1.faceId = 1;
+ route1.origin = 20;
+ rib.insert(name1, route1);
- FaceEntry entry2;
+ Route route2;
Name name2("/hello/world");
- entry2.faceId = 2;
- entry2.origin = 20;
- rib.insert(name2, entry2);
+ route2.faceId = 2;
+ route2.origin = 20;
+ rib.insert(name2, route2);
- FaceEntry entry3;
+ Route route3;
Name name3("/hello/test/foo/bar");
- entry3.faceId = 3;
- entry3.origin = 20;
- rib.insert(name3, entry3);
+ route3.faceId = 3;
+ route3.origin = 20;
+ rib.insert(name3, route3);
BOOST_CHECK_EQUAL((rib.find(name1)->second)->getChildren().size(), 2);
BOOST_CHECK_EQUAL((rib.find(name2)->second)->getChildren().size(), 0);
BOOST_CHECK_EQUAL((rib.find(name3)->second)->getChildren().size(), 0);
- FaceEntry entry4;
+ Route entry4;
Name name4("/hello");
entry4.faceId = 4;
entry4.origin = 20;
@@ -156,41 +156,41 @@
{
rib::Rib rib;
- FaceEntry entry1;
+ Route route1;
Name name1("/");
- entry1.faceId = 1;
- entry1.origin = 20;
- rib.insert(name1, entry1);
+ route1.faceId = 1;
+ route1.origin = 20;
+ rib.insert(name1, route1);
- FaceEntry entry2;
+ Route route2;
Name name2("/hello/world");
- entry2.faceId = 2;
- entry2.origin = 20;
- rib.insert(name2, entry2);
+ route2.faceId = 2;
+ route2.origin = 20;
+ rib.insert(name2, route2);
- FaceEntry entry3;
+ Route route3;
Name name3("/hello/world");
- entry3.faceId = 1;
- entry3.origin = 20;
- rib.insert(name3, entry3);
+ route3.faceId = 1;
+ route3.origin = 20;
+ rib.insert(name3, route3);
- FaceEntry entry4;
+ Route entry4;
Name name4("/not/inserted");
entry4.faceId = 1;
entry4.origin = 20;
rib.erase(name4, entry4);
- rib.erase(name1, entry1);
+ rib.erase(name1, route1);
BOOST_CHECK(rib.find(name1) == rib.end());
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().size(), 2);
+ BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().size(), 2);
- rib.erase(name2, entry2);
+ rib.erase(name2, route2);
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().size(), 1);
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().front().faceId, 1);
+ BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().size(), 1);
+ BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().front().faceId, 1);
- rib.erase(name3, entry3);
+ rib.erase(name3, route3);
BOOST_CHECK(rib.find(name2) == rib.end());
@@ -201,23 +201,23 @@
{
rib::Rib rib;
- FaceEntry entry1;
+ Route route1;
Name name1("/");
- entry1.faceId = 1;
- entry1.origin = 20;
- rib.insert(name1, entry1);
+ route1.faceId = 1;
+ route1.origin = 20;
+ rib.insert(name1, route1);
- FaceEntry entry2;
+ Route route2;
Name name2("/hello");
- entry2.faceId = 2;
- entry2.origin = 20;
- rib.insert(name2, entry2);
+ route2.faceId = 2;
+ route2.origin = 20;
+ rib.insert(name2, route2);
- FaceEntry entry3;
+ Route route3;
Name name3("/hello/world");
- entry3.faceId = 1;
- entry3.origin = 20;
- rib.insert(name3, entry3);
+ route3.faceId = 1;
+ route3.origin = 20;
+ rib.insert(name3, route3);
shared_ptr<rib::RibEntry> ribEntry1 = rib.find(name1)->second;
shared_ptr<rib::RibEntry> ribEntry2 = rib.find(name2)->second;
@@ -226,7 +226,7 @@
BOOST_CHECK(ribEntry1->getChildren().front() == ribEntry2);
BOOST_CHECK(ribEntry3->getParent() == ribEntry2);
- rib.erase(name2, entry2);
+ rib.erase(name2, route2);
BOOST_CHECK(ribEntry1->getChildren().front() == ribEntry3);
BOOST_CHECK(ribEntry3->getParent() == ribEntry1);
}
@@ -235,30 +235,30 @@
{
rib::Rib rib;
- FaceEntry entry1;
+ Route route1;
Name name1("/");
- entry1.faceId = 1;
- entry1.origin = 20;
- rib.insert(name1, entry1);
+ route1.faceId = 1;
+ route1.origin = 20;
+ rib.insert(name1, route1);
- FaceEntry entry2;
+ Route route2;
Name name2("/hello/world");
- entry2.faceId = 2;
- entry2.origin = 20;
- rib.insert(name2, entry2);
+ route2.faceId = 2;
+ route2.origin = 20;
+ rib.insert(name2, route2);
- FaceEntry entry3;
+ Route route3;
Name name3("/hello/world");
- entry3.faceId = 1;
- entry3.origin = 20;
- rib.insert(name3, entry3);
+ route3.faceId = 1;
+ route3.origin = 20;
+ rib.insert(name3, route3);
rib.erase(1);
BOOST_CHECK(rib.find(name1) == rib.end());
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().size(), 1);
+ BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().size(), 1);
rib.erase(3);
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().size(), 1);
+ BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().size(), 1);
rib.erase(2);
BOOST_CHECK(rib.find(name2) == rib.end());
@@ -270,61 +270,61 @@
{
rib::Rib rib;
- FaceEntry entry1;
+ Route route1;
Name name1("/hello/world");
- entry1.faceId = 1;
- entry1.origin = 20;
- entry1.cost = 10;
- entry1.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT | ndn::nfd::ROUTE_FLAG_CAPTURE;
- entry1.expires = time::steady_clock::now() + time::milliseconds(1500);
+ route1.faceId = 1;
+ route1.origin = 20;
+ route1.cost = 10;
+ route1.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT | ndn::nfd::ROUTE_FLAG_CAPTURE;
+ route1.expires = time::steady_clock::now() + time::milliseconds(1500);
- rib.insert(name1, entry1);
+ rib.insert(name1, route1);
BOOST_CHECK_EQUAL(rib.size(), 1);
- rib.insert(name1, entry1);
+ rib.insert(name1, route1);
BOOST_CHECK_EQUAL(rib.size(), 1);
- FaceEntry entry2;
+ Route route2;
Name name2("/hello/world");
- entry2.faceId = 1;
- entry2.origin = 20;
- entry2.cost = 100;
- entry2.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT;
- entry2.expires = time::steady_clock::now() + time::seconds(0);
+ route2.faceId = 1;
+ route2.origin = 20;
+ route2.cost = 100;
+ route2.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT;
+ route2.expires = time::steady_clock::now() + time::seconds(0);
- rib.insert(name2, entry2);
+ rib.insert(name2, route2);
BOOST_CHECK_EQUAL(rib.size(), 1);
- entry2.faceId = 2;
- rib.insert(name2, entry2);
+ route2.faceId = 2;
+ rib.insert(name2, route2);
BOOST_CHECK_EQUAL(rib.size(), 2);
- BOOST_CHECK(rib.find(name1)->second->hasFaceId(entry1.faceId));
- BOOST_CHECK(rib.find(name1)->second->hasFaceId(entry2.faceId));
+ BOOST_CHECK(rib.find(name1)->second->hasFaceId(route1.faceId));
+ BOOST_CHECK(rib.find(name1)->second->hasFaceId(route2.faceId));
Name name3("/foo/bar");
- rib.insert(name3, entry2);
+ rib.insert(name3, route2);
BOOST_CHECK_EQUAL(rib.size(), 3);
- entry2.origin = 1;
- rib.insert(name3, entry2);
+ route2.origin = 1;
+ rib.insert(name3, route2);
BOOST_CHECK_EQUAL(rib.size(), 4);
- rib.erase(name3, entry2);
+ rib.erase(name3, route2);
BOOST_CHECK_EQUAL(rib.size(), 3);
Name name4("/hello/world");
- rib.erase(name4, entry2);
+ rib.erase(name4, route2);
BOOST_CHECK_EQUAL(rib.size(), 3);
- entry2.origin = 20;
- rib.erase(name4, entry2);
+ route2.origin = 20;
+ rib.erase(name4, route2);
BOOST_CHECK_EQUAL(rib.size(), 2);
- BOOST_CHECK_EQUAL(rib.find(name2, entry2), static_cast<FaceEntry*>(0));
- BOOST_CHECK_NE(rib.find(name1, entry1), static_cast<FaceEntry*>(0));
+ BOOST_CHECK_EQUAL(rib.find(name2, route2), static_cast<Route*>(0));
+ BOOST_CHECK_NE(rib.find(name1, route1), static_cast<Route*>(0));
- rib.erase(name1, entry1);
+ rib.erase(name1, route1);
BOOST_CHECK_EQUAL(rib.size(), 1);
}