NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
face-status-publisher.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #include "core/logger.hpp"
27 #include "fw/face-table.hpp"
28 #include <boost/range/adaptor/reversed.hpp>
29 
30 #include <ndn-cxx/management/nfd-face-status.hpp>
31 
32 namespace nfd {
33 
34 NFD_LOG_INIT("FaceStatusPublisher");
35 
36 
38  AppFace& face,
39  const Name& prefix,
40  ndn::KeyChain& keyChain)
41  : SegmentPublisher(face, prefix, keyChain)
42  , m_faceTable(faceTable)
43 {
44 
45 }
46 
47 
49 {
50 
51 }
52 
53 size_t
54 FaceStatusPublisher::generate(ndn::EncodingBuffer& outBuffer)
55 {
56  size_t totalLength = 0;
57 
58  for (const shared_ptr<Face>& face : m_faceTable | boost::adaptors::reversed) {
59  ndn::nfd::FaceStatus status = face->getFaceStatus();
60  totalLength += status.wireEncode(outBuffer);
61  }
62  return totalLength;
63 }
64 
65 } // namespace nfd
provides a publisher of Status Dataset or other segmented octet stream
container of all Faces
Definition: face-table.hpp:38
virtual size_t generate(ndn::EncodingBuffer &outBuffer)
In a derived class, write the octets into outBuffer.
FaceStatusPublisher(const FaceTable &faceTable, AppFace &face, const Name &prefix, ndn::KeyChain &keyChain)
#define NFD_LOG_INIT(name)
Definition: logger.hpp:33