diff --git a/src/mgmt/nfd/cs-info.cpp b/src/mgmt/nfd/cs-info.cpp
index b776c53..c7b7f7d 100644
--- a/src/mgmt/nfd/cs-info.cpp
+++ b/src/mgmt/nfd/cs-info.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -31,7 +31,9 @@
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<CsInfo>));
 
 CsInfo::CsInfo()
-  : m_nHits(0)
+  : m_capacity(0)
+  , m_nEntries(0)
+  , m_nHits(0)
   , m_nMisses(0)
 {
 }
@@ -49,6 +51,9 @@
 
   totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NMisses, m_nMisses);
   totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NHits, m_nHits);
+  totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NCsEntries, m_nEntries);
+  totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Flags, m_flags.to_ullong());
+  totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Capacity, m_capacity);
 
   totalLength += encoder.prependVarNumber(totalLength);
   totalLength += encoder.prependVarNumber(tlv::nfd::CsInfo);
@@ -83,6 +88,30 @@
   m_wire.parse();
   auto val = m_wire.elements_begin();
 
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::Capacity) {
+    m_nHits = readNonNegativeInteger(*val);
+    ++val;
+  }
+  else {
+    BOOST_THROW_EXCEPTION(Error("missing required Capacity field"));
+  }
+
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::Flags) {
+    m_flags = FlagsBitSet(static_cast<unsigned long long>(readNonNegativeInteger(*val)));
+    ++val;
+  }
+  else {
+    BOOST_THROW_EXCEPTION(Error("missing required Flags field"));
+  }
+
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::NCsEntries) {
+    m_nEntries = readNonNegativeInteger(*val);
+    ++val;
+  }
+  else {
+    BOOST_THROW_EXCEPTION(Error("missing required NCsEntries field"));
+  }
+
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NHits) {
     m_nHits = readNonNegativeInteger(*val);
     ++val;
@@ -101,6 +130,38 @@
 }
 
 CsInfo&
+CsInfo::setCapacity(uint64_t capacity)
+{
+  m_wire.reset();
+  m_capacity = capacity;
+  return *this;
+}
+
+CsInfo&
+CsInfo::setEnableAdmit(bool enableAdmit)
+{
+  m_wire.reset();
+  m_flags[BIT_CS_ENABLE_ADMIT] = enableAdmit;
+  return *this;
+}
+
+CsInfo&
+CsInfo::setEnableServe(bool enableServe)
+{
+  m_wire.reset();
+  m_flags[BIT_CS_ENABLE_SERVE] = enableServe;
+  return *this;
+}
+
+CsInfo&
+CsInfo::setNEntries(uint64_t nEntries)
+{
+  m_wire.reset();
+  m_nEntries = nEntries;
+  return *this;
+}
+
+CsInfo&
 CsInfo::setNHits(uint64_t nHits)
 {
   m_wire.reset();
@@ -119,17 +180,18 @@
 bool
 operator==(const CsInfo& a, const CsInfo& b)
 {
-  return a.getNHits() == b.getNHits() &&
-         a.getNMisses() == b.getNMisses();
+  return a.wireEncode() == b.wireEncode();
 }
 
 std::ostream&
-operator<<(std::ostream& os, const CsInfo& status)
+operator<<(std::ostream& os, const CsInfo& csi)
 {
   os << "CS: "
-     << status.getNHits() << (status.getNHits() == 1 ? " hit" : " hits")
-     << ", "
-     << status.getNMisses() << (status.getNMisses() == 1 ? " miss" : " misses");
+     << csi.getNEntries() << " entries, " << csi.getCapacity() << " max, "
+     << (csi.getEnableAdmit() ? "admit enabled, " : "admit disabled, ")
+     << (csi.getEnableServe() ? "serve enabled, " : "serve disabled, ")
+     << csi.getNHits() << (csi.getNHits() == 1 ? " hit, " : " hits, ")
+     << csi.getNMisses() << (csi.getNMisses() == 1 ? " miss" : " misses");
   return os;
 }
 
diff --git a/src/mgmt/nfd/cs-info.hpp b/src/mgmt/nfd/cs-info.hpp
index 0b9ad0a..cdd38a9 100644
--- a/src/mgmt/nfd/cs-info.hpp
+++ b/src/mgmt/nfd/cs-info.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,14 +23,16 @@
 #define NDN_MGMT_NFD_CS_INFO_HPP
 
 #include "../../encoding/block.hpp"
+#include "../../encoding/nfd-constants.hpp"
+
+#include <bitset>
 
 namespace ndn {
 namespace nfd {
 
-/**
- * \ingroup management
- * \brief represents the CS Information dataset
- * \sa https://redmine.named-data.net/projects/nfd/wiki/CsMgmt#CS-Information-Dataset
+/** \ingroup management
+ *  \brief represents the CS Information dataset
+ *  \sa https://redmine.named-data.net/projects/nfd/wiki/CsMgmt#CS-Information-Dataset
  */
 class CsInfo
 {
@@ -60,6 +62,52 @@
   void
   wireDecode(const Block& wire);
 
+  /** \brief get CS capacity (in number of packets)
+   */
+  uint64_t
+  getCapacity() const
+  {
+    return m_capacity;
+  }
+
+  CsInfo&
+  setCapacity(uint64_t capacity);
+
+  /** \brief get CS_ENABLE_ADMIT flag
+   */
+  bool
+  getEnableAdmit() const
+  {
+    return m_flags.test(BIT_CS_ENABLE_ADMIT);
+  }
+
+  CsInfo&
+  setEnableAdmit(bool enableAdmit);
+
+  /** \brief get CS_ENABLE_SERVE flag
+   */
+  bool
+  getEnableServe() const
+  {
+    return m_flags.test(BIT_CS_ENABLE_SERVE);
+  }
+
+  CsInfo&
+  setEnableServe(bool enableServe);
+
+  /** \brief get number of stored CS entries
+   */
+  uint64_t
+  getNEntries() const
+  {
+    return m_nEntries;
+  }
+
+  CsInfo&
+  setNEntries(uint64_t nEntries);
+
+  /** \brief get number of CS lookup hits since NFD starts
+   */
   uint64_t
   getNHits() const
   {
@@ -69,6 +117,8 @@
   CsInfo&
   setNHits(uint64_t nHits);
 
+  /** \brief get number of CS lookup misses since NFD starts
+   */
   uint64_t
   getNMisses() const
   {
@@ -79,6 +129,11 @@
   setNMisses(uint64_t nMisses);
 
 private:
+  using FlagsBitSet = std::bitset<2>;
+
+  uint64_t m_capacity;
+  FlagsBitSet m_flags;
+  uint64_t m_nEntries;
   uint64_t m_nHits;
   uint64_t m_nMisses;
   mutable Block m_wire;
@@ -96,7 +151,7 @@
 }
 
 std::ostream&
-operator<<(std::ostream& os, const CsInfo& status);
+operator<<(std::ostream& os, const CsInfo& csi);
 
 } // namespace nfd
 } // namespace ndn
