tools: Showing ExpirationPeriod if it is present in FaceStatus
Change-Id: I8e5b1350179830a1d12866c02c16393068e06369
Refs: #1686
diff --git a/tools/nfd-status.cpp b/tools/nfd-status.cpp
index 5d35108..d06e8fb 100644
--- a/tools/nfd-status.cpp
+++ b/tools/nfd-status.cpp
@@ -369,6 +369,14 @@
std::string localUri(faceStatus.getLocalUri());
escapeSpecialCharacters(&localUri);
std::cout << "<localUri>" << localUri << "</localUri>";
+
+ if (faceStatus.hasExpirationPeriod()) {
+ std::cout << "<expirationPeriod>PT"
+ << time::duration_cast<time::seconds>(faceStatus.getExpirationPeriod())
+ .count() << "S"
+ << "</expirationPeriod>";
+ }
+
std::cout << "<packetCounters>";
std::cout << "<incomingPackets>";
std::cout << "<nInterests>" << faceStatus.getNInInterests()
@@ -419,8 +427,13 @@
std::cout << " faceid=" << faceStatus.getFaceId()
<< " remote=" << faceStatus.getRemoteUri()
- << " local=" << faceStatus.getLocalUri()
- << " counters={"
+ << " local=" << faceStatus.getLocalUri();
+ if (faceStatus.hasExpirationPeriod()) {
+ std::cout << " expires="
+ << time::duration_cast<time::seconds>(faceStatus.getExpirationPeriod())
+ .count() << "s";
+ }
+ std::cout << " counters={"
<< "in={" << faceStatus.getNInInterests() << "i "
<< faceStatus.getNInDatas() << "d}"
<< " out={" << faceStatus.getNOutInterests() << "i "