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/core/face-uri.cpp b/core/face-uri.cpp
index 7eaaddd..1b2092c 100644
--- a/core/face-uri.cpp
+++ b/core/face-uri.cpp
@@ -70,7 +70,7 @@
// pattern for IPv6 address enclosed in [ ], with optional port number
static const boost::regex v6Exp("^\\[([a-fA-F0-9:]+)\\](?:\\:(\\d+))?$");
// pattern for Ethernet address in standard hex-digits-and-colons notation
- static const boost::regex etherExp("^((?:[a-fA-F0-9]{1,2}\\:){5}(?:[a-fA-F0-9]{1,2}))$");
+ static const boost::regex etherExp("^\\[((?:[a-fA-F0-9]{1,2}\\:){5}(?:[a-fA-F0-9]{1,2}))\\]$");
// pattern for IPv4/hostname/fd/ifname, with optional port number
static const boost::regex v4HostExp("^([^:]+)(?:\\:(\\d+))?$");
@@ -132,7 +132,7 @@
#ifdef HAVE_LIBPCAP
FaceUri::FaceUri(const ethernet::Address& address)
- : m_isV6(false)
+ : m_isV6(true)
{
m_scheme = "ether";
m_host = address.toString();