tools: include the key name in keylocator as the NFD id in nfd-status
refs #1807
Change-Id: I28f17c459efb720f957f33a6fc27a55edde719ea
diff --git a/tools/nfd-status-http-server-files/nfd-status.xsl b/tools/nfd-status-http-server-files/nfd-status.xsl
index e7cc55a..031f273 100644
--- a/tools/nfd-status-http-server-files/nfd-status.xsl
+++ b/tools/nfd-status-http-server-files/nfd-status.xsl
@@ -72,6 +72,7 @@
<table class="item-list">
<thead>
<tr>
+ <th>NFD ID</th>
<th>Version</th>
<th>Start time</th>
<th>Current time</th>
@@ -89,6 +90,7 @@
</thead>
<tbody>
<tr class="center">
+ <td><xsl:apply-templates select="nfd:nfdId"/></td>
<td><xsl:apply-templates select="nfd:version"/></td>
<td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:startTime" /></xsl:call-template></td>
<td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:currentTime" /></xsl:call-template></td>
diff --git a/tools/nfd-status.cpp b/tools/nfd-status.cpp
index 3262a28..219e53d 100644
--- a/tools/nfd-status.cpp
+++ b/tools/nfd-status.cpp
@@ -184,9 +184,20 @@
afterFetchedVersionInformation(const Data& data)
{
nfd::ForwarderStatus status(data.getContent());
+ std::string nfdId;
+ if (data.getSignature().hasKeyLocator())
+ {
+ const ndn::KeyLocator& locator = data.getSignature().getKeyLocator();
+ if (locator.getType() == KeyLocator::KeyLocator_Name)
+ nfdId = locator.getName().toUri();
+ //todo: KeyDigest supporting
+ }
+
if (m_isOutputXml)
{
std::cout << "<generalStatus>";
+ std::cout << "<nfdId>"
+ << nfdId << "</nfdId>";
std::cout << "<version>"
<< status.getNfdVersion() << "</version>";
std::cout << "<startTime>"
@@ -228,6 +239,8 @@
else
{
std::cout << "General NFD status:" << std::endl;
+ std::cout << " nfdId="
+ << nfdId << std::endl;
std::cout << " version="
<< status.getNfdVersion() << std::endl;
std::cout << " startTime="