tools: display EndpointId in 'nfdc fib list'

Refs: #4816
Change-Id: Id656939d9595adbd8c96a78e9aedfdd8dda2a555
This commit is contained in:
Ju Pan committed 2019-06-19 12:08:43 -07:00
1 parent 602c3aaa56
commit 13839ac94a
4 files changed
+35 -12

No files matched your search

+9 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2018, Regents of the University of California,
* Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -65,6 +65,7 @@ FibModule::formatItemXml(std::ostream& os, const FibEntry& item) const
for (const NextHopRecord& nh : item.getNextHopRecords()) {
os << "<nextHop>"
<< "<faceId>" << nh.getFaceId() << "</faceId>"
<< "<endpointId>" << (nh.hasEndpointId() ? nh.getEndpointId() : 0) << "</endpointId>"
<< "<cost>" << nh.getCost() << "</cost>"
<< "</nextHop>";
}
@@ -90,8 +91,13 @@ FibModule::formatItemText(std::ostream& os, const FibEntry& item) const
text::Separator sep(", ");
for (const NextHopRecord& nh : item.getNextHopRecords()) {
os << sep
<< "faceid=" << nh.getFaceId()
<< " (cost=" << nh.getCost() << ")";
<< "face=" << nh.getFaceId();
if (nh.hasEndpointId() && nh.getEndpointId() != 0) {
os << ":" << nh.getEndpointId();
}
os << " (cost=" << nh.getCost() << ")";
}
os << "}";