tools: Visualizing local and on-demand Face flags

Change-Id: I639da99bc009777c316b52333f7a8bc4d9b02c7a
Refs: #1716
diff --git a/docs/_static/nfd-status.xsd b/docs/_static/nfd-status.xsd
index 8420511..8f9f7cf 100644
--- a/docs/_static/nfd-status.xsd
+++ b/docs/_static/nfd-status.xsd
@@ -45,12 +45,20 @@
   </xs:sequence>
 </xs:complexType>
 
+<xs:complexType name="faceFlagsType">
+  <xs:sequence>
+    <xs:element type="xs:string" name="local" maxOccurs="1" minOccurs="0"/>
+    <xs:element type="xs:string" name="on-demand" maxOccurs="1" minOccurs="0"/>
+  </xs:sequence>
+</xs:complexType>
+
 <xs:complexType name="faceType">
   <xs:sequence>
     <xs:element type="xs:nonNegativeInteger" name="faceId"/>
     <xs:element type="xs:anyURI" name="remoteUri"/>
     <xs:element type="xs:anyURI" name="localUri"/>
     <xs:element type="nfd:bidirectionalPacketCountersType" name="packetCounters"/>
+    <xs:element type="nfd:faceFlagsType" name="flags" maxOccurs="1" minOccurs="0"/>
   </xs:sequence>
 </xs:complexType>
 
diff --git a/tools/nfd-status.cpp b/tools/nfd-status.cpp
index 7736fc8..5d35108 100644
--- a/tools/nfd-status.cpp
+++ b/tools/nfd-status.cpp
@@ -383,6 +383,17 @@
                       << "</nDatas>";
             std::cout << "</outgoingPackets>";
             std::cout << "</packetCounters>";
+
+            if (faceStatus.getFlags() != 0) {
+              std::cout << "<flags>";
+              if (faceStatus.isLocal()) {
+                std::cout << "<local/>";
+              }
+              if (faceStatus.isOnDemand()) {
+                std::cout << "<on-demand/>";
+              }
+              std::cout << "</flags>";
+            }
             std::cout << "</face>";
           }
         std::cout << "</faces>";
@@ -414,7 +425,12 @@
                       << faceStatus.getNInDatas() << "d}"
                       << " out={" << faceStatus.getNOutInterests() << "i "
                       << faceStatus.getNOutDatas() << "d}"
-                      << "}" << std::endl;
+                      << "}";
+            if (faceStatus.isLocal())
+              std::cout << " local";
+            if (faceStatus.isOnDemand())
+              std::cout << " on-demand";
+            std::cout << std::endl;
           }
        }