rib+tools: use ndn::nfd::RouteOrigin instead of uint64_t
Change-Id: Ic8cbe95491a41e1d34b66d406da8637aeb5fd9e3
Refs: #3903
diff --git a/tools/nfdc/rib-module.cpp b/tools/nfdc/rib-module.cpp
index ffcb18c..5ca7195 100644
--- a/tools/nfdc/rib-module.cpp
+++ b/tools/nfdc/rib-module.cpp
@@ -191,7 +191,7 @@
text::ItemAttributes ia;
ctx.out << ia("prefix") << resp.getName()
<< ia("nexthop") << resp.getFaceId()
- << ia("origin") << static_cast<RouteOrigin>(resp.getOrigin())
+ << ia("origin") << resp.getOrigin()
<< ia("cost") << resp.getCost()
<< ia("flags") << static_cast<ndn::nfd::RouteFlags>(resp.getFlags());
if (resp.hasExpirationPeriod()) {
@@ -245,7 +245,7 @@
text::ItemAttributes ia;
ctx.out << ia("prefix") << resp.getName()
<< ia("nexthop") << resp.getFaceId()
- << ia("origin") << static_cast<RouteOrigin>(resp.getOrigin())
+ << ia("origin") << resp.getOrigin()
<< '\n';
},
ctx.makeCommandFailureHandler("removing route"),
@@ -290,7 +290,7 @@
for (const Route& route : item.getRoutes()) {
os << "<route>"
<< "<faceId>" << route.getFaceId() << "</faceId>"
- << "<origin>" << static_cast<RouteOrigin>(route.getOrigin()) << "</origin>"
+ << "<origin>" << route.getOrigin() << "</origin>"
<< "<cost>" << route.getCost() << "</cost>";
if (route.getFlags() == ndn::nfd::ROUTE_FLAGS_NONE) {
os << "<flags/>";
@@ -352,14 +352,9 @@
os << ia("prefix") << entry.getName();
}
os << ia("nexthop") << route.getFaceId();
- os << ia("origin") << static_cast<RouteOrigin>(route.getOrigin());
+ os << ia("origin") << route.getOrigin();
os << ia("cost") << route.getCost();
os << ia("flags") << static_cast<ndn::nfd::RouteFlags>(route.getFlags());
-
- // 'origin' field is printed as a number, because printing 'origin' as string may mislead user
- // into passing strings to 'origin' command line argument which currently only accepts numbers.
- ///\todo #3987 print 'origin' with RouteOrigin stream insertion operator
-
if (route.hasExpirationPeriod()) {
os << ia("expires") << text::formatDuration(route.getExpirationPeriod());
}