nfd-status: Define format and implement --xml option

The ether URI format "ether://01:00:5e:00:17:aa" violates
the URI specification, so it has been changed to
ether://[01:00:5e:00:17:aa] in this commit.

refs: #1438

Change-Id: I1218374b75f919a5e1ab158bbab2e217e64aced3
diff --git a/docs/_static/nfd-status.xsd b/docs/_static/nfd-status.xsd
new file mode 100644
index 0000000..44b5e93
--- /dev/null
+++ b/docs/_static/nfd-status.xsd
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+targetNamespace="ndn:/localhost/nfd/status/1" xmlns:nfd="ndn:/localhost/nfd/status/1"
+elementFormDefault="qualified">
+
+<xs:complexType name="unidirectionalPacketCountersType">
+  <xs:sequence>
+    <xs:element type="xs:nonNegativeInteger" name="nInterests"/>
+    <xs:element type="xs:nonNegativeInteger" name="nDatas"/>
+  </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="bidirectionalPacketCountersType">
+  <xs:sequence>
+    <xs:element type="nfd:unidirectionalPacketCountersType" name="incomingPackets"/>
+    <xs:element type="nfd:unidirectionalPacketCountersType" name="outgoingPackets"/>
+  </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="generalStatusType">
+  <xs:sequence>
+    <xs:element type="xs:string" name="version"/>
+    <xs:element type="xs:dateTime" name="startTime"/>
+    <xs:element type="xs:dateTime" name="currentTime"/>
+    <xs:element type="xs:duration" name="uptime"/>
+    <xs:element type="xs:nonNegativeInteger" name="nNameTreeEntries"/>
+    <xs:element type="xs:nonNegativeInteger" name="nFibEntries"/>
+    <xs:element type="xs:nonNegativeInteger" name="nPitEntries"/>
+    <xs:element type="xs:nonNegativeInteger" name="nMeasurementsEntries"/>
+    <xs:element type="xs:nonNegativeInteger" name="nCsEntries"/>
+    <xs:element type="nfd:bidirectionalPacketCountersType" name="packetCounters"/>
+  </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:sequence>
+</xs:complexType>
+
+<xs:complexType name="facesType">
+  <xs:sequence>
+    <xs:element type="nfd:faceType" name="face" maxOccurs="unbounded" minOccurs="0"/>
+  </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="nextHopType">
+  <xs:sequence>
+    <xs:element type="xs:nonNegativeInteger" name="faceId"/>
+    <xs:element type="xs:nonNegativeInteger" name="cost"/>
+  </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="fibEntryType">
+  <xs:sequence>
+    <xs:element type="xs:anyURI" name="prefix"/>
+    <xs:element name="nextHops">
+      <xs:complexType>
+        <xs:sequence>
+          <xs:element type="nfd:nextHopType" name="nextHop" maxOccurs="unbounded"/>
+        </xs:sequence>
+      </xs:complexType>
+    </xs:element>
+  </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="fibType">
+  <xs:sequence>
+    <xs:element type="nfd:fibEntryType" name="fibEntry" maxOccurs="unbounded" minOccurs="0"/>
+  </xs:sequence>
+</xs:complexType>
+
+<xs:element name="nfdStatus">
+  <xs:complexType>
+    <xs:sequence>
+      <xs:element type="nfd:generalStatusType" name="generalStatus"/>
+      <xs:element type="nfd:facesType" name="faces"/>
+      <xs:element type="nfd:fibType" name="fib"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:element>
+
+</xs:schema>
diff --git a/docs/manpages.rst b/docs/manpages.rst
index 3b8a496..6a52897 100644
--- a/docs/manpages.rst
+++ b/docs/manpages.rst
@@ -8,6 +8,7 @@
    manpages/nrd
    manpages/nfdc
    manpages/nfd-status
+   schema
    manpages/nfd-status-http-server
    manpages/ndn-autoconfig
    manpages/ndn-autoconfig-server
diff --git a/docs/schema.rst b/docs/schema.rst
new file mode 100644
index 0000000..08e40b7
--- /dev/null
+++ b/docs/schema.rst
@@ -0,0 +1,10 @@
+NFD Status XML Schema
+=====================
+
+The NFD status XML schema describes the structure of the NFD status XML
+document generated by command ``nfd-status``.
+
+Users can use this schema to validate the generated XML document.
+
+.. literalinclude:: _static/nfd-status.xsd
+   :language: xml