diff --git a/src/data.cpp b/src/data.cpp
index 054c975..8261449 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -329,53 +329,4 @@
   return os;
 }
 
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-// Permit deprecated usage for gcc only.
-// clang allows deprecated usage in deprecated functions, so it doesn't need this directive.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-lp::LocalControlHeaderFacade
-Data::getLocalControlHeader()
-{
-  return lp::LocalControlHeaderFacade(*this);
-}
-
-const lp::LocalControlHeaderFacade
-Data::getLocalControlHeader() const
-{
-  return lp::LocalControlHeaderFacade(const_cast<Data&>(*this));
-}
-
-uint64_t
-Data::getIncomingFaceId() const
-{
-  return getLocalControlHeader().getIncomingFaceId();
-}
-
-Data&
-Data::setIncomingFaceId(uint64_t incomingFaceId)
-{
-  getLocalControlHeader().setIncomingFaceId(incomingFaceId);
-  return *this;
-}
-
-lp::LocalControlHeaderFacade::CachingPolicy
-Data::getCachingPolicy() const
-{
-  return getLocalControlHeader().getCachingPolicy();
-}
-
-Data&
-Data::setCachingPolicy(lp::LocalControlHeaderFacade::CachingPolicy cachingPolicy)
-{
-  getLocalControlHeader().setCachingPolicy(cachingPolicy);
-  return *this;
-}
-
-#pragma GCC diagnostic pop
-
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
 } // namespace ndn
diff --git a/src/data.hpp b/src/data.hpp
index 17c04a5..b381c4e 100644
--- a/src/data.hpp
+++ b/src/data.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -22,14 +22,12 @@
 #ifndef NDN_DATA_HPP
 #define NDN_DATA_HPP
 
-#include "common.hpp"
 #include "name.hpp"
 #include "encoding/block.hpp"
 
 #include "signature.hpp"
 #include "meta-info.hpp"
 #include "key-locator.hpp"
-#include "lp/tags.hpp"
 #include "tag-host.hpp"
 
 namespace ndn {
@@ -283,46 +281,6 @@
   Data&
   setSignatureValue(const Block& value);
 
-  ///////////////////////////////////////////////////////////////
-
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-  /** @deprecated use getTag and setTag with lp::IncomingFaceIdTag, lp::CachePolicyTag
-   */
-  DEPRECATED(
-  lp::LocalControlHeaderFacade
-  getLocalControlHeader());
-
-  /** @deprecated use getTag with lp::IncomingFaceIdTag, lp::CachePolicyTag
-   */
-  DEPRECATED(
-  const lp::LocalControlHeaderFacade
-  getLocalControlHeader() const);
-
-  /** @deprecated use getTag<lp::IncomingFaceIdTag>
-   */
-  DEPRECATED(
-  uint64_t
-  getIncomingFaceId() const);
-
-  /** @deprecated use setTag<lp::IncomingFaceIdTag>
-   */
-  DEPRECATED(
-  Data&
-  setIncomingFaceId(uint64_t incomingFaceId));
-
-  /** @deprecated use getTag<lp::CachePolicyTag>
-   */
-  DEPRECATED(
-  lp::LocalControlHeaderFacade::CachingPolicy
-  getCachingPolicy() const);
-
-  /** @deprecated use setTag<lp::CachePolicyTag>
-   */
-  DEPRECATED(
-  Data&
-  setCachingPolicy(lp::LocalControlHeaderFacade::CachingPolicy cachingPolicy));
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
 public: // EqualityComparable concept
   bool
   operator==(const Data& other) const;
diff --git a/src/interest.cpp b/src/interest.cpp
index 1ad619c..7f4579f 100644
--- a/src/interest.cpp
+++ b/src/interest.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -485,53 +485,4 @@
   return os;
 }
 
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-// Permit deprecated usage for gcc only.
-// clang allows deprecated usage in deprecated functions, so it doesn't need this directive.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-lp::LocalControlHeaderFacade
-Interest::getLocalControlHeader()
-{
-  return lp::LocalControlHeaderFacade(*this);
-}
-
-const lp::LocalControlHeaderFacade
-Interest::getLocalControlHeader() const
-{
-  return lp::LocalControlHeaderFacade(const_cast<Interest&>(*this));
-}
-
-uint64_t
-Interest::getIncomingFaceId() const
-{
-  return getLocalControlHeader().getIncomingFaceId();
-}
-
-Interest&
-Interest::setIncomingFaceId(uint64_t incomingFaceId)
-{
-  getLocalControlHeader().setIncomingFaceId(incomingFaceId);
-  return *this;
-}
-
-uint64_t
-Interest::getNextHopFaceId() const
-{
-  return getLocalControlHeader().getNextHopFaceId();
-}
-
-Interest&
-Interest::setNextHopFaceId(uint64_t nextHopFaceId)
-{
-  getLocalControlHeader().setNextHopFaceId(nextHopFaceId);
-  return *this;
-}
-
-#pragma GCC diagnostic pop
-
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
 } // namespace ndn
diff --git a/src/interest.hpp b/src/interest.hpp
index c61d328..14ba33e 100644
--- a/src/interest.hpp
+++ b/src/interest.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -22,12 +22,9 @@
 #ifndef NDN_INTEREST_HPP
 #define NDN_INTEREST_HPP
 
-#include "common.hpp"
-
 #include "name.hpp"
 #include "selectors.hpp"
 #include "util/time.hpp"
-#include "lp/tags.hpp"
 #include "tag-host.hpp"
 #include "link.hpp"
 
@@ -275,45 +272,6 @@
   void
   refreshNonce();
 
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-public: // local control header
-  /** @deprecated use getTag and setTag with lp::IncomingFaceIdTag, lp::NextHopFaceIdTag
-   */
-  DEPRECATED(
-  lp::LocalControlHeaderFacade
-  getLocalControlHeader());
-
-  /** @deprecated use getTag with lp::IncomingFaceIdTag, lp::NextHopFaceIdTag
-   */
-  DEPRECATED(
-  const lp::LocalControlHeaderFacade
-  getLocalControlHeader() const);
-
-  /** @deprecated use getTag<lp::IncomingFaceIdTag>
-   */
-  DEPRECATED(
-  uint64_t
-  getIncomingFaceId() const);
-
-  /** @deprecated use setTag<lp::IncomingFaceIdTag>
-   */
-  DEPRECATED(
-  Interest&
-  setIncomingFaceId(uint64_t incomingFaceId));
-
-  /** @deprecated use getTag<lp::NextHopFaceIdTag>
-   */
-  DEPRECATED(
-  uint64_t
-  getNextHopFaceId() const);
-
-  /** @deprecated use setTag<lp::NextHopFaceIdTag>
-   */
-  DEPRECATED(
-  Interest&
-  setNextHopFaceId(uint64_t nextHopFaceId));
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
 public: // Selectors
   /**
    * @return true if Interest has any selector present
diff --git a/src/lp/tags.cpp b/src/lp/tags.cpp
deleted file mode 100644
index 53e0138..0000000
--- a/src/lp/tags.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "tags.hpp"
-#include "../encoding/nfd-constants.hpp"
-
-namespace ndn {
-namespace lp {
-
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-using ndn::nfd::INVALID_FACE_ID;
-
-LocalControlHeaderFacade::LocalControlHeaderFacade(TagHost& pkt)
-  : m_pkt(pkt)
-{
-}
-
-bool
-LocalControlHeaderFacade::hasIncomingFaceId() const
-{
-  return m_pkt.getTag<IncomingFaceIdTag>() != nullptr;
-}
-
-uint64_t
-LocalControlHeaderFacade::getIncomingFaceId() const
-{
-  shared_ptr<IncomingFaceIdTag> tag = m_pkt.getTag<IncomingFaceIdTag>();
-  if (tag == nullptr) {
-    return INVALID_FACE_ID;
-  }
-  return *tag;
-}
-
-void
-LocalControlHeaderFacade::setIncomingFaceId(uint64_t incomingFaceId)
-{
-  if (incomingFaceId == INVALID_FACE_ID) {
-    m_pkt.removeTag<IncomingFaceIdTag>();
-    return;
-  }
-
-  auto tag = make_shared<IncomingFaceIdTag>(incomingFaceId);
-  m_pkt.setTag(tag);
-}
-
-bool
-LocalControlHeaderFacade::hasNextHopFaceId() const
-{
-  return m_pkt.getTag<NextHopFaceIdTag>() != nullptr;
-}
-
-uint64_t
-LocalControlHeaderFacade::getNextHopFaceId() const
-{
-  shared_ptr<NextHopFaceIdTag> tag = m_pkt.getTag<NextHopFaceIdTag>();
-  if (tag == nullptr) {
-    return INVALID_FACE_ID;
-  }
-  return *tag;
-}
-
-void
-LocalControlHeaderFacade::setNextHopFaceId(uint64_t nextHopFaceId)
-{
-  if (nextHopFaceId == INVALID_FACE_ID) {
-    m_pkt.removeTag<NextHopFaceIdTag>();
-    return;
-  }
-
-  auto tag = make_shared<NextHopFaceIdTag>(nextHopFaceId);
-  m_pkt.setTag(tag);
-}
-
-bool
-LocalControlHeaderFacade::hasCachingPolicy() const
-{
-  return m_pkt.getTag<CachePolicyTag>() != nullptr;
-}
-
-LocalControlHeaderFacade::CachingPolicy
-LocalControlHeaderFacade::getCachingPolicy() const
-{
-  shared_ptr<CachePolicyTag> tag = m_pkt.getTag<CachePolicyTag>();
-  if (tag == nullptr) {
-    return INVALID_POLICY;
-  }
-  switch (tag->get().getPolicy()) {
-    case CachePolicyType::NO_CACHE:
-      return NO_CACHE;
-    default:
-      return INVALID_POLICY;
-  }
-}
-
-void
-LocalControlHeaderFacade::setCachingPolicy(CachingPolicy cachingPolicy)
-{
-  switch (cachingPolicy) {
-    case NO_CACHE: {
-      m_pkt.setTag(make_shared<CachePolicyTag>(CachePolicy().setPolicy(CachePolicyType::NO_CACHE)));
-      break;
-    }
-    default:
-      m_pkt.removeTag<CachePolicyTag>();
-      break;
-  }
-}
-
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-} // namespace lp
-} // namespace ndn
diff --git a/src/lp/tags.hpp b/src/lp/tags.hpp
index f91b3f1..c7fcefe 100644
--- a/src/lp/tags.hpp
+++ b/src/lp/tags.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -49,62 +49,6 @@
  */
 typedef SimpleTag<CachePolicy, 12> CachePolicyTag;
 
-
-#define NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-/** \brief expose NDNLPv2 tags as LocalControlHeader API
- *
- *  This class has the same public API as ndn::nfd::LocalControlHeader,
- *  but internally accesses IncomingFaceIdTag, NextHopFaceIdTag, CachePolicyTag
- *  on the host packet.
- *
- *  \deprecated use getTag and setTag with IncomingFaceIdTag, NextHopFaceIdTag, CachePolicyTag
- */
-class LocalControlHeaderFacade
-{
-public:
-  DEPRECATED(
-  explicit
-  LocalControlHeaderFacade(TagHost& pkt));
-
-  bool
-  hasIncomingFaceId() const;
-
-  uint64_t
-  getIncomingFaceId() const;
-
-  void
-  setIncomingFaceId(uint64_t incomingFaceId);
-
-  bool
-  hasNextHopFaceId() const;
-
-  uint64_t
-  getNextHopFaceId() const;
-
-  void
-  setNextHopFaceId(uint64_t nextHopFaceId);
-
-  bool
-  hasCachingPolicy() const;
-
-  enum CachingPolicy : uint8_t {
-    INVALID_POLICY = 0,
-    NO_CACHE       = 1
-  };
-
-  CachingPolicy
-  getCachingPolicy() const;
-
-  void
-  setCachingPolicy(CachingPolicy cachingPolicy);
-
-private:
-  TagHost& m_pkt;
-};
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
 } // namespace lp
 } // namespace ndn
 
diff --git a/src/management/nfd-local-control-header.hpp b/src/management/nfd-local-control-header.hpp
deleted file mode 100644
index 3bc049e..0000000
--- a/src/management/nfd-local-control-header.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_MANAGEMENT_NFD_LOCAL_CONTROL_HEADER_HPP
-#define NDN_MANAGEMENT_NFD_LOCAL_CONTROL_HEADER_HPP
-
-#include "../lp/tags.hpp"
-
-namespace ndn {
-namespace nfd {
-
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-typedef ndn::lp::LocalControlHeaderFacade LocalControlHeader;
-#else
-#error "LocalControlHeader is deleted"
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_LOCAL_CONTROL_HEADER_HPP
diff --git a/src/mgmt/dispatcher.cpp b/src/mgmt/dispatcher.cpp
index eeedc7c..a7f4a06 100644
--- a/src/mgmt/dispatcher.cpp
+++ b/src/mgmt/dispatcher.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "dispatcher.hpp"
+#include "../lp/tags.hpp"
 #include "../util/logger.hpp"
 
 #include <algorithm>
diff --git a/src/util/dummy-client-face.cpp b/src/util/dummy-client-face.cpp
index fb454cb..a1c6408 100644
--- a/src/util/dummy-client-face.cpp
+++ b/src/util/dummy-client-face.cpp
@@ -30,7 +30,7 @@
 namespace ndn {
 namespace util {
 
-const DummyClientFace::Options DummyClientFace::DEFAULT_OPTIONS { true, false };
+const DummyClientFace::Options DummyClientFace::DEFAULT_OPTIONS{true, false};
 
 class DummyClientFace::Transport : public ndn::Transport
 {
diff --git a/tests/unit-tests/face.t.cpp b/tests/unit-tests/face.t.cpp
index 6e81644..dfaefd5 100644
--- a/tests/unit-tests/face.t.cpp
+++ b/tests/unit-tests/face.t.cpp
@@ -20,11 +20,12 @@
  */
 
 #include "face.hpp"
-#include "util/scheduler.hpp"
+#include "lp/tags.hpp"
 #include "security/key-chain.hpp"
-#include "util/dummy-client-face.hpp"
 #include "transport/tcp-transport.hpp"
 #include "transport/unix-transport.hpp"
+#include "util/dummy-client-face.hpp"
+#include "util/scheduler.hpp"
 
 #include "boost-test.hpp"
 #include "identity-management-time-fixture.hpp"
diff --git a/tests/unit-tests/lp/tags.t.cpp b/tests/unit-tests/lp/tags.t.cpp
deleted file mode 100644
index 139c7f7..0000000
--- a/tests/unit-tests/lp/tags.t.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "lp/tags.hpp"
-#include "encoding/nfd-constants.hpp"
-#include "interest.hpp"
-#include "data.hpp"
-#include "lp/nack.hpp"
-
-#include <boost/mpl/vector.hpp>
-#include "boost-test.hpp"
-
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-#include "management/nfd-local-control-header.hpp"
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-namespace ndn {
-namespace lp {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(Lp)
-BOOST_AUTO_TEST_SUITE(TestTags)
-
-#ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-BOOST_AUTO_TEST_SUITE(Facade)
-
-typedef boost::mpl::vector<Interest, Data, Nack> TagHostTypes;
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(IncomingFaceId, T, TagHostTypes)
-{
-  T pkt;
-  LocalControlHeaderFacade lch(pkt);
-
-  BOOST_CHECK_EQUAL(lch.hasIncomingFaceId(), false);
-
-  lch.setIncomingFaceId(303);
-  shared_ptr<IncomingFaceIdTag> tag = static_cast<TagHost&>(pkt).getTag<IncomingFaceIdTag>();
-  BOOST_REQUIRE(tag != nullptr);
-  BOOST_CHECK_EQUAL(*tag, 303);
-
-  lch.setIncomingFaceId(ndn::nfd::INVALID_FACE_ID);
-  BOOST_CHECK(static_cast<TagHost&>(pkt).getTag<IncomingFaceIdTag>() == nullptr);
-
-  static_cast<TagHost&>(pkt).setTag(make_shared<IncomingFaceIdTag>(104));
-  BOOST_CHECK_EQUAL(lch.getIncomingFaceId(), 104);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(NextHopFaceId, T, TagHostTypes)
-{
-  T pkt;
-  LocalControlHeaderFacade lch(pkt);
-
-  BOOST_CHECK_EQUAL(lch.hasNextHopFaceId(), false);
-
-  lch.setNextHopFaceId(303);
-  shared_ptr<NextHopFaceIdTag> tag = static_cast<TagHost&>(pkt).getTag<NextHopFaceIdTag>();
-  BOOST_REQUIRE(tag != nullptr);
-  BOOST_CHECK_EQUAL(*tag, 303);
-
-  lch.setNextHopFaceId(ndn::nfd::INVALID_FACE_ID);
-  BOOST_CHECK(static_cast<TagHost&>(pkt).getTag<NextHopFaceIdTag>() == nullptr);
-
-  static_cast<TagHost&>(pkt).setTag(make_shared<NextHopFaceIdTag>(104));
-  BOOST_CHECK_EQUAL(lch.getNextHopFaceId(), 104);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(CachePolicy, T, TagHostTypes)
-{
-  using lp::CachePolicy;
-
-  T pkt;
-  LocalControlHeaderFacade lch(pkt);
-
-  BOOST_CHECK_EQUAL(lch.hasCachingPolicy(), false);
-
-  lch.setCachingPolicy(LocalControlHeaderFacade::NO_CACHE);
-  shared_ptr<CachePolicyTag> tag = static_cast<TagHost&>(pkt).getTag<CachePolicyTag>();
-  BOOST_REQUIRE(tag != nullptr);
-  BOOST_CHECK_EQUAL(tag->get().getPolicy(), CachePolicyType::NO_CACHE);
-
-  lch.setCachingPolicy(LocalControlHeaderFacade::INVALID_POLICY);
-  BOOST_CHECK(static_cast<TagHost&>(pkt).getTag<CachePolicyTag>() == nullptr);
-
-  auto tag2 = make_shared<CachePolicyTag>(CachePolicy().setPolicy(CachePolicyType::NO_CACHE));
-  static_cast<TagHost&>(pkt).setTag(tag2);
-  BOOST_CHECK_EQUAL(lch.getCachingPolicy(), LocalControlHeaderFacade::NO_CACHE);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // Facade
-
-BOOST_AUTO_TEST_CASE(InterestGetters)
-{
-  Interest interest;
-
-  interest.setTag(make_shared<IncomingFaceIdTag>(319));
-  BOOST_CHECK_EQUAL(interest.getLocalControlHeader().getIncomingFaceId(), 319);
-  BOOST_CHECK_EQUAL(interest.getIncomingFaceId(), 319);
-
-  interest.setTag(make_shared<NextHopFaceIdTag>(213));
-  BOOST_CHECK_EQUAL(interest.getLocalControlHeader().getNextHopFaceId(), 213);
-  BOOST_CHECK_EQUAL(interest.getNextHopFaceId(), 213);
-}
-
-BOOST_AUTO_TEST_CASE(InterestSetters)
-{
-  Interest interest;
-
-  interest.getLocalControlHeader().setIncomingFaceId(268);
-  shared_ptr<IncomingFaceIdTag> incomingFaceIdTag = interest.getTag<IncomingFaceIdTag>();
-  BOOST_REQUIRE(incomingFaceIdTag != nullptr);
-  BOOST_CHECK_EQUAL(*incomingFaceIdTag, 268);
-
-  interest.setIncomingFaceId(153);
-  incomingFaceIdTag = interest.getTag<IncomingFaceIdTag>();
-  BOOST_REQUIRE(incomingFaceIdTag != nullptr);
-  BOOST_CHECK_EQUAL(*incomingFaceIdTag, 153);
-
-  interest.getLocalControlHeader().setNextHopFaceId(307);
-  shared_ptr<NextHopFaceIdTag> nextHopFaceIdTag = interest.getTag<NextHopFaceIdTag>();
-  BOOST_REQUIRE(nextHopFaceIdTag != nullptr);
-  BOOST_CHECK_EQUAL(*nextHopFaceIdTag, 307);
-
-  interest.setNextHopFaceId(260);
-  nextHopFaceIdTag = interest.getTag<NextHopFaceIdTag>();
-  BOOST_REQUIRE(nextHopFaceIdTag != nullptr);
-  BOOST_CHECK_EQUAL(*nextHopFaceIdTag, 260);
-}
-
-BOOST_AUTO_TEST_CASE(DataGetters)
-{
-  Data data;
-
-  data.setTag(make_shared<IncomingFaceIdTag>(16));
-  BOOST_CHECK_EQUAL(data.getLocalControlHeader().getIncomingFaceId(), 16);
-  BOOST_CHECK_EQUAL(data.getIncomingFaceId(), 16);
-
-  data.setTag(make_shared<CachePolicyTag>(CachePolicy().setPolicy(CachePolicyType::NO_CACHE)));
-  BOOST_CHECK_EQUAL(data.getLocalControlHeader().getCachingPolicy(), nfd::LocalControlHeader::NO_CACHE);
-  BOOST_CHECK_EQUAL(data.getCachingPolicy(), nfd::LocalControlHeader::NO_CACHE);
-}
-
-BOOST_AUTO_TEST_CASE(DataSetters)
-{
-  Data data;
-
-  data.getLocalControlHeader().setIncomingFaceId(297);
-  shared_ptr<IncomingFaceIdTag> incomingFaceIdTag = data.getTag<IncomingFaceIdTag>();
-  BOOST_REQUIRE(incomingFaceIdTag != nullptr);
-  BOOST_CHECK_EQUAL(*incomingFaceIdTag, 297);
-
-  data.setIncomingFaceId(233);
-  incomingFaceIdTag = data.getTag<IncomingFaceIdTag>();
-  BOOST_REQUIRE(incomingFaceIdTag != nullptr);
-  BOOST_CHECK_EQUAL(*incomingFaceIdTag, 233);
-
-  data.getLocalControlHeader().setCachingPolicy(nfd::LocalControlHeader::NO_CACHE);
-  shared_ptr<CachePolicyTag> cachePolicyTag = data.getTag<CachePolicyTag>();
-  BOOST_REQUIRE(cachePolicyTag != nullptr);
-  BOOST_CHECK_EQUAL(cachePolicyTag->get().getPolicy(), CachePolicyType::NO_CACHE);
-
-  data.setCachingPolicy(nfd::LocalControlHeader::INVALID_POLICY);
-  cachePolicyTag = data.getTag<CachePolicyTag>();
-  BOOST_CHECK(cachePolicyTag == nullptr);
-}
-
-#pragma GCC diagnostic pop
-
-#endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER
-
-BOOST_AUTO_TEST_SUITE_END() // TestTags
-BOOST_AUTO_TEST_SUITE_END() // Lp
-
-} // namespace tests
-} // namespace lp
-} // namespace ndn
