diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 5b7c08d..64d7af4 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -46,6 +46,7 @@
 #endif // HAVE_WEBSOCKET
 
 #include <ndn-cxx/management/nfd-face-event-notification.hpp>
+#include <ndn-cxx/management/nfd-face-query-filter.hpp>
 
 namespace nfd {
 
@@ -101,6 +102,11 @@
                              Name::Component("channels"),
                              &FaceManager::listChannels
                              ),
+
+    UnsignedVerbAndProcessor(
+                             Name::Component("query"),
+                             &FaceManager::listQueriedFaces
+                             ),
   };
 
 const Name FaceManager::FACES_LIST_DATASET_PREFIX("/localhost/nfd/faces/list");
@@ -111,6 +117,9 @@
 const Name FaceManager::CHANNELS_LIST_DATASET_PREFIX("/localhost/nfd/faces/channels");
 const size_t FaceManager::CHANNELS_LIST_DATASET_NCOMPS = CHANNELS_LIST_DATASET_PREFIX.size();
 
+const Name FaceManager::FACES_QUERY_DATASET_PREFIX("/localhost/nfd/faces/query");
+const size_t FaceManager::FACES_QUERY_DATASET_NCOMPS = FACES_QUERY_DATASET_PREFIX.size() + 1;
+
 FaceManager::FaceManager(FaceTable& faceTable,
                          shared_ptr<InternalFace> face,
                          ndn::KeyChain& keyChain)
@@ -1148,6 +1157,39 @@
   m_channelStatusPublisher.publish();
 }
 
+void
+FaceManager::listQueriedFaces(const Interest& request)
+{
+  NFD_LOG_DEBUG("in listQueriedFaces");
+  const Name& query = request.getName();
+  const size_t queryNComps = query.size();
+
+  if (queryNComps < FACES_QUERY_DATASET_NCOMPS ||
+      !FACES_QUERY_DATASET_PREFIX.isPrefixOf(query))
+    {
+      NFD_LOG_DEBUG("query result: malformed");
+      //sendNack(query);
+      return;
+    }
+
+  ndn::nfd::FaceQueryFilter faceFilter;
+  try
+    {
+      faceFilter.wireDecode(query[-1].blockFromValue());
+    }
+  catch (tlv::Error&)
+    {
+      NFD_LOG_DEBUG("query result: malformed filter");
+      //sendNack(query);
+      return;
+    }
+
+  FaceQueryStatusPublisher
+    faceQueryStatusPublisher(m_faceTable, *m_face, query, faceFilter, m_keyChain);
+
+  faceQueryStatusPublisher.publish();
+}
+
 shared_ptr<ProtocolFactory>
 FaceManager::findFactory(const std::string& protocol)
 {
diff --git a/daemon/mgmt/face-manager.hpp b/daemon/mgmt/face-manager.hpp
index 6a3994e..bb06f2b 100644
--- a/daemon/mgmt/face-manager.hpp
+++ b/daemon/mgmt/face-manager.hpp
@@ -32,6 +32,7 @@
 #include "mgmt/manager-base.hpp"
 #include "mgmt/face-status-publisher.hpp"
 #include "mgmt/channel-status-publisher.hpp"
+#include "mgmt/face-query-status-publisher.hpp"
 
 #include <ndn-cxx/management/nfd-control-parameters.hpp>
 #include <ndn-cxx/management/nfd-control-response.hpp>
@@ -82,6 +83,9 @@
   void
   listChannels(const Interest& request);
 
+  void
+  listQueriedFaces(const Interest& request);
+
   shared_ptr<ProtocolFactory>
   findFactory(const std::string& protocol);
 
@@ -211,6 +215,9 @@
   static const Name CHANNELS_LIST_DATASET_PREFIX;
   static const size_t CHANNELS_LIST_DATASET_NCOMPS;
 
+  static const Name FACES_QUERY_DATASET_PREFIX;
+  static const size_t FACES_QUERY_DATASET_NCOMPS;
+
   static const Name FACE_EVENTS_PREFIX;
 };
 
diff --git a/daemon/mgmt/face-query-status-publisher.cpp b/daemon/mgmt/face-query-status-publisher.cpp
new file mode 100644
index 0000000..02fd4b6
--- /dev/null
+++ b/daemon/mgmt/face-query-status-publisher.cpp
@@ -0,0 +1,110 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "face-query-status-publisher.hpp"
+#include "core/logger.hpp"
+
+#include <ndn-cxx/management/nfd-face-status.hpp>
+
+namespace nfd {
+
+NFD_LOG_INIT("FaceQueryStatusPublisher");
+
+
+FaceQueryStatusPublisher::FaceQueryStatusPublisher(const FaceTable& faceTable,
+                                                   AppFace& face,
+                                                   const Name& prefix,
+                                                   const ndn::nfd::FaceQueryFilter& filter,
+                                                   ndn::KeyChain& keyChain)
+  : SegmentPublisher(face, prefix, keyChain)
+  , m_faceTable(faceTable)
+  , m_faceFilter(filter)
+{
+}
+
+FaceQueryStatusPublisher::~FaceQueryStatusPublisher()
+{
+}
+
+bool
+FaceQueryStatusPublisher::doesMatchFilter(const shared_ptr<Face>& face)
+{
+  if (m_faceFilter.hasFaceId() &&
+      m_faceFilter.getFaceId() != static_cast<uint64_t>(face->getId())) {
+    return false;
+  }
+
+  if (m_faceFilter.hasUriScheme() &&
+      (m_faceFilter.getUriScheme() != face->getRemoteUri().getScheme() ||
+       m_faceFilter.getUriScheme() != face->getLocalUri().getScheme())) {
+    return false;
+  }
+
+  if (m_faceFilter.hasRemoteUri() &&
+      m_faceFilter.getRemoteUri() != face->getRemoteUri().toString()) {
+    return false;
+  }
+
+  if (m_faceFilter.hasLocalUri() && m_faceFilter.getLocalUri() != face->getLocalUri().toString()) {
+    return false;
+  }
+
+  if (m_faceFilter.hasFaceScope() &&
+      (m_faceFilter.getFaceScope() == ndn::nfd::FACE_SCOPE_LOCAL) != face->isLocal()) {
+    return false;
+  }
+
+  if (m_faceFilter.hasFacePersistency() &&
+      (m_faceFilter.getFacePersistency() == ndn::nfd::FACE_PERSISTENCY_ON_DEMAND) !=
+      face->isOnDemand()) {
+    return false;
+  }
+
+  if (m_faceFilter.hasLinkType() &&
+      (m_faceFilter.getLinkType() == ndn::nfd::LINK_TYPE_MULTI_ACCESS) != face->isMultiAccess()) {
+    return false;
+  }
+
+  return true;
+}
+
+size_t
+FaceQueryStatusPublisher::generate(ndn::EncodingBuffer& outBuffer)
+{
+  size_t totalLength = 0;
+
+  for (FaceTable::const_reverse_iterator i = m_faceTable.rbegin();
+       i != m_faceTable.rend(); ++i) {
+    const shared_ptr<Face>& face = *i;
+
+    if (doesMatchFilter(face)) {
+      ndn::nfd::FaceStatus status = face->getFaceStatus();
+      totalLength += status.wireEncode(outBuffer);
+    }
+  }
+  return totalLength;
+}
+
+} // namespace nfd
diff --git a/daemon/mgmt/face-query-status-publisher.hpp b/daemon/mgmt/face-query-status-publisher.hpp
new file mode 100644
index 0000000..237cecb
--- /dev/null
+++ b/daemon/mgmt/face-query-status-publisher.hpp
@@ -0,0 +1,64 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_DAEMON_MGMT_QUERIED_FACE_STATUS_PUBLISHER_HPP
+#define NFD_DAEMON_MGMT_QUERIED_FACE_STATUS_PUBLISHER_HPP
+
+#include "core/segment-publisher.hpp"
+#include "mgmt/app-face.hpp"
+#include "fw/face-table.hpp"
+
+#include <ndn-cxx/management/nfd-face-query-filter.hpp>
+
+namespace nfd {
+
+class FaceQueryStatusPublisher : public SegmentPublisher<AppFace>
+{
+public:
+  FaceQueryStatusPublisher(const FaceTable& faceTable,
+                           AppFace& face,
+                           const Name& prefix,
+                           const ndn::nfd::FaceQueryFilter& filter,
+                           ndn::KeyChain& keyChain);
+
+  virtual
+  ~FaceQueryStatusPublisher();
+
+  bool
+  doesMatchFilter(const shared_ptr<Face>& face);
+
+protected:
+
+  virtual size_t
+  generate(ndn::EncodingBuffer& outBuffer);
+
+private:
+  const FaceTable& m_faceTable;
+  const ndn::nfd::FaceQueryFilter& m_faceFilter;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_MGMT_QUERIED_FACE_STATUS_PUBLISHER_HPP
diff --git a/daemon/mgmt/manager-base.cpp b/daemon/mgmt/manager-base.cpp
index 04e2705..da553a5 100644
--- a/daemon/mgmt/manager-base.cpp
+++ b/daemon/mgmt/manager-base.cpp
@@ -99,6 +99,22 @@
   m_face->put(*responseData);
 }
 
+// for future commit
+//void
+//ManagerBase::sendNack(const Name& name)
+//{
+//  NFD_LOG_DEBUG("responding NACK to " << name);
+//
+//  ndn::MetaInfo meta;
+//  meta.setType(ndn::tlv::ContentType_Nack);
+//
+//  shared_ptr<Data> responseData(make_shared<Data>(name));
+//  responseData->setMetaInfo(meta);
+//
+//  m_keyChain.sign(*responseData);
+//  m_face->put(*responseData);
+//}
+
 bool
 ManagerBase::validateParameters(const ControlCommand& command,
                                 ControlParameters& parameters)
diff --git a/daemon/mgmt/manager-base.hpp b/daemon/mgmt/manager-base.hpp
index 15c19ee..feaa54a 100644
--- a/daemon/mgmt/manager-base.hpp
+++ b/daemon/mgmt/manager-base.hpp
@@ -94,6 +94,9 @@
                const std::string& text,
                const Block& body);
 
+  //void
+  //sendNack(const Name& name);
+
   virtual bool
   validateParameters(const ControlCommand& command,
                      ControlParameters& parameters);
diff --git a/tests/daemon/face/dummy-face.hpp b/tests/daemon/face/dummy-face.hpp
index ca45722..ec0adbf 100644
--- a/tests/daemon/face/dummy-face.hpp
+++ b/tests/daemon/face/dummy-face.hpp
@@ -44,6 +44,11 @@
   {
   }
 
+  DummyFaceImpl(const std::string& remoteUri, const std::string& localUri)
+    : FaceBase(FaceUri(remoteUri), FaceUri(localUri))
+  {
+  }
+
   virtual void
   sendInterest(const Interest& interest)
   {
diff --git a/tests/daemon/mgmt/face-manager.cpp b/tests/daemon/mgmt/face-manager.cpp
index aa1bf32..70d8d83 100644
--- a/tests/daemon/mgmt/face-manager.cpp
+++ b/tests/daemon/mgmt/face-manager.cpp
@@ -41,6 +41,7 @@
 #include "tests/test-common.hpp"
 #include "validation-common.hpp"
 #include "face-status-publisher-common.hpp"
+#include "face-query-status-publisher-common.hpp"
 #include "channel-status-common.hpp"
 
 #include <ndn-cxx/encoding/tlv.hpp>
@@ -1778,6 +1779,75 @@
   BOOST_REQUIRE(m_callbackFired);
 }
 
+class FaceQueryListFixture : public FaceQueryStatusPublisherFixture
+{
+public:
+  FaceQueryListFixture()
+    : m_manager(m_table, m_face, m_testKeyChain)
+  {
+
+  }
+
+  virtual
+  ~FaceQueryListFixture()
+  {
+
+  }
+
+protected:
+  FaceManager m_manager;
+  ndn::KeyChain m_testKeyChain;
+};
+
+BOOST_FIXTURE_TEST_CASE(TestValidQueryFilter, FaceQueryListFixture)
+{
+  Name queryName("/localhost/nfd/faces/query");
+  ndn::nfd::FaceQueryFilter queryFilter;
+  queryFilter.setUriScheme("dummy");
+  queryName.append(queryFilter.wireEncode());
+
+  shared_ptr<Interest> query(make_shared<Interest>(queryName));
+
+  // add expected faces
+  shared_ptr<DummyLocalFace> expectedFace1(make_shared<DummyLocalFace>());
+  m_referenceFaces.push_back(expectedFace1);
+  add(expectedFace1);
+
+  shared_ptr<DummyFace> expectedFace2(make_shared<DummyFace>());
+  m_referenceFaces.push_back(expectedFace2);
+  add(expectedFace2);
+
+  // add other faces
+  shared_ptr<DummyFace> face1(make_shared<DummyFace>("udp://", "udp://"));
+  add(face1);
+  shared_ptr<DummyLocalFace> face2(make_shared<DummyLocalFace>("tcp://", "tcp://"));
+  add(face2);
+
+  m_face->onReceiveData +=
+    bind(&FaceQueryStatusPublisherFixture::decodeFaceStatusBlock, this, _1);
+
+  m_manager.listQueriedFaces(*query);
+  BOOST_REQUIRE(m_finished);
+}
+
+//BOOST_FIXTURE_TEST_CASE(TestInvalidQueryFilter, FaceQueryListFixture)
+//{
+//  Name queryName("/localhost/nfd/faces/query");
+//  ndn::nfd::FaceStatus queryFilter;
+//  queryName.append(queryFilter.wireEncode());
+//
+//  shared_ptr<Interest> query(make_shared<Interest>(queryName));
+//
+//  shared_ptr<DummyLocalFace> face(make_shared<DummyLocalFace>());
+//  add(face);
+//
+//  m_face->onReceiveData +=
+//    bind(&FaceQueryStatusPublisherFixture::decodeNackBlock, this, _1);
+//
+//  m_manager.listQueriedFaces(*query);
+//  BOOST_REQUIRE(m_finished);
+//}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace tests
diff --git a/tests/daemon/mgmt/face-query-status-publisher-common.hpp b/tests/daemon/mgmt/face-query-status-publisher-common.hpp
new file mode 100644
index 0000000..06d562b
--- /dev/null
+++ b/tests/daemon/mgmt/face-query-status-publisher-common.hpp
@@ -0,0 +1,163 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_TESTS_NFD_MGMT_FACE_QUERY_STATUS_PUBLISHER_COMMON_HPP
+#define NFD_TESTS_NFD_MGMT_FACE_QUERY_STATUS_PUBLISHER_COMMON_HPP
+
+#include "mgmt/face-query-status-publisher.hpp"
+#include "mgmt/app-face.hpp"
+#include "mgmt/internal-face.hpp"
+#include "fw/forwarder.hpp"
+#include "face/udp-factory.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+
+#include <ndn-cxx/management/nfd-face-status.hpp>
+
+namespace nfd {
+namespace tests {
+
+class FaceQueryStatusPublisherFixture : public BaseFixture
+{
+public:
+
+  FaceQueryStatusPublisherFixture()
+    : m_table(m_forwarder)
+    , m_face(make_shared<InternalFace>())
+    , m_dummyFace(make_shared<DummyFace>())
+    , m_dummyLocalFace(make_shared<DummyLocalFace>())
+    , m_dummyUri(make_shared<DummyFace>("dummy://remoteUri", "dummy://localUri"))
+    , m_factory(UdpFactory())
+    , m_finished(false)
+  {
+  }
+
+  virtual
+  ~FaceQueryStatusPublisherFixture()
+  {
+  }
+
+  void
+  add(shared_ptr<Face> face)
+  {
+    m_table.add(face);
+  }
+
+  void
+  validateFaceStatus(const Block& statusBlock, const shared_ptr<Face>& reference)
+  {
+    ndn::nfd::FaceStatus status;
+    BOOST_REQUIRE_NO_THROW(status.wireDecode(statusBlock));
+
+    BOOST_CHECK_EQUAL(status.getFaceId(), reference->getId());
+    BOOST_CHECK_EQUAL(status.getRemoteUri(), reference->getRemoteUri().toString());
+    BOOST_CHECK_EQUAL(status.getLocalUri(), reference->getLocalUri().toString());
+
+    if (reference->isLocal()) {
+      BOOST_CHECK_EQUAL(status.getFaceScope(), ndn::nfd::FACE_SCOPE_LOCAL);
+    }
+    else {
+      BOOST_CHECK_EQUAL(status.getFaceScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
+    }
+
+    if (reference->isOnDemand()) {
+      BOOST_CHECK_EQUAL(status.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
+    }
+    else {
+      BOOST_CHECK_EQUAL(status.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
+    }
+
+    if (reference->isMultiAccess()) {
+      BOOST_CHECK_EQUAL(status.getLinkType(), ndn::nfd::LINK_TYPE_MULTI_ACCESS);
+    }
+    else {
+      BOOST_CHECK_EQUAL(status.getLinkType(), ndn::nfd::LINK_TYPE_POINT_TO_POINT);
+    }
+  }
+
+  void
+  decodeFaceStatusBlock(const Data& data)
+  {
+    BOOST_REQUIRE_EQUAL(data.getContentType(), ndn::MetaInfo::TYPE_BLOB);
+
+    Block payload = data.getContent();
+    m_buffer.appendByteArray(payload.value(), payload.value_size());
+
+    BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
+    if (data.getFinalBlockId() != data.getName()[-1]) {
+        return;
+    }
+
+    // wrap the Face Statuses in a single Content TLV for easy parsing
+    m_buffer.prependVarNumber(m_buffer.size());
+    m_buffer.prependVarNumber(tlv::Content);
+
+    ndn::Block parser(m_buffer.buf(), m_buffer.size());
+    parser.parse();
+
+    BOOST_REQUIRE_EQUAL(parser.elements_size(), m_referenceFaces.size());
+
+    std::list<shared_ptr<Face> >::const_iterator iReference = m_referenceFaces.begin();
+    for (Block::element_const_iterator i = parser.elements_begin();
+         i != parser.elements_end();
+         ++i) {
+      if (i->type() != ndn::tlv::nfd::FaceStatus) {
+          BOOST_FAIL("expected face status, got type #" << i->type());
+      }
+      validateFaceStatus(*i, *iReference);
+      ++iReference;
+    }
+    m_finished = true;
+  }
+
+  //void
+  //decodeNackBlock(const Data& data)
+  //{
+  //  BOOST_REQUIRE_EQUAL(data.getContentType(), ndn::tlv::ContentType_Nack);
+
+  //  m_finished = true;
+  //}
+
+protected:
+  Forwarder m_forwarder;
+  FaceTable m_table;
+  shared_ptr<InternalFace> m_face;
+  ndn::EncodingBuffer m_buffer;
+  std::list<shared_ptr<Face> > m_referenceFaces;
+  ndn::KeyChain m_keyChain;
+  shared_ptr<DummyFace> m_dummyFace;
+  shared_ptr<DummyLocalFace> m_dummyLocalFace;
+  shared_ptr<DummyFace> m_dummyUri;
+  UdpFactory m_factory;
+
+protected:
+  bool m_finished;
+};
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_NFD_MGMT_FACE_QUERY_STATUS_PUBLISHER_COMMON_HPP
diff --git a/tests/daemon/mgmt/face-query-status-publisher.cpp b/tests/daemon/mgmt/face-query-status-publisher.cpp
new file mode 100644
index 0000000..948ee88
--- /dev/null
+++ b/tests/daemon/mgmt/face-query-status-publisher.cpp
@@ -0,0 +1,131 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "face-query-status-publisher-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("FaceQueryStatusPublisherTest");
+
+BOOST_FIXTURE_TEST_SUITE(MgmtFaceQuerySatusPublisher, FaceQueryStatusPublisherFixture)
+
+BOOST_AUTO_TEST_CASE(NoConditionFilter)
+{
+  // filter without conditions matches all faces
+  ndn::nfd::FaceQueryFilter filter;
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), true);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyLocalFace), true);
+}
+
+BOOST_AUTO_TEST_CASE(AllConditionFilter)
+{
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setUriScheme("dummy")
+        .setRemoteUri("dummy://")
+        .setLocalUri("dummy://")
+        .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL)
+        .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
+        .setLinkType(ndn::nfd::LINK_TYPE_POINT_TO_POINT);
+
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), true);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyLocalFace), false);
+}
+
+BOOST_AUTO_TEST_CASE(UriSchemeFilter)
+{
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setUriScheme("dummyurischeme");
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  auto dummyUriScheme = make_shared<DummyFace>("dummyurischeme://", "dummyurischeme://");
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(dummyUriScheme), true);
+}
+
+BOOST_AUTO_TEST_CASE(RemoteUriFilter)
+{
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setRemoteUri("dummy://remoteUri");
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyUri), true);
+}
+
+BOOST_AUTO_TEST_CASE(LocalUriFilter)
+{
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setLocalUri("dummy://localUri");
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyUri), true);
+}
+
+
+BOOST_AUTO_TEST_CASE(LinkTypeFilter)
+{
+  shared_ptr<MulticastUdpFace> multicastFace = m_factory.createMulticastFace("0.0.0.0",
+                                                                             "224.0.0.1",
+                                                                             "20070");
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setLinkType(ndn::nfd::LINK_TYPE_MULTI_ACCESS);
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(multicastFace), true);
+}
+
+BOOST_AUTO_TEST_CASE(PersistencyFilter)
+{
+  shared_ptr<MulticastUdpFace> multicastFace = m_factory.createMulticastFace("0.0.0.0",
+                                                                             "224.0.0.1",
+                                                                             "20070");
+  ndn::nfd::FaceQueryFilter filter;
+  filter.setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
+  FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
+                                                    "/localhost/nfd/FaceStatusPublisherFixture",
+                                                    filter, m_keyChain);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
+  multicastFace->setOnDemand(true);
+  BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(multicastFace), true);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
