tools: display EndpointId in 'nfdc fib list'

Refs: #4816
Change-Id: Id656939d9595adbd8c96a78e9aedfdd8dda2a555
diff --git a/tools/nfd-status-http-server-files/nfd-status.xsl b/tools/nfd-status-http-server-files/nfd-status.xsl
index d2015b1..f6cc338 100644
--- a/tools/nfd-status-http-server-files/nfd-status.xsl
+++ b/tools/nfd-status-http-server-files/nfd-status.xsl
@@ -252,6 +252,12 @@
               </xsl:for-each>
             </tr>
             <tr>
+              <th>EndpointId</th>
+              <xsl:for-each select="nfd:nextHops/nfd:nextHop">
+                <td><xsl:value-of select="nfd:endpointId"/></td>
+              </xsl:for-each>
+            </tr>
+            <tr>
               <th>Cost</th>
               <xsl:for-each select="nfd:nextHops/nfd:nextHop">
                 <td><xsl:value-of select="nfd:cost"/></td>
diff --git a/tools/nfdc/fib-module.cpp b/tools/nfdc/fib-module.cpp
index ef2841e..76af0aa 100644
--- a/tools/nfdc/fib-module.cpp
+++ b/tools/nfdc/fib-module.cpp
@@ -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 @@
   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 @@
   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 << "}";